MarlinTrkProcessors  2.4.1
SetTrackerHitExtensions.h
1 #ifndef SetTrackerHitExtensions_h
2 #define SetTrackerHitExtensions_h 1
3 
4 #include "marlin/Processor.h"
5 #include "lcio.h"
6 #include <string>
7 
8 #include <EVENT/TrackerHit.h>
9 #include <EVENT/SimTrackerHit.h>
10 #include <IMPL/LCCollectionVec.h>
11 
12 #include <UTIL/BitField64.h>
13 #include <UTIL/ILDConf.h>
14 
15 namespace EVENT{
16  class MCParticle ;
17  class Track ;
18 }
19 
20 namespace IMPL {
21  class TrackImpl ;
22 }
23 
24 namespace UTIL{
25  class LCRelationNavigator ;
26 }
27 
28 
29 namespace MarlinTrk{
30  class IMarlinTrkSystem ;
31 }
32 
51 class SetTrackerHitExtensions : public marlin::Processor {
52 
53 public:
54 
55  virtual marlin::Processor* newProcessor() { return new SetTrackerHitExtensions ; }
56 
57 
59 
63  virtual void init() ;
64 
67  virtual void processRunHeader( LCRunHeader* run ) ;
68 
71  virtual void processEvent( LCEvent * evt ) ;
72 
73 
74  virtual void check( LCEvent * evt ) ;
75 
76 
79  virtual void end() ;
80 
81 protected:
82 
83 
84  const LCObjectVec* getSimHits( TrackerHit* trkhit, const FloatVec* weights = NULL);
85 
86  UTIL::BitField64* _encoder;
87  int getDetectorID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::ILDCellID0::subdet]; }
88  int getSideID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::ILDCellID0::side]; };
89  int getLayerID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::ILDCellID0::layer]; };
90  int getModuleID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::ILDCellID0::module]; };
91  int getSensorID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::ILDCellID0::sensor]; };
92 
93 
95  LCCollection* GetCollection( LCEvent * evt, std::string colName ) ;
96 
98  LCRelationNavigator* GetRelations( LCEvent * evt, std::string RelName ) ;
99 
101  void SetupInputCollections( LCEvent * evt ) ;
102 
103 
104 
107  std::vector< std::string > _colNamesTrackerHits;
108 
111  std::vector< std::string > _colNamesTrackerHitRelations;
112 
113 
114 // int _nEventPrintout ;
115  int _n_run ;
116  int _n_evt ;
117  int _current_evt_number ;
118 
119 
120  std::vector< LCCollection* > _colTrackerHits;
121  std::vector< LCRelationNavigator* > _navTrackerHitRel;
122 
123 
124 } ;
125 
126 #endif
127 
128 
129 
virtual void processEvent(LCEvent *evt)
Called for every event - the working horse.
Definition: SetTrackerHitExtensions.cc:107
LCCollection * GetCollection(LCEvent *evt, std::string colName)
helper function to get collection using try catch block
Definition: SetTrackerHitExtensions.cc:279
Set the LCIO Extensions to relate SimTrackerHits to TrackerHits via a pointer.
Definition: SetTrackerHitExtensions.h:51
virtual void init()
Called at the begin of the job before anything is read.
Definition: SetTrackerHitExtensions.cc:92
virtual void processRunHeader(LCRunHeader *run)
Called for every run.
Definition: SetTrackerHitExtensions.cc:102
std::vector< std::string > _colNamesTrackerHitRelations
input relation collections
Definition: SetTrackerHitExtensions.h:111
LCRelationNavigator * GetRelations(LCEvent *evt, std::string RelName)
helper function to get relations using try catch block
Definition: SetTrackerHitExtensions.cc:298
std::vector< std::string > _colNamesTrackerHits
input TrackerHit collections
Definition: SetTrackerHitExtensions.h:107
void SetupInputCollections(LCEvent *evt)
sets up the different collections
Definition: SetTrackerHitExtensions.cc:244
virtual void end()
Called after data processing for clean up.
Definition: SetTrackerHitExtensions.cc:232