Warning, /EICrecon/src/detectors/BEMC/README.md is written in an unsupported language. File is not indexed.
0001
0002 Here is an example of using a generic algorithm class with a JANA factory.
0003
0004 For the example, we implement the Juggler algorithm found here:
0005
0006 https://eicweb.phy.anl.gov/EIC/juggler/-/blob/master/JugDigi/src/components/CalorimeterHitDigi.cpp
0007
0008 This takes in objects of type _edm4hep::SimCalorimeterHit_ and produces
0009 objects of type _edm4hep::RawCalorimeterHit_. The _CalorimeterHitDigi_ class
0010 effectively knows nothing of JANA and could be used in other contexts.
0011
0012 There are two ways one could implement this in a JFactory:
0013
0014 1. Using multiple inheritance. This is what is done in the _JFactory_BEMCRawCalorimeterHit_ class.
0015
0016 2. Including the algorithm object as a data member. This is what is done in the
0017 _JFactory_BEMCRawCalorimeterHit_utility_ class.
0018
0019 The main difference in the coding is that for option 2, one needs to dereference the algorithm
0020 class object whenever referring to one of its members. Otherwise, they are line-for-line the same.
0021
0022 The _CalorimeterHitDigi_ class methods are not reentrant, This is not an issue
0023 since only one thread will be executing the method of a given object at a time.
0024 (The same method of multiple objects may be executed in parallel.) Thus,
0025 inputs and outputs of the class are stored in data members of _CalorimeterHitDigi_.
0026
0027 Two things I don't like about this system:
0028
0029 1. The data objects created by the generic algorithm must be effectively cloned into
0030 _BEMRawCalorimeterHit_ objects.
0031
0032 2. The framework has no way to automatically delete the _edm4hep::RawCalorimeterHit_ objects
0033 so we handle it manually in the _CalorimeterHitDigi_ class.
0034
0035
0036 One other option I have included is defining the _SetJANAConfigParameters_ templated method
0037 in the generic algorithm class _CalorimeterHitDigi_. This technically includes JANA code
0038 in the class, but since it is contained in the template, the compiler will never complain
0039 unless a template object is declared, Thus, the _CalorimeterHitDigi_ class can be used
0040 outside of the JANA framework. The pros/cons of doing this are:
0041
0042 pros:
0043 - It places this code in the header close to the data member definitions
0044 - It makes this code reusable for all calorimeters that use this algorithm
0045
0046 cons:
0047 - It places JANA code in a generic algorithm which could be confusing if used
0048 outside of JANA
0049 - It may be confusing to others trying to understand the code as to why this
0050 is a template
0051
0052
0053
0054
0055 <hr>
0056
0057 Below is a list of the simulated collections and types for reference.
0058
0059 ~~~
0060 Available Collections
0061
0062 Collection Name Data Type
0063 ----------------------------------- -----------------------------------
0064 B0PreshowerHits edm4hep::SimTrackerHit
0065 B0TrackerHits edm4hep::SimTrackerHit
0066 DIRCBarHits edm4hep::SimTrackerHit
0067 DRICHHits edm4hep::SimTrackerHit
0068 EcalBarrelHits edm4hep::SimCalorimeterHit
0069 EcalBarrelHitsContributions edm4hep::CaloHitContribution
0070 EcalEndcapNHits edm4hep::SimCalorimeterHit
0071 EcalEndcapNHitsContributions edm4hep::CaloHitContribution
0072 EcalEndcapPHits edm4hep::SimCalorimeterHit
0073 EcalEndcapPHitsContributions edm4hep::CaloHitContribution
0074 EventHeader edm4hep::EventHeader
0075 ForwardOffMTrackerHits1 edm4hep::SimTrackerHit
0076 ForwardOffMTrackerHits2 edm4hep::SimTrackerHit
0077 ForwardOffMTrackerHits3 edm4hep::SimTrackerHit
0078 ForwardOffMTrackerHits4 edm4hep::SimTrackerHit
0079 ForwardRomanPotHits1 edm4hep::SimTrackerHit
0080 ForwardRomanPotHits2 edm4hep::SimTrackerHit
0081 GEMTrackerEndcapHits1 edm4hep::SimTrackerHit
0082 GEMTrackerEndcapHits2 edm4hep::SimTrackerHit
0083 GEMTrackerEndcapHits3 edm4hep::SimTrackerHit
0084 HcalBarrelHits edm4hep::SimCalorimeterHit
0085 HcalBarrelHitsContributions edm4hep::CaloHitContribution
0086 HcalEndcapNHits edm4hep::SimCalorimeterHit
0087 HcalEndcapNHitsContributions edm4hep::CaloHitContribution
0088 HcalEndcapPHits edm4hep::SimCalorimeterHit
0089 HcalEndcapPHitsContributions edm4hep::CaloHitContribution
0090 MCParticles edm4hep::MCParticle
0091 MPGDTrackerBarrelHits1 edm4hep::SimTrackerHit
0092 MPGDTrackerBarrelHits2 edm4hep::SimTrackerHit
0093 MRICHHits edm4hep::SimTrackerHit
0094 TOFBarrelHits edm4hep::SimTrackerHit
0095 TaggerCalorimeter1Hits edm4hep::SimCalorimeterHit
0096 TaggerCalorimeter1HitsContributions edm4hep::CaloHitContribution
0097 TaggerCalorimeter2Hits edm4hep::SimCalorimeterHit
0098 TaggerCalorimeter2HitsContributions edm4hep::CaloHitContribution
0099 TaggerTracker1Hits edm4hep::SimTrackerHit
0100 TaggerTracker2Hits edm4hep::SimTrackerHit
0101 TrackerBarrelHits edm4hep::SimTrackerHit
0102 TrackerEndcapHits1 edm4hep::SimTrackerHit
0103 TrackerEndcapHits2 edm4hep::SimTrackerHit
0104 TrackerEndcapHits3 edm4hep::SimTrackerHit
0105 TrackerEndcapHits4 edm4hep::SimTrackerHit
0106 TrackerEndcapHits5 edm4hep::SimTrackerHit
0107 TrackerEndcapHits6 edm4hep::SimTrackerHit
0108 VertexBarrelHits edm4hep::SimTrackerHit
0109 ZDCEcalHits edm4hep::SimCalorimeterHit
0110 ZDCEcalHitsContributions edm4hep::CaloHitContribution
0111 ZDCHcalHits edm4hep::SimCalorimeterHit
0112 ZDCHcalHitsContributions edm4hep::CaloHitContribution
0113 ~~~