All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
NewLDCCaloDigi.h
Go to the documentation of this file.
1 #ifndef DIGITIZER_NEWLDCCALODIGI_H
2 #define DIGITIZER_NEWLDCCALODIGI_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 NewLDCCaloDigi NewLDCCaloDigi
21 @{
22 Simple calorimeter digitizer Processor.
23 === NewLDCCaloDigi 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 NewLDCCaloDigi : public Processor {
76 
77  public:
78 
79  virtual Processor* newProcessor() { return new NewLDCCaloDigi ; }
80 
81 
82  NewLDCCaloDigi() ;
83 
84  virtual void init() ;
85 
86  virtual void processRunHeader( LCRunHeader* run ) ;
87 
88  virtual void processEvent( LCEvent * evt ) ;
89 
90  virtual void check( LCEvent * evt ) ;
91 
92  virtual void end() ;
93 
94  virtual void fillECALGaps() ;
95 
96 
97  protected:
98 
99  int _nRun{};
100  int _nEvt{};
101 
102  std::vector<std::string> _ecalCollections{};
103  std::vector<std::string> _hcalCollections{};
104 
105 
106  std::string _outputEcalCollection0{};
107  std::string _outputEcalCollection1{};
108  std::string _outputEcalCollection2{};
109  std::string _outputHcalCollection0{};
110  std::string _outputHcalCollection1{};
111  std::string _outputHcalCollection2{};
112  std::vector<std::string> _outputEcalCollections{};
113  std::vector<std::string> _outputHcalCollections{};
114  std::string _outputRelCollection{};
115 
116  float _thresholdEcal{};
117  std::vector<float> _thresholdHcal{};
118 
119  int _digitalEcal{};
120  int _digitalHcal{};
121 
122  std::vector<float> _calibrCoeffEcal{};
123  std::vector<float> _calibrCoeffHcal{};
124 
125  std::vector<int> _ecalLayers{};
126  std::vector<int> _hcalLayers{};
127 
128  int _ecalGapCorrection{};
129  float _ecalGapCorrectionFactor{};
130  float _ecalModuleGapCorrectionFactor{};
131  float _ecalEndcapCorrectionFactor{};
132  float _hcalEndcapCorrectionFactor{};
133 
134 
135  std::string _cellIDLayerString{};
136  std::string _cellIDModuleString{};
137  std::string _cellIDStaveString{};
138 
139 
140  std::vector<CalorimeterHitImpl*> _calHitsByStaveLayer[MAX_STAVES][MAX_LAYERS];
141  std::vector<int> _calHitsByStaveLayerModule[MAX_STAVES][MAX_LAYERS];
142 
143  float _zOfEcalEndcap{};
144  float _barrelPixelSizeT[MAX_LAYERS]{};
145  float _barrelPixelSizeZ[MAX_LAYERS]{};
146  float _endcapPixelSizeX[MAX_LAYERS]{};
147  float _endcapPixelSizeY[MAX_LAYERS]{};
148  float _barrelStaveDir[MAX_STAVES][2]{};
149 
150 
151 } ;
152 
153 /** @} @}*/
154 
155 #endif
const int MAX_STAVES
Definition: ILDCaloDigi.h:21
virtual Processor * newProcessor()
const int MAX_LAYERS
Definition: ILDCaloDigi.h:20