All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
DDStripSplitter.h
Go to the documentation of this file.
1 #ifndef DDStripSplitter_h
2 #define DDStripSplitter_h 1
3 #include "marlin/Processor.h"
4 #include "lcio.h"
5 #include <string>
6 
7 #include "TVector3.h"
8 #include <vector>
9 #include <cmath>
10 #include "UTIL/CellIDDecoder.h"
11 #include "EVENT/CalorimeterHit.h"
12 #include "IMPL/LCCollectionVec.h"
13 #include <IMPL/LCFlagImpl.h>
14 
15 #include "DDRec/DetectorData.h"
16 
17 using namespace lcio ;
18 using namespace marlin ;
19 using namespace std;
20 
21 /**
22 \addtogroup Clustering Clustering
23 @{
24 
25 \addtogroup DDStripSplitter DDStripSplitter
26 @{
27 implementation of Strip Splitting Algorithm, adapted for dd4hep based ILD models.
28 D. Jeans, Nov 2018.
29 */
30 
31 class DDStripSplitter : public Processor {
32 
33  public:
34 
35  virtual Processor* newProcessor() { return new DDStripSplitter ; }
36 
37  DDStripSplitter() ;
38 
39  DDStripSplitter( const DDStripSplitter& ) = delete;
40  DDStripSplitter& operator=(const DDStripSplitter&) = delete;
41 
42  /** Called at the begin of the job before anything is read.
43  * Use to initialize the processor, e.g. book histograms.
44  */
45  virtual void init() ;
46 
47  /** Called for every run.
48  */
49  virtual void processRunHeader( LCRunHeader* run ) ;
50 
51  /** Called for every event - the working horse.
52  */
53  virtual void processEvent( LCEvent * evt ) ;
54 
55  virtual void check( LCEvent * evt ) ;
56 
57  virtual void setupGeometry();
58 
59  /** Called after data processing for clean up.
60  */
61  virtual void end() ;
62 
63  protected:
64 
65  /** Input collection name.
66  */
67  std::string _mcParticleCollectionName{};
68 
69  std::string _ecalCollectionEvenLayers{};
70  std::string _ecalCollectionOddLayers{};
71 
72  std::string _inputRelationsColEven{};
73  std::string _inputRelationsColOdd{};
74 
75  // output collection names
76  std::string _stripIntersecCollName{};
77  std::string _evenStripEndsCollName{};
78  std::string _oddStripEndsCollName{};
79 
80  std::string _splitEcalCollection{};
81  std::string _unsplitEcalCollection{};
82 
83  std::string _splitEcalRelCol{};
84 
85  std::pair < TVector3, TVector3 > getStripEnds(CalorimeterHit* hit, int orientation, bool barrel);
86  TVector3 stripIntersect(CalorimeterHit* hit0, TVector3 axis0, CalorimeterHit* hit1, TVector3 axis1);
87  std::vector <CalorimeterHit*> getVirtualHits(LCEvent* evt, CalorimeterHit* hit, int orientation, bool barrel );
88 
89  CellIDDecoder<CalorimeterHit>* _decoder{};
90  CellIDDecoder<CalorimeterHit>* _decoder2{};
91 
92  float _stripLength{};
93  float _stripWidth{};
94  float _stripAspectRatio{};
95  float _cellSize{};
96  int _symmetry{};
97  int _nVirtual{};
98  int _ecalStrip_default_nVirt{};
99  bool _isBarrel{};
100 
101  bool _saveIntersections{};
102  IMPL::LCCollectionVec* intersectionHits{};
103  IMPL::LCCollectionVec* stripEndsEvenCol{};
104  IMPL::LCCollectionVec* stripEndsOddCol{};
105 
106  int _evenIsTransverse{};
107  enum {TRANSVERSE=0, LONGITUDINAL};
108 
109  dd4hep::rec::LayeredCalorimeterData* _caloGeomData{};
110 
111  LCFlagImpl _flag_rel{};
112  std::string _cellIDLayerString{};
113  std::string _cellIDModuleString{};
114  std::string _cellIDStaveString{};
115 
116 };
117 
118 /** @} @} */
119 
120 #endif
std::vector< LCCollection * > LCCollectionVec
Definition: SiStripClus.h:55
virtual Processor * newProcessor()