CMS 3D CMS Logo

EcalLaserAnalyzer.h
Go to the documentation of this file.
1 // $Id: EcalLaserAnalyzer.h
2 
3 #include <memory>
4 
5 #include <vector>
6 #include <map>
7 
9 
10 class TFile;
11 class TTree;
12 class TProfile;
13 class TPNCor;
14 class TPN;
15 class TAPD;
16 class TMom;
17 class TShapeAnalysis;
18 class TAPDPulse;
19 class TPNPulse;
20 class TMem;
21 
22 // Define geometrical constants
23 // NOT the same for "EB" and "EE"
24 //
25 // "EB" "EE"
26 //
27 // 0 0
28 // 1 2 1 2
29 // 3 4
30 // 5 6
31 // 7 8
32 //
33 //
34 
35 // "EB" geometry
36 #define NCRYSEB 1700 // Number of crystals per EB supermodule
37 #define NMODEB 9 // Number of EB submodules
38 #define NPNPERMOD 2 // Number of PN per module
39 
40 // "EE" geometry
41 #define NCRYSEE 830 // Number of crystals per EE supermodule
42 #define NMODEE 22 // Number of EE submodules
43 
44 #define NSIDES 2 // Number of sides
45 #define NREFCHAN 2 // Ref number for APDB
46 
48 public:
49  explicit EcalLaserAnalyzer(const edm::ParameterSet &iConfig);
50  ~EcalLaserAnalyzer() override;
51 
52  void analyze(const edm::Event &e, const edm::EventSetup &c) override;
53  void beginJob() override;
54  void endJob() override;
55 
56  void setGeomEB(int etaG, int phiG, int module, int tower, int strip, int xtal, int apdRefTT, int channel, int lmr);
57  void setGeomEE(
58  int etaG, int phiG, int iX, int iY, int iZ, int module, int tower, int ch, int apdRefTT, int channel, int lmr);
59 
60  enum VarCol { iBlue, iRed, nColor };
61 
62 private:
63  int iEvent;
64 
65  // Framework parameters
66 
67  unsigned int _nsamples;
68  unsigned int _presample;
69  unsigned int _firstsample;
70  unsigned int _lastsample;
71  unsigned int _nsamplesPN;
72  unsigned int _presamplePN;
73  unsigned int _firstsamplePN;
74  unsigned int _lastsamplePN;
75  unsigned int _timingcutlow;
76  unsigned int _timingcuthigh;
77  unsigned int _timingquallow;
78  unsigned int _timingqualhigh;
82  double _presamplecut;
83  unsigned int _niter;
84  bool _fitab;
85  double _alpha;
86  double _beta;
87  unsigned int _nevtmax;
88  double _noise;
89  double _chi2cut;
91  bool _docorpn;
92  int _fedid;
94  double _qualpercent;
95  int _debug;
96 
102 
104 
112 
113  // Output file names
114 
120 
122  unsigned int nevtAB[NCRYSEB];
123 
124  // Define geometrical constants
125 
126  unsigned int nCrys;
127  unsigned int nPNPerMod;
128  unsigned int nRefChan;
129  unsigned int nRefTrees;
130  unsigned int nMod;
131  unsigned int nSides;
132 
133  // Identify run type
134 
135  int runType;
136  int runNum;
137 
138  // Identify channel
139 
140  int towerID;
142  int fedID;
143  int dccID;
144  int side;
146  int iZ;
147 
148  // Count Laser Events
150 
151  // PN linearity corrections
152 
154 
155  // Temporary root files and trees
156 
157  TFile *ADCFile;
158  TTree *ADCtrees[NCRYSEB];
159 
160  TFile *APDFile;
161  TTree *APDtrees[NCRYSEB];
163 
164  TFile *resFile;
165  TTree *restrees[nColor];
167 
168  std::vector<int> colors;
169  std::map<unsigned int, unsigned int> channelMapEE;
170  std::vector<int> modules;
171  std::map<int, unsigned int> apdRefMap[2];
172 
173  // Declaration of leaves types for temporary trees
174 
175  int phi, eta;
176  int event;
177  int color;
178  double adc[10];
179  int adcG[10];
180  double pn0, pn1;
181  double pn[50];
182  int pnG[50];
183  double apdAmpl;
184  double apdAmplA;
185  double apdAmplB;
186  double apdTime;
187  double pnAmpl;
188 
189  int eventref;
190  int colorref;
191 
192  double *adcNoPed;
193  double *pnNoPed;
194 
195  // declare TPN stuff
198 
199  // declare TAPD stuff
202 
204 
205  // Declaration of leaves types for results tree
206 
209 
210  double APD[6], Time[6], PN[6], APDoPN[6], APDoPNA[6], APDoPNB[6], APDoAPDA[6], APDoAPDB[6], PNoPN[6], PNoPNA[6],
211  PNoPNB[6];
212 
213  // [0]=mean, [1]=rms, [2]=L3, [3]=nevt, [4]=min, [5]=max
214  // flag is 1 if fit if there is data, 0 if there is no data
215 
217  unsigned int iModule[NCRYSEB];
219  unsigned int firstChanMod[NMODEE];
221 
222  // Quality Checks variables and flags
223 
227 
231 
232  bool isGainOK;
234 };
EcalLaserAnalyzer::_fedid
int _fedid
Definition: EcalLaserAnalyzer.h:92
EcalLaserAnalyzer::pn
double pn[50]
Definition: EcalLaserAnalyzer.h:181
EcalLaserAnalyzer::resfile
std::string resfile
Definition: EcalLaserAnalyzer.h:119
EcalLaserAnalyzer::PNFirstAnal
TPN * PNFirstAnal[22][2][nColor]
Definition: EcalLaserAnalyzer.h:196
EcalLaserAnalyzer::nEvtBadTiming
int nEvtBadTiming[1700]
Definition: EcalLaserAnalyzer.h:225
EcalLaserAnalyzer::EcalLaserAnalyzer
EcalLaserAnalyzer(const edm::ParameterSet &iConfig)
Definition: EcalLaserAnalyzer.cc:56
EcalLaserAnalyzer::modules
std::vector< int > modules
Definition: EcalLaserAnalyzer.h:170
EcalLaserAnalyzer::adcNoPed
double * adcNoPed
Definition: EcalLaserAnalyzer.h:192
EcalLaserAnalyzer::_presamplePN
unsigned int _presamplePN
Definition: EcalLaserAnalyzer.h:72
EcalLaserAnalyzer::apdRefMap
std::map< int, unsigned int > apdRefMap[2]
Definition: EcalLaserAnalyzer.h:171
EcalLaserAnalyzer::_ratiomaxcutlow
double _ratiomaxcutlow
Definition: EcalLaserAnalyzer.h:81
EcalLaserAnalyzer::Time
double Time[6]
Definition: EcalLaserAnalyzer.h:210
EcalLaserAnalyzer::APDFile
TFile * APDFile
Definition: EcalLaserAnalyzer.h:160
TPN
Definition: TPN.h:8
EcalLaserAnalyzer::pnAmpl
double pnAmpl
Definition: EcalLaserAnalyzer.h:187
EcalLaserAnalyzer::wasTimingOK
bool wasTimingOK[1700]
Definition: EcalLaserAnalyzer.h:229
EcalLaserAnalyzer::_niter
unsigned int _niter
Definition: EcalLaserAnalyzer.h:83
EcalLaserAnalyzer::channelID
int channelID
Definition: EcalLaserAnalyzer.h:141
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
EcalLaserAnalyzer::side
int side
Definition: EcalLaserAnalyzer.h:144
EcalLaserAnalyzer::eventref
int eventref
Definition: EcalLaserAnalyzer.h:189
EcalLaserAnalyzer::pnG
int pnG[50]
Definition: EcalLaserAnalyzer.h:182
EcalLaserAnalyzer::_nevtmax
unsigned int _nevtmax
Definition: EcalLaserAnalyzer.h:87
EcalLaserAnalyzer::idccID
int idccID[1700]
Definition: EcalLaserAnalyzer.h:218
hgcalTowerProducer_cfi.tower
tower
Definition: hgcalTowerProducer_cfi.py:4
EcalLaserAnalyzer::_ratiomincutlow
double _ratiomincutlow
Definition: EcalLaserAnalyzer.h:79
EcalLaserAnalyzer::eta
int eta
Definition: EcalLaserAnalyzer.h:175
EcalLaserAnalyzer::nRefChan
unsigned int nRefChan
Definition: EcalLaserAnalyzer.h:128
EcalLaserAnalyzer::_ratiomincuthigh
double _ratiomincuthigh
Definition: EcalLaserAnalyzer.h:80
EcalLaserAnalyzer::iEvent
int iEvent
Definition: EcalLaserAnalyzer.h:63
EcalLaserAnalyzer::~EcalLaserAnalyzer
~EcalLaserAnalyzer() override
Definition: EcalLaserAnalyzer.cc:199
EDAnalyzer.h
EcalLaserAnalyzer::_timingquallow
unsigned int _timingquallow
Definition: EcalLaserAnalyzer.h:77
EcalLaserAnalyzer::nMod
unsigned int nMod
Definition: EcalLaserAnalyzer.h:130
EcalLaserAnalyzer::Delta12
TMom * Delta12
Definition: EcalLaserAnalyzer.h:101
EcalLaserAnalyzer::VarCol
VarCol
Definition: EcalLaserAnalyzer.h:60
EcalLaserAnalyzer::APD
double APD[6]
Definition: EcalLaserAnalyzer.h:210
EcalLaserAnalyzer::pn0
double pn0
Definition: EcalLaserAnalyzer.h:180
EcalLaserAnalyzer::digiCollection_
std::string digiCollection_
Definition: EcalLaserAnalyzer.h:107
EcalLaserAnalyzer::wasGainOK
bool wasGainOK[1700]
Definition: EcalLaserAnalyzer.h:228
EcalLaserAnalyzer::nRefTrees
unsigned int nRefTrees
Definition: EcalLaserAnalyzer.h:129
EcalLaserAnalyzer::apdAmplB
double apdAmplB
Definition: EcalLaserAnalyzer.h:185
EcalLaserAnalyzer::digiPNCollection_
std::string digiPNCollection_
Definition: EcalLaserAnalyzer.h:108
edm::EDAnalyzer
Definition: EDAnalyzer.h:28
TAPDPulse
Definition: TAPDPulse.h:7
EcalLaserAnalyzer::isFirstChanModFilled
unsigned int isFirstChanModFilled[22]
Definition: EcalLaserAnalyzer.h:220
EcalLaserAnalyzer::_lastsamplePN
unsigned int _lastsamplePN
Definition: EcalLaserAnalyzer.h:74
EcalLaserAnalyzer::digiProducer_
std::string digiProducer_
Definition: EcalLaserAnalyzer.h:109
EcalLaserAnalyzer::_docorpn
bool _docorpn
Definition: EcalLaserAnalyzer.h:91
EcalLaserAnalyzer::_timingcutlow
unsigned int _timingcutlow
Definition: EcalLaserAnalyzer.h:75
EcalLaserAnalyzer::PNAnal
TPN * PNAnal[22][2][nColor]
Definition: EcalLaserAnalyzer.h:197
EcalLaserAnalyzer::runNum
int runNum
Definition: EcalLaserAnalyzer.h:136
EcalLaserAnalyzer::beginJob
void beginJob() override
Definition: EcalLaserAnalyzer.cc:207
EcalLaserAnalyzer::_timingcuthigh
unsigned int _timingcuthigh
Definition: EcalLaserAnalyzer.h:76
EcalLaserAnalyzer::_qualpercent
double _qualpercent
Definition: EcalLaserAnalyzer.h:94
NCRYSEB
#define NCRYSEB
Definition: EcalLaserAnalyzer.h:36
EcalLaserAnalyzer::_nsamplesPN
unsigned int _nsamplesPN
Definition: EcalLaserAnalyzer.h:71
EcalLaserAnalyzer::_presample
unsigned int _presample
Definition: EcalLaserAnalyzer.h:68
EcalLaserAnalyzer::APDoPNB
double APDoPNB[6]
Definition: EcalLaserAnalyzer.h:210
EcalLaserAnalyzer::nSides
unsigned int nSides
Definition: EcalLaserAnalyzer.h:131
EcalLaserAnalyzer::Delta01
TMom * Delta01
Definition: EcalLaserAnalyzer.h:100
EcalLaserAnalyzer::PNoPNA
double PNoPNA[6]
Definition: EcalLaserAnalyzer.h:210
EcalLaserAnalyzer::event
int event
Definition: EcalLaserAnalyzer.h:176
EcalLaserAnalyzer::apdTime
double apdTime
Definition: EcalLaserAnalyzer.h:186
EcalLaserAnalyzer::channelMapEE
std::map< unsigned int, unsigned int > channelMapEE
Definition: EcalLaserAnalyzer.h:169
EcalLaserAnalyzer::APDFirstAnal
TAPD * APDFirstAnal[1700][nColor]
Definition: EcalLaserAnalyzer.h:200
EcalLaserAnalyzer::dccID
int dccID
Definition: EcalLaserAnalyzer.h:143
EcalLaserAnalyzer::nEvtBadGain
int nEvtBadGain[1700]
Definition: EcalLaserAnalyzer.h:224
NREFCHAN
#define NREFCHAN
Definition: EcalLaserAnalyzer.h:45
EcalLaserAnalyzer::RefAPDtrees
TTree * RefAPDtrees[2][22]
Definition: EcalLaserAnalyzer.h:162
EcalLaserAnalyzer::laserEvents
int laserEvents
Definition: EcalLaserAnalyzer.h:149
EcalLaserAnalyzer::phi
int phi
Definition: EcalLaserAnalyzer.h:175
EcalLaserAnalyzer::iZ
int iZ
Definition: EcalLaserAnalyzer.h:146
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalLaserAnalyzer::apdAmpl
double apdAmpl
Definition: EcalLaserAnalyzer.h:183
NPNPERMOD
#define NPNPERMOD
Definition: EcalLaserAnalyzer.h:38
EcalLaserAnalyzer::colors
std::vector< int > colors
Definition: EcalLaserAnalyzer.h:168
EcalLaserAnalyzer::flag
int flag
Definition: EcalLaserAnalyzer.h:207
edm::ParameterSet
Definition: ParameterSet.h:47
TMom
Definition: TMom.h:7
EcalLaserAnalyzer::eventHeaderProducer_
std::string eventHeaderProducer_
Definition: EcalLaserAnalyzer.h:111
EcalLaserAnalyzer::iRed
Definition: EcalLaserAnalyzer.h:60
EcalLaserAnalyzer::iModule
unsigned int iModule[1700]
Definition: EcalLaserAnalyzer.h:217
EcalLaserAnalyzer::APDoPNA
double APDoPNA[6]
Definition: EcalLaserAnalyzer.h:210
EcalLaserAnalyzer::iEta
int iEta[1700]
Definition: EcalLaserAnalyzer.h:216
EcalLaserAnalyzer::nPNPerMod
unsigned int nPNPerMod
Definition: EcalLaserAnalyzer.h:127
EcalLaserAnalyzer::firstChanMod
unsigned int firstChanMod[22]
Definition: EcalLaserAnalyzer.h:219
EcalLaserAnalyzer::alphainitfile
std::string alphainitfile
Definition: EcalLaserAnalyzer.h:116
EcalLaserAnalyzer::APDPulse
TAPDPulse * APDPulse
Definition: EcalLaserAnalyzer.h:97
EcalLaserAnalyzer::analyze
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: EcalLaserAnalyzer.cc:315
EcalLaserAnalyzer::shapana
TShapeAnalysis * shapana
Definition: EcalLaserAnalyzer.h:121
EcalLaserAnalyzer::PN
double PN[6]
Definition: EcalLaserAnalyzer.h:210
EcalLaserAnalyzer::channelIteratorEE
int channelIteratorEE
Definition: EcalLaserAnalyzer.h:208
EcalLaserAnalyzer::Mem
TMem * Mem
Definition: EcalLaserAnalyzer.h:99
EcalLaserAnalyzer::isGainOK
bool isGainOK
Definition: EcalLaserAnalyzer.h:232
EcalLaserAnalyzer::PNoPN
double PNoPN[6]
Definition: EcalLaserAnalyzer.h:210
EcalLaserAnalyzer::_timingqualhigh
unsigned int _timingqualhigh
Definition: EcalLaserAnalyzer.h:78
EcalLaserAnalyzer::fedID
int fedID
Definition: EcalLaserAnalyzer.h:142
EcalLaserAnalyzer::iBlue
Definition: EcalLaserAnalyzer.h:60
EcalLaserAnalyzer::restrees
TTree * restrees[nColor]
Definition: EcalLaserAnalyzer.h:165
EcalLaserAnalyzer::PNPulse
TPNPulse * PNPulse
Definition: EcalLaserAnalyzer.h:98
TMem
Definition: TMem.h:7
EcalLaserAnalyzer::_ecalPart
std::string _ecalPart
Definition: EcalLaserAnalyzer.h:90
EcalLaserAnalyzer::ADCFile
TFile * ADCFile
Definition: EcalLaserAnalyzer.h:157
EcalLaserAnalyzer::APDtrees
TTree * APDtrees[1700]
Definition: EcalLaserAnalyzer.h:161
edm::EventSetup
Definition: EventSetup.h:57
EcalLaserAnalyzer::iTowerID
int iTowerID[1700]
Definition: EcalLaserAnalyzer.h:218
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
TShapeAnalysis
Definition: TShapeAnalysis.h:10
EcalLaserAnalyzer::flagAB
int flagAB
Definition: EcalLaserAnalyzer.h:207
TAPD
Definition: TAPD.h:8
EcalLaserAnalyzer::apdAmplA
double apdAmplA
Definition: EcalLaserAnalyzer.h:184
EcalLaserAnalyzer::_firstsample
unsigned int _firstsample
Definition: EcalLaserAnalyzer.h:69
EcalLaserAnalyzer::adc
double adc[10]
Definition: EcalLaserAnalyzer.h:178
EcalLaserAnalyzer::ADCtrees
TTree * ADCtrees[1700]
Definition: EcalLaserAnalyzer.h:158
EcalLaserAnalyzer
Definition: EcalLaserAnalyzer.h:47
EcalLaserAnalyzer::eventHeaderCollection_
std::string eventHeaderCollection_
Definition: EcalLaserAnalyzer.h:110
EcalLaserAnalyzer::wasABCalcOK
bool wasABCalcOK[1700]
Definition: EcalLaserAnalyzer.h:230
EcalLaserAnalyzer::_fitab
bool _fitab
Definition: EcalLaserAnalyzer.h:84
NMODEE
#define NMODEE
Definition: EcalLaserAnalyzer.h:42
EcalLaserAnalyzer::APDoAPDB
double APDoAPDB[6]
Definition: EcalLaserAnalyzer.h:210
TPNCor
Definition: TPNCor.h:7
EcalLaserAnalyzer::setGeomEB
void setGeomEB(int etaG, int phiG, int module, int tower, int strip, int xtal, int apdRefTT, int channel, int lmr)
Definition: EcalLaserAnalyzer.cc:1357
EcalLaserAnalyzer::color
int color
Definition: EcalLaserAnalyzer.h:177
EcalLaserAnalyzer::_beta
double _beta
Definition: EcalLaserAnalyzer.h:86
EcalLaserAnalyzer::APDoAPDA
double APDoAPDA[6]
Definition: EcalLaserAnalyzer.h:210
EcalLaserAnalyzer::_debug
int _debug
Definition: EcalLaserAnalyzer.h:95
EcalLaserAnalyzer::ADCfile
std::string ADCfile
Definition: EcalLaserAnalyzer.h:117
EcalLaserAnalyzer::isTimingOK
bool isTimingOK
Definition: EcalLaserAnalyzer.h:233
EcalLaserAnalyzer::pn1
double pn1
Definition: EcalLaserAnalyzer.h:180
EcalLaserAnalyzer::setGeomEE
void setGeomEE(int etaG, int phiG, int iX, int iY, int iZ, int module, int tower, int ch, int apdRefTT, int channel, int lmr)
Definition: EcalLaserAnalyzer.cc:1390
EcalLaserAnalyzer::towerID
int towerID
Definition: EcalLaserAnalyzer.h:140
EcalLaserAnalyzer::IsThereDataADC
int IsThereDataADC[1700][nColor]
Definition: EcalLaserAnalyzer.h:203
EcalLaserAnalyzer::adcG
int adcG[10]
Definition: EcalLaserAnalyzer.h:179
EcalLaserAnalyzer::APDoPN
double APDoPN[6]
Definition: EcalLaserAnalyzer.h:210
EcalLaserAnalyzer::iside
int iside[1700]
Definition: EcalLaserAnalyzer.h:218
EcalLaserAnalyzer::pncorfile_
std::string pncorfile_
Definition: EcalLaserAnalyzer.h:106
EcalLaserAnalyzer::PNoPNB
double PNoPNB[6]
Definition: EcalLaserAnalyzer.h:210
EcalLaserAnalyzer::nEvtTot
int nEvtTot[1700]
Definition: EcalLaserAnalyzer.h:226
EcalLaserAnalyzer::APDfile
std::string APDfile
Definition: EcalLaserAnalyzer.h:118
EcalLaserAnalyzer::doesABTreeExist
bool doesABTreeExist
Definition: EcalLaserAnalyzer.h:103
EcalLaserAnalyzer::nColor
Definition: EcalLaserAnalyzer.h:60
EcalLaserAnalyzer::nevtAB
unsigned int nevtAB[1700]
Definition: EcalLaserAnalyzer.h:122
EcalLaserAnalyzer::runType
int runType
Definition: EcalLaserAnalyzer.h:135
EcalLaserAnalyzer::_saveallevents
bool _saveallevents
Definition: EcalLaserAnalyzer.h:93
EcalLaserAnalyzer::pnCorrector
TPNCor * pnCorrector
Definition: EcalLaserAnalyzer.h:153
EcalLaserAnalyzer::pnNoPed
double * pnNoPed
Definition: EcalLaserAnalyzer.h:193
edm::Event
Definition: Event.h:73
EcalLaserAnalyzer::resFile
TFile * resFile
Definition: EcalLaserAnalyzer.h:164
EcalLaserAnalyzer::resdir_
std::string resdir_
Definition: EcalLaserAnalyzer.h:105
EcalLaserAnalyzer::iPhi
int iPhi[1700]
Definition: EcalLaserAnalyzer.h:216
EcalLaserAnalyzer::_lastsample
unsigned int _lastsample
Definition: EcalLaserAnalyzer.h:70
EcalLaserAnalyzer::pnID
int pnID
Definition: EcalLaserAnalyzer.h:207
EcalLaserAnalyzer::nCrys
unsigned int nCrys
Definition: EcalLaserAnalyzer.h:126
EcalLaserAnalyzer::endJob
void endJob() override
Definition: EcalLaserAnalyzer.cc:727
EcalLaserAnalyzer::_firstsamplePN
unsigned int _firstsamplePN
Definition: EcalLaserAnalyzer.h:73
EcalLaserAnalyzer::alphafile
std::string alphafile
Definition: EcalLaserAnalyzer.h:115
EcalLaserAnalyzer::_noise
double _noise
Definition: EcalLaserAnalyzer.h:88
EcalLaserAnalyzer::_chi2cut
double _chi2cut
Definition: EcalLaserAnalyzer.h:89
EcalLaserAnalyzer::colorref
int colorref
Definition: EcalLaserAnalyzer.h:190
EcalLaserAnalyzer::_nsamples
unsigned int _nsamples
Definition: EcalLaserAnalyzer.h:67
EcalLaserAnalyzer::_presamplecut
double _presamplecut
Definition: EcalLaserAnalyzer.h:82
EcalLaserAnalyzer::iChannelID
int iChannelID[1700]
Definition: EcalLaserAnalyzer.h:218
EcalLaserAnalyzer::_alpha
double _alpha
Definition: EcalLaserAnalyzer.h:85
EcalLaserAnalyzer::respntrees
TTree * respntrees[nColor]
Definition: EcalLaserAnalyzer.h:166
EcalLaserAnalyzer::lightside
int lightside
Definition: EcalLaserAnalyzer.h:145
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
EcalLaserAnalyzer::APDAnal
TAPD * APDAnal[1700][nColor]
Definition: EcalLaserAnalyzer.h:201
EcalLaserAnalyzer::moduleID
int moduleID
Definition: EcalLaserAnalyzer.h:207
TPNPulse
Definition: TPNPulse.h:7