All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
hybridRecoProcessor.h
Go to the documentation of this file.
1 #ifndef hybridRecoProcessor_h
2 #define hybridRecoProcessor_h 1
3 #include "marlin/Processor.h"
4 #include "lcio.h"
5 #include <string>
6 
7 #include "TTree.h"
8 #include "TFile.h"
9 #include "TH1F.h"
10 #include "TH2F.h"
11 #include "TVector3.h"
12 #include <vector>
13 #include <cmath>
14 #include "UTIL/CellIDDecoder.h"
15 #include "EVENT/CalorimeterHit.h"
16 #include "IMPL/LCCollectionVec.h"
17 
18 using namespace lcio ;
19 using namespace marlin ;
20 using namespace std;
21 
22 
23 /**
24 \addtogroup Clustering Clustering
25 @{
26 
27 \addtogroup hybridRecoProcessor hybridRecoProcessor
28 @{
29 Example processor for marlin.
30  *
31  * If compiled with MARLIN_USE_AIDA
32  * it creates a histogram (cloud) of the MCParticle energies.
33  *
34  * <h4>Input - Prerequisites</h4>
35  * Needs the collection of MCParticles.
36  *
37  * <h4>Output</h4>
38  * A histogram.
39  *
40  * @param CollectionName Name of the MCParticle collection
41  *
42  * @author F. Gaede, DESY
43  * @version $Id$
44  */
45 
46 class hybridRecoProcessor : public Processor {
47 
48  public:
49 
51  hybridRecoProcessor& operator=(const hybridRecoProcessor&) = delete;
52 
53  virtual Processor* newProcessor() { return new hybridRecoProcessor ; }
54 
56 
57  /** Called at the begin of the job before anything is read.
58  * Use to initialize the processor, e.g. book histograms.
59  */
60  virtual void init() ;
61 
62  /** Called for every run.
63  */
64  virtual void processRunHeader( LCRunHeader* run ) ;
65 
66  /** Called for every event - the working horse.
67  */
68  virtual void processEvent( LCEvent * evt ) ;
69 
70  virtual void check( LCEvent * evt ) ;
71 
72  virtual void setupGeometry();
73 
74  /** Called after data processing for clean up.
75  */
76  virtual void end() ;
77 
78  protected:
79 
80  /** Input collection name.
81  */
82 
83  std::vector <std::string> _ecalCollectionsCells{};
84  std::vector <std::string> _ecalCollectionsTranStrips{};
85  std::vector <std::string> _ecalCollectionsLongStrips{};
86 
87  std::pair < TVector3, TVector3 > getStripEnds(CalorimeterHit* hit, int orientation, bool barrel);
88  TVector3 stripIntersect(CalorimeterHit* hit0, TVector3 axis0, CalorimeterHit* hit1, TVector3 axis1);
89  std::vector <CalorimeterHit*> getVirtualHits(LCEvent* evt, CalorimeterHit* hit, int orientation, bool barrel );
90 
91  CellIDDecoder<CalorimeterHit>* _decoder{};
92  CellIDDecoder<CalorimeterHit>* _decoder2{};
93 
94  bool _makePlots{};
95  float _stripLength{};
96  float _stripWidth{};
97  float _stripAspectRatio{};
98  float _cellSize{};
99  int _symmetry{};
100  int _nVirtual{};
101  int _ecalStrip_default_nVirt{};
102 
103  bool _saveIntersections{};
104  IMPL::LCCollectionVec* intersectionHits{};
105  IMPL::LCCollectionVec* stripEndsTransCol{};
106  IMPL::LCCollectionVec* stripEndsLongCol{};
107 
108  TFile* _fout{};
109  TH2F* h_phiModuleCheck{};
110  TH2F* h_phiThetaMC{};
111 
112  TH1F* h_stripDist_intercept{};
113  TH1F* h_stripDist_nointercept{};
114 
115  TH2F* h_stavemodule[2]{};
116  TH1F* h_layer[2]{};
117 
118  TH2F* h_staveX[2]{};
119  TH2F* h_staveY[2]{};
120  TH2F* h_staveZ[2]{};
121 
122  TH2F* h_moduleX[2]{};
123  TH2F* h_moduleY[2]{};
124  TH2F* h_moduleZ[2]{};
125 
126 
127  TH2F* h_cth_phi[2][10][10]{};
128  TH2F* h_XY[2][10][10]{};
129 
130  enum {TRANSVERSE, LONGITUDINAL};
131 
132 };
133 
134 /** @} @} */
135 
136 #endif
virtual Processor * newProcessor()
std::vector< LCCollection * > LCCollectionVec
Definition: SiStripClus.h:55