All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
MokkaCaloDigi.h
Go to the documentation of this file.
1 #ifndef MokkaCaloDigi1_h
2 #define MokkaCaloDigi1_h 1
3 
4 #include "marlin/Processor.h"
5 #include "EVENT/SimCalorimeterHit.h"
6 #include "IMPL/CalorimeterHitImpl.h"
7 #include "IMPL/LCCollectionVec.h"
8 #include "lcio.h"
9 #include <string>
10 
11 
12 using namespace lcio ;
13 using namespace marlin ;
14 
15 /**
16 \addtogroup CaloDigi CaloDigi
17 @{
18 
19 \addtogroup MokkaCaloDigi MokkaCaloDigi
20 @{
21  Calorimeter digitizer Processor for LCIO files produced by Mokka.
22 === MokkaCaloDigi Processor === <br>
23  * Calorimeter digitizer Processor for LCIO <br>
24  * files produced by Mokka. <br>
25  * Takes SimCalorimeterHit Collections and <br>
26  * produces CalorimeterHit Collections. <br>
27  * Simulated energy depositions in active <br>
28  * layers of calorimeters are <br>
29  * converted into physical energy. This is done <br>
30  * taking into account sampling fractions of <br>
31  * ECAL and HCAL. <br>
32  * User has to specify ECAL and HCAL SimCalorimeterHit <br>
33  * collections with processor parameters <br>
34  * HCALCollections and ECALCollections. <br>
35  * The names of the output CalorimeterHit Collections <br>
36  * are specified with processor parameters <br>
37  * NewECALCollName and NewHCALCollName. <br>
38  * Processor performs merging of neighboring virtual cells <br>
39  * in calorimeters into a larger cells. <br>
40  * Processor is meant to perform digitization of <br>
41  * calorimeter hits for an arbitrary detector geometry <br>
42  * parameter NewHCALCellSize and should be multiple of 10 <br>
43  * as virtual cell size used in Mokka is 10x10 mm2. <br>
44  * Conversion factors for ECAL and HCAL <br>
45  * are specified via processor parameters <br>
46  * CalibrECAL and CalibrHCAL. <br>
47  * It should be noted that ECAL and HCAL may consist <br>
48  * of several sections with different sampling fractions. <br>
49  * To handle this situation, calibration coefficients for <br>
50  * ECAL and HCAL are passed as arrays of floats with each element <br>
51  * in this array corresponding to certain section with <br>
52  * a given sampling fraction. <br>
53  * List of layer numbers terminating each section are given through <br>
54  * processor parameters ECALLayers and HCALLayers <br>
55  * There is an option to perform digitization of <br>
56  * both ECAL and HCAL in a digital mode. <br>
57  * Digital digitization is activated by <br>
58  * setting processor parameters <br>
59  * IfDigitalEcal / IfDigitalHcal to 1. <br>
60  * In this case CalibrECAL / CalibrHCAL will <br>
61  * convert the number of hits into physical energy. <br>
62  * Thresholds on hit energies in ECAL and HCAL <br>
63  * are set with processor parameters <br>
64  * ECALThreshold and HCALThreshold. <br>
65  * Relations between CalorimeterHits and SimCalorimeterHits <br>
66  * are held in the corresponding relation collection. <br>
67  * The name of this relation collection is specified <br>
68  * via processor parameter RelationOutputCollection. <br>
69  * @authors A. Raspereza and P. Krstonosic (DESY) <br>
70  * @version $Id$ <br>
71  */
72 
73 struct MyHit {
74  CalorimeterHitImpl * hit{};
75  std::vector<SimCalorimeterHit*> simHits{};
76 };
77 
78 
79 class MokkaCaloDigi : public Processor {
80 
81  public:
82 
83  MokkaCaloDigi(const MokkaCaloDigi&) = delete;
84  MokkaCaloDigi& operator=(const MokkaCaloDigi&) = delete;
85 
86  virtual Processor* newProcessor() { return new MokkaCaloDigi ; }
87 
88 
89  MokkaCaloDigi() ;
90 
91  /** Called at the begin of the job before anything is read.
92  * Use to initialize the processor, e.g. book histograms.
93  */
94  virtual void init() ;
95 
96  /** Called for every run.
97  */
98  virtual void processRunHeader( LCRunHeader* run ) ;
99 
100  /** Called for every event - the working horse.
101  */
102  virtual void processEvent( LCEvent * evt ) ;
103 
104 
105  virtual void check( LCEvent * evt ) ;
106 
107 
108  /** Called after data processing for clean up.
109  */
110  virtual void end() ;
111 
112 
113  MyHit * ProcessHitInBarrel(SimCalorimeterHit * hit);
114  MyHit * ProcessHitInEndcap(SimCalorimeterHit * hit);
115 
116  protected:
117 
118  std::vector<std::string> _ecalCollections{};
119  std::vector<std::string> _hcalCollections{};
120  std::string _newCollNameHCAL{};
121  std::string _newCollNameECAL{};
122  std::string _relationCollName{};
123  int _nRun{};
124  int _nEvt{};
125 
126  float _thresholdEcal{};
127  float _thresholdHcal{};
128 
129  int _digitalEcal{};
130  int _digitalHcal{};
131 
132  std::vector<int> _ecalLayers{};
133  std::vector<int> _hcalLayers{};
134  std::vector<float> _calibrCoeffEcal{};
135  std::vector<float> _calibrCoeffHcal{};
136  float * _endBarrelChamberLength{};
137  float * _barrelLateralWidth{};
138  float * _barrelOffsetMaxX{};
139  float * _endBarrelOffsetMaxZ{};
140  float _regularBarrelOffsetMaxZ{};
141  float _lateralPlateThickness{};
142  float _modulesGap{};
143  float _innerHcalRadius{};
144  int _numberOfHcalLayers{};
145  int _nStaves{};
146  int _nModules{};
147  int _cellScaleX{};
148  int _cellScaleZ{};
149  float _newCellSizeX{};
150  float _newCellSizeZ{};
151  float _hcalLayerThickness{};
152  float _hcalAbsorberThickness{};
153  float _hcalSensitiveThickness{};
154  float _virtualCellSizeX{};
155  float _virtualCellSizeZ{};
156  float _regularBarrelModuleLength{};
157  float _regularBarrelChamberLength{};
158  float _deltaPhi{};
159  std::vector< std::vector<MyHit*> > _calorimeterHitVec{};
160  LCCollectionVec * _relationCollection{};
161  int _startIEndcap{};
162  int _startJEndcap{};
163  float _startXEndcap{};
164  float _startZEndcap{};
165 
166 
167 
168 } ;
169 
170 /** @} @}*/
171 
172 #endif
std::vector< LCCollection * > LCCollectionVec
Definition: SiStripClus.h:55
virtual Processor * newProcessor()
Definition: MokkaCaloDigi.h:86