All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
LDCCaloDigi.h
Go to the documentation of this file.
1 #ifndef DIGITIZER_LDCCALODIGI_H
2 #define DIGITIZER_LDCCALODIGI_H 1
3 
4 #include "marlin/Processor.h"
5 #include <IMPL/CalorimeterHitImpl.h>
6 #include "lcio.h"
7 #include <string>
8 #include <vector>
9 
10 using namespace lcio ;
11 using namespace marlin ;
12 
13 const int MAX_LAYERS = 200;
14 const int MAX_STAVES = 16;
15 
16 /**
17 \addtogroup CaloDigi CaloDigi
18 @{
19 
20 \addtogroup LDCCaloDigi LDCCaloDigi
21 @{
22 Simple calorimeter digitizer Processor.
23 === LDCCaloDigi Processor === <br>
24  * Simple calorimeter digitizer Processor. <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  * ECALOutputCollection and HCALOutputCollection. <br>
38  * Conversion factors for ECAL and HCAL <br>
39  * are specified via processor parameters <br>
40  * CalibrECAL and CalibrHCAL. <br>
41  * It should be noted that ECAL and HCAL may consist <br>
42  * of several sections with different sampling fractions. <br>
43  * To handle this situation, calibration coefficients for <br>
44  * ECAL and HCAL are passed as arrays of floats with each element <br>
45  * in this array corresponding to certain section with <br>
46  * a given sampling fraction. <br>
47  * List of layer numbers terminating each section are given through <br>
48  * processor parameters ECALLayers and HCALLayers <br>
49  * There is an option to perform digitization of <br>
50  * both ECAL and HCAL in a digital mode. <br>
51  * Digital mode is activated by <br>
52  * setting processor parameters <br>
53  * IfDigitalEcal / IfDigitalHcal to 1. <br>
54  * In this case CalibrECAL / CalibrHCAL will <br>
55  * convert the number of hits into physical energy. <br>
56  * Thresholds on hit energies in ECAL and HCAL <br>
57  * are set with processor parameters <br>
58  * ECALThreshold and HCALThreshold. <br>
59  * Relations between CalorimeterHits and SimCalorimeterHits <br>
60  * are held in the corresponding relation collection. <br>
61  * The name of this relation collection is specified <br>
62  * via processor parameter RelationOutputCollection. <br>
63  * <h4>Input collections and prerequisites</h4>
64  * SimCalorimeterHit collections <br>
65  * <h4>Output</h4>
66  * CalorimeterHit collections for ECal and HCal. <br>
67  * Collection of relations <br>
68  * between CalorimeterHits and SimCalorimeterHits. <br>
69  * For ECal Calorimeter hits the variable type is set to 0, <br>
70  * whereas for HCal Calorimeter hits the type is set to 1 <br>
71  * @author A. Raspereza (DESY) <br>
72  * @author M. Thomson (DESY) <br>
73  * @version $Id$ <br>
74  */
75 class LDCCaloDigi : public Processor {
76 
77  public:
78 
79  LDCCaloDigi(const LDCCaloDigi&) = delete;
80  LDCCaloDigi& operator=(const LDCCaloDigi&) = delete;
81 
82  virtual Processor* newProcessor() { return new LDCCaloDigi ; }
83 
84 
85  LDCCaloDigi() ;
86 
87  virtual void init() ;
88 
89  virtual void processRunHeader( LCRunHeader* run ) ;
90 
91  virtual void processEvent( LCEvent * evt ) ;
92 
93  virtual void check( LCEvent * evt ) ;
94 
95  virtual void end() ;
96 
97  virtual void fillECALGaps() ;
98 
99 
100  protected:
101 
102  int _nRun{};
103  int _nEvt{};
104 
105  std::vector<std::string> _ecalCollections{};
106  std::vector<std::string> _hcalCollections{};
107 
108  std::string _outputEcalCollection{};
109  std::string _outputHcalCollection{};
110  std::string _outputRelCollection{};
111 
112  float _thresholdEcal{};
113  float _thresholdHcal{};
114 
115  int _digitalEcal{};
116  int _digitalHcal{};
117 
118  std::vector<float> _calibrCoeffEcal{};
119  std::vector<float> _calibrCoeffHcal{};
120 
121  std::vector<int> _ecalLayers{};
122  std::vector<int> _hcalLayers{};
123 
124  int _ecalGapCorrection{};
125  float _ecalGapCorrectionFactor{};
126  float _ecalModuleGapCorrectionFactor{};
127  float _ecalEndcapCorrectionFactor{};
128 
129  std::vector<CalorimeterHitImpl*> _calHitsByStaveLayer[MAX_STAVES][MAX_LAYERS];
130  std::vector<int> _calHitsByStaveLayerModule[MAX_STAVES][MAX_LAYERS];
131 
132  float _zOfEcalEndcap{};
133  float _barrelPixelSizeT[MAX_LAYERS]{};
134  float _barrelPixelSizeZ[MAX_LAYERS]{};
135  float _endcapPixelSizeX[MAX_LAYERS]{};
136  float _endcapPixelSizeY[MAX_LAYERS]{};
137  float _barrelStaveDir[MAX_STAVES][2]{};
138 
139 } ;
140 
141 /** @} @}*/
142 
143 #endif
const int MAX_STAVES
Definition: ILDCaloDigi.h:21
virtual Processor * newProcessor()
Definition: LDCCaloDigi.h:82
const int MAX_LAYERS
Definition: ILDCaloDigi.h:20