SLIC  6.1.1
Simulation for the Linear Collider (SLIC) - Geant4 simulation application
LcioHitsCollectionBuilder.hh
Go to the documentation of this file.
1 #ifndef SLIC_LCIOHITSCOLLECTIONBUILDER_HH_
2 #define SLIC_LCIOHITSCOLLECTIONBUILDER_HH_ 1
3 
4 // SLIC
5 #include "Module.hh"
6 
7 // LCDD
8 #include "lcdd/detectors/SensitiveDetector.hh"
9 #include "lcdd/hits/CalorimeterHit.hh"
10 #include "lcdd/hits/TrackerHit.hh"
11 
12 // LCIO
13 #include "EVENT/LCEvent.h"
14 #include "IMPL/LCFlagImpl.h"
15 #include "IMPL/LCEventImpl.h"
16 #include "IMPL/LCCollectionVec.h"
17 #include "IMPL/SimCalorimeterHitImpl.h"
18 #include "IMPL/SimTrackerHitImpl.h"
19 
20 // Geant4
21 #include "G4Event.hh"
22 
23 namespace slic {
24 
25 class LcioMcpManager;
26 
33 
34  public:
35 
40 
45 
53  EVENT::LCEvent* createHitCollectionsFromEvent(const G4Event* event, EVENT::LCEvent* lcioEvent);
54 
59  void setLongFlag(bool longFlag = true);
60 
66  void setPDGFlag(bool pdgFlag = true);
67 
72  void setStoreMomentum(bool storeMomentum = true) {
73  m_storeMomentum = storeMomentum;
74  }
75 
81  return m_storeMomentum;
82  }
83 
84  private:
85 
86  /*
87  * Create the output LCIO hit collections from the current Geant4 event,
88  * using the instance variables of this class.
89  */
90  void createHitCollections();
91 
97  IMPL::LCCollectionVec* createCollectionVec(G4VHitsCollection* hitCollection, SensitiveDetector::EType sensitiveDetectorType);
98 
103  IMPL::LCCollectionVec* createTrackerCollectionVec(G4VHitsCollection* hitCollection);
104 
109  IMPL::LCCollectionVec* createCalorimeterCollectionVec(G4VHitsCollection* hitCollection);
110 
116  void saveHits(CalorimeterHitsCollection* calorimeterHits, IMPL::LCCollectionVec* collection);
117 
123  void saveHits(TrackerHitsCollection* trackerHits, IMPL::LCCollectionVec* collection);
124 
130  IMPL::SimCalorimeterHitImpl* createHit(CalorimeterHit* calorimeterHit);
131 
137  IMPL::SimTrackerHitImpl* createHit(TrackerHit* trackerHit);
138 
144  void addParticleContributions(CalorimeterHit* calorimeterHit, IMPL::SimCalorimeterHitImpl* simCalorimeterHit);
145 
149  void setFlagDefaults();
150 
156  void combineMcpHitContribs(const HitContributionList& allContributions, HitContributionList& combinedContributions);
157 
164  HitContribution* findHitContribution(int trackID, HitContributionList& contributions);
165 
170  void setEndcapFlag(SensitiveDetector* sensitiveDetector);
171 
178  static bool containsCollection(EVENT::LCEvent* event, const std::string& name);
179 
180  private:
181 
183  EVENT::LCEvent* m_currentLCEvent;
184 
186  const G4Event* m_currentG4Event;
187 
189  IMPL::LCFlagImpl m_trkCollFlag;
190  IMPL::LCFlagImpl m_calCollFlag;
191 
194 };
195 }
196 
197 #endif
Builds Lcio hits collections from G4/SLIC event data.
void combineMcpHitContribs(const HitContributionList &allContributions, HitContributionList &combinedContributions)
IMPL::LCCollectionVec * createCollectionVec(G4VHitsCollection *hitCollection, SensitiveDetector::EType sensitiveDetectorType)
HitContribution * findHitContribution(int trackID, HitContributionList &contributions)
void setEndcapFlag(SensitiveDetector *sensitiveDetector)
static bool containsCollection(EVENT::LCEvent *event, const std::string &name)
IMPL::LCCollectionVec * createTrackerCollectionVec(G4VHitsCollection *hitCollection)
EVENT::LCEvent * createHitCollectionsFromEvent(const G4Event *event, EVENT::LCEvent *lcioEvent)
void addParticleContributions(CalorimeterHit *calorimeterHit, IMPL::SimCalorimeterHitImpl *simCalorimeterHit)
IMPL::LCCollectionVec * createCalorimeterCollectionVec(G4VHitsCollection *hitCollection)
void saveHits(CalorimeterHitsCollection *calorimeterHits, IMPL::LCCollectionVec *collection)
IMPL::SimCalorimeterHitImpl * createHit(CalorimeterHit *calorimeterHit)
void setStoreMomentum(bool storeMomentum=true)
Base class for slic code modules that provides common functionality, such as logging to an output str...
Definition: Module.hh:25
@ name
Definition: LogStream.hh:26