Go to the documentation of this file.00001
00002
00003 #include <memory>
00004 #include <FWCore/Framework/interface/EDAnalyzer.h>
00005
00006 class TFile;
00007 class TTree;
00008 class TProfile;
00009 class TPNCor;
00010 class TPN;
00011 class TAPD;
00012 class TMom;
00013 class TAPDPulse;
00014 class TPNPulse;
00015 class TMem;
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #define NCRYSEB 1700 // Number of crystals per EB supermodule
00033 #define NMODEB 9 // Number of EB submodules
00034 #define NPNPERMOD 2 // Number of PN per module
00035
00036
00037 #define NCRYSEE 830 // Number of crystals per EE supermodule
00038 #define NMODEE 21 // Number of EE submodules
00039
00040 #define NSIDES 2 // Number of sides
00041 #define NREFCHAN 2 // Ref number for APDB
00042 #define NSAMPSHAPES 250
00043
00044
00045 class EcalLaserAnalyzer2: public edm::EDAnalyzer{
00046
00047 public:
00048
00049 explicit EcalLaserAnalyzer2(const edm::ParameterSet& iConfig);
00050 ~EcalLaserAnalyzer2();
00051
00052
00053 virtual void analyze( const edm::Event & e, const edm::EventSetup& c);
00054 virtual void beginJob();
00055 virtual void endJob();
00056
00057 void setGeomEB(int etaG, int phiG, int module, int tower, int strip, int xtal,
00058 int apdRefTT, int channel, int lmr);
00059 void setGeomEE(int etaG, int phiG,int iX, int iY, int iZ, int module, int tower,
00060 int ch , int apdRefTT, int channel, int lmr);
00061
00062 enum VarCol { iBlue, iRed, nColor };
00063
00064 private:
00065
00066 int iEvent;
00067
00068
00069
00070
00071 unsigned int _nsamples;
00072 unsigned int _presample;
00073 unsigned int _firstsample;
00074 unsigned int _lastsample;
00075 unsigned int _samplemin;
00076 unsigned int _samplemax;
00077 unsigned int _nsamplesPN;
00078 unsigned int _presamplePN;
00079 unsigned int _firstsamplePN;
00080 unsigned int _lastsamplePN;
00081 unsigned int _timingcutlow;
00082 unsigned int _timingcuthigh;
00083 unsigned int _timingquallow;
00084 unsigned int _timingqualhigh;
00085 double _ratiomincutlow;
00086 double _ratiomincuthigh;
00087 double _ratiomaxcutlow;
00088 double _presamplecut;
00089 unsigned int _niter ;
00090 double _noise;
00091 std::string _ecalPart;
00092 bool _saveshapes;
00093 bool _docorpn;
00094 int _fedid;
00095 bool _saveallevents;
00096 double _qualpercent;
00097 int _debug;
00098
00099 TAPDPulse *APDPulse;
00100 TPNPulse *PNPulse;
00101 TMem *Mem;
00102 TMom *Delta01;
00103 TMom *Delta12;
00104
00105 std::string resdir_;
00106 std::string digiCollection_;
00107 std::string elecfile_;
00108 std::string pncorfile_;
00109 std::string digiPNCollection_;
00110 std::string digiProducer_;
00111 std::string eventHeaderCollection_;
00112 std::string eventHeaderProducer_;
00113
00114
00115
00116
00117 std::string shapefile;
00118 std::string matfile;
00119 std::string ADCfile;
00120 std::string APDfile;
00121 std::string resfile;
00122
00123
00124
00125
00126 unsigned int nCrys;
00127 unsigned int nPNPerMod;
00128 unsigned int nRefChan;
00129 unsigned int nRefTrees;
00130 unsigned int nMod;
00131 unsigned int nSides;
00132
00133 unsigned int nSamplesShapes;
00134
00135 bool IsMatacqOK;
00136
00137
00138
00139 int runType;
00140 int runNum;
00141
00142
00143
00144 int towerID;
00145 int channelID;
00146 int fedID;
00147 int dccID;
00148 int side;
00149 int lightside;
00150 int iZ;
00151
00152
00153 int laserEvents;
00154
00155 std::vector<int> colors;
00156 std::map<int, int> channelMapEE;
00157 std::vector<int> dccMEM;
00158 std::vector<int> modules;
00159 std::map <int, unsigned int> apdRefMap[2];
00160
00161
00162
00163 TPNCor *pnCorrector;
00164
00165
00166
00167 bool getShapes();
00168
00169
00170
00171
00172 TFile *ADCFile;
00173 TTree *ADCtrees[NCRYSEB];
00174
00175 TFile *APDFile;
00176 TTree *APDtrees[NCRYSEB];
00177 TTree *RefAPDtrees[NREFCHAN][NMODEE];
00178
00179 TFile *resFile;
00180 TTree *restrees[nColor];
00181 TTree *respntrees[nColor];
00182
00183 TFile *ShapeFile;
00184 TProfile *PulseShape;
00185
00186
00187
00188
00189 int phi, eta;
00190 int event ;
00191 int color ;
00192 double adc[10];
00193 int adcG[10];
00194 double pn0,pn1;
00195 double pn[50];
00196 int pnG[50];
00197 double apdAmpl;
00198 double apdAmplA;
00199 double apdAmplB;
00200 double apdTime;
00201 double pnAmpl;
00202
00203 int eventref;
00204 int colorref;
00205
00206 double *adcNoPed;
00207 double *pnNoPed;
00208
00209
00210 TPN *PNFirstAnal[NMODEB][NPNPERMOD][nColor];
00211 TPN *PNAnal[NMODEB][NPNPERMOD][nColor];
00212
00213
00214 TAPD *APDFirstAnal[NCRYSEB][nColor];
00215 TAPD *APDAnal[NCRYSEB][nColor];
00216
00217 int IsThereDataADC[NCRYSEB][nColor];
00218
00219
00220
00221 std::vector< double > shapesVec;
00222 double shapes[NSAMPSHAPES];
00223 double shapeCorrection;
00224 bool isMatacqOK;
00225 bool isSPRFine;
00226
00227
00228
00229
00230 int pnID, moduleID, flag;
00231 int channelIteratorEE;
00232
00233 double APD[6], Time[6], PN[6], APDoPN[6], APDoPNA[6], APDoPNB[6],
00234 APDoAPDA[6], APDoAPDB[6], PNoPN[6], PNoPNA[6], PNoPNB[6], ShapeCor;
00235
00236
00237
00238 double adcMean[NCRYSEB][10];
00239 int adcC[NCRYSEB];
00240
00241 int iEta[NCRYSEB],iPhi[NCRYSEB];
00242 unsigned int iModule[NCRYSEB];
00243 int iTowerID[NCRYSEB],iChannelID[NCRYSEB], idccID[NCRYSEB], iside[NCRYSEB];
00244 unsigned int firstChanMod[NMODEE];
00245 unsigned int isFirstChanModFilled[NMODEE];
00246
00247
00248
00249 int nEvtBadGain[NCRYSEB];
00250 int nEvtBadTiming[NCRYSEB];
00251 int nEvtTot[NCRYSEB];
00252
00253 bool wasGainOK[NCRYSEB];
00254 bool wasTimingOK[NCRYSEB];
00255
00256 bool isGainOK;
00257 bool isTimingOK;
00258
00259
00260 };
00261
00262