CMS 3D CMS Logo

EcalTestPulseAnalyzer.h
Go to the documentation of this file.
1 #ifndef CalibCalorimetry_EcalLaserAnalyzer_EcalTestPulseAnalyzer_h
2 #define CalibCalorimetry_EcalLaserAnalyzer_EcalTestPulseAnalyzer_h
3 
4 #include <memory>
5 
6 #include <vector>
7 #include <map>
8 
10 
15 
16 class TFile;
17 class TTree;
18 
19 // Define geometrical constants
20 // NOT the same for "EB" and "EE"
21 //
22 // "EB" "EE"
23 //
24 // 0 0
25 // 1 2 1 2
26 // 3 4
27 // 5 6
28 // 7 8
29 //
30 //
31 
32 // "EB" geometry
33 #define NCRYSEB 1700 // Number of crystals per EB supermodule
34 #define NMODEB 9 // Number of EB submodules
35 #define NPNPERMOD 2 // Number of PN per module
36 
37 // "EE" geometry
38 #define NCRYSEE 830 // Number of crystals per EE supermodule
39 #define NMODEE 21 // Number of EE submodules
40 
41 #define NGAINPN 2 // Number of gains
42 #define NGAINAPD 4 // Number of gains
43 
45 public:
46  explicit EcalTestPulseAnalyzer(const edm::ParameterSet &iConfig);
47  ~EcalTestPulseAnalyzer() override;
48 
49  void analyze(const edm::Event &e, const edm::EventSetup &c) override;
50  void beginJob() override;
51  void endJob() override;
52 
53 private:
54  int iEvent;
55 
61 
67 
68  // Framework parameters
69 
70  const unsigned int _nsamples;
71  const unsigned int _presample;
72  const unsigned int _firstsample;
73  const unsigned int _lastsample;
74  const unsigned int _samplemin;
75  const unsigned int _samplemax;
76  const unsigned int _nsamplesPN;
77  const unsigned int _presamplePN;
78  const unsigned int _firstsamplePN;
79  const unsigned int _lastsamplePN;
80  const unsigned int _niter;
81  const double _chi2max;
82  const double _timeofmax;
84  const int _fedid;
85 
87 
88  // Output file names
89 
92 
93  // Define geometrical constants
94  // Default values correspond to "EB" geometry (1700 crystals)
95 
96  unsigned int nCrys;
97  unsigned int nMod;
98  unsigned int nGainPN;
99  unsigned int nGainAPD;
100 
101  // Count TP Events
102  int TPEvents;
103 
104  double ret_data[20];
105 
106  int towerID;
108 
109  // Identify run
110 
111  int runType;
112  int runNum;
113  int fedID;
114  int dccID;
115  int side;
116  int iZ;
117 
118  // Root Files
119 
120  TFile *outFile; // from 'analyze': Data
121  TFile *resFile; // from 'endJob': Results
122 
123  // Temporary data trees
124 
125  TTree *trees[NCRYSEB];
126 
127  // Declaration of leaves types
128 
129  int phi, eta;
130  int event;
131  double adc[10];
132  double pn[50];
133 
134  int apdGain;
135  int pnGain;
136  int pnG;
137  double apdAmpl;
138  double apdTime;
139  double pnAmpl0;
140  double pnAmpl1;
141  double pnAmpl;
142 
143  // Results trees
144 
145  TTree *restrees;
146  TTree *respntrees;
147 
148  std::map<int, int> channelMapEE;
149  std::vector<int> dccMEM;
150  std::vector<int> modules;
151 
152  // Declaration of leaves types
153 
154  int ieta, iphi, flag, gain;
157  double APD[6], PN[6];
158 
160  unsigned int iModule[NCRYSEB];
162 
163  unsigned int firstChanMod[NMODEB];
165 };
166 #endif
const unsigned int _niter
std::map< int, int > channelMapEE
unsigned int iModule[1700]
const unsigned int _presamplePN
const unsigned int _samplemax
#define NCRYSEB
void analyze(const edm::Event &e, const edm::EventSetup &c) override
std::vector< int > modules
const std::string digiProducer_
const edm::EDGetTokenT< EcalPnDiodeDigiCollection > pnDiodeDigiToken_
const unsigned int _nsamplesPN
const edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcd > mappingToken_
EcalTestPulseAnalyzer(const edm::ParameterSet &iConfig)
edm::EDGetTokenT< EBDigiCollection > ebDigiToken_
#define NMODEB
const std::string eventHeaderCollection_
const std::string _ecalPart
const unsigned int _firstsample
const unsigned int _lastsample
const std::string digiCollection_
const unsigned int _nsamples
edm::EDGetTokenT< EEDigiCollection > eeDigiToken_
const unsigned int _lastsamplePN
const edm::EDGetTokenT< EcalRawDataCollection > rawDataToken_
const std::string eventHeaderProducer_
const std::string digiPNCollection_
unsigned int isFirstChanModFilled[9]
const unsigned int _samplemin
const unsigned int _firstsamplePN
const unsigned int _presample