MarlinTrkProcessors  2.4.1
SplitCollectionByLayer.h
1 #ifndef SplitCollectionByLayer_h
2 #define SplitCollectionByLayer_h 1
3 
4 #include "marlin/Processor.h"
5 #include "marlin/EventModifier.h"
6 
7 #include "lcio.h"
8 #include <string>
9 
10 
11 using namespace lcio ;
12 using namespace marlin ;
13 
14 
27 class SplitCollectionByLayer : public Processor {
28 
29 protected:
30 
32  struct OutColInfo{
33  std::string name ;
34  unsigned layer0 ;
35  unsigned layer1 ;
36  LCCollection* collection ;
37  };
38 
40  enum HitType{
41  SimTrackerHitType = 1,
42  TrackerHitType,
43  SimCalorimeterHitType,
44  CalorimeterHitType,
45  UnkownType
46  };
47 
48  public:
49 
50  virtual Processor* newProcessor() { return new SplitCollectionByLayer ; }
51 
52 
54 
55  virtual const std::string & name() const { return Processor::name() ; }
56 
60  virtual void init() ;
61 
64  virtual void processRunHeader( LCRunHeader* run ) ;
65 
68  virtual void processEvent( LCEvent * evt ) ;
69 
70 
71  virtual void check( LCEvent * evt ) ;
72 
73 
76  virtual void end() ;
77 
78 
79  protected:
80 
82  std::string _colName ;
83 
85  StringVec _outColAndLayers ;
86 
87  std::vector<OutColInfo> _outCols ;
88 
89  HitType _type ;
90 
91  int _nRun ;
92  int _nEvt ;
93 } ;
94 
95 #endif
96 
97 
98 
Utility processor that allows to split a collection of Hits into several collections based on the lay...
Definition: SplitCollectionByLayer.h:27
helper struct
Definition: SplitCollectionByLayer.h:32
StringVec _outColAndLayers
Output collections and layers:
Definition: SplitCollectionByLayer.h:85
HitType
Enum used for hit types.
Definition: SplitCollectionByLayer.h:40