File indexing completed on 2024-04-06 11:57:49
0001 #ifndef CalibCalorimetry_EcalLaserAnalyzer_EcalPerEvtLaserAnalyzer_h
0002 #define CalibCalorimetry_EcalLaserAnalyzer_EcalPerEvtLaserAnalyzer_h
0003
0004
0005 #include <memory>
0006
0007 #include <vector>
0008
0009 #include <FWCore/Framework/interface/one/EDAnalyzer.h>
0010
0011 #include <DataFormats/EcalDigi/interface/EcalDigiCollections.h>
0012 #include <DataFormats/EcalRawData/interface/EcalRawDataCollections.h>
0013 #include <Geometry/EcalMapping/interface/EcalElectronicsMapping.h>
0014 #include <Geometry/EcalMapping/interface/EcalMappingRcd.h>
0015
0016 class TFile;
0017 class TTree;
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 #define NSIDES 2
0032
0033
0034 #define NCRYSEB 1700
0035 #define NTTEB 68
0036 #define NPNEB 10
0037
0038
0039 #define NCRYSEE 825
0040 #define NTTEE 33
0041 #define NPNEE 4
0042
0043 class EcalPerEvtLaserAnalyzer : public edm::one::EDAnalyzer<> {
0044 public:
0045 explicit EcalPerEvtLaserAnalyzer(const edm::ParameterSet &iConfig);
0046 ~EcalPerEvtLaserAnalyzer() override;
0047
0048 void analyze(const edm::Event &e, const edm::EventSetup &c) override;
0049 void beginJob() override;
0050 void endJob() override;
0051
0052 enum VarCol { iBlue, iRed, nColor };
0053
0054 private:
0055 int iEvent;
0056
0057 const std::string eventHeaderCollection_;
0058 const std::string eventHeaderProducer_;
0059 const std::string digiCollection_;
0060 const std::string digiProducer_;
0061 const std::string digiPNCollection_;
0062
0063 const edm::EDGetTokenT<EcalRawDataCollection> rawDataToken_;
0064 edm::EDGetTokenT<EBDigiCollection> ebDigiToken_;
0065 edm::EDGetTokenT<EEDigiCollection> eeDigiToken_;
0066 const edm::EDGetTokenT<EcalPnDiodeDigiCollection> pnDiodeDigiToken_;
0067 const edm::ESGetToken<EcalElectronicsMapping, EcalMappingRcd> mappingToken_;
0068
0069
0070
0071 const unsigned int _nsamples;
0072 const unsigned int _presample;
0073 const unsigned int _firstsample;
0074 const unsigned int _lastsample;
0075 const unsigned int _nsamplesPN;
0076 const unsigned int _presamplePN;
0077 const unsigned int _firstsamplePN;
0078 const unsigned int _lastsamplePN;
0079 const unsigned int _timingcutlow;
0080 const unsigned int _timingcuthigh;
0081 const unsigned int _niter;
0082 const int _fedid;
0083 const unsigned int _tower;
0084 const unsigned int _channel;
0085 const std::string _ecalPart;
0086
0087 const std::string resdir_;
0088 const std::string refalphabeta_;
0089
0090
0091
0092 std::string ADCfile;
0093 std::string resfile;
0094
0095
0096
0097
0098 unsigned int nCrys;
0099
0100 int IsFileCreated;
0101
0102
0103
0104 int runType;
0105 int runNum;
0106 int dccID;
0107 int fedID;
0108 int lightside;
0109
0110 int channelNumber;
0111
0112 std::vector<int> colors;
0113
0114
0115 TFile *matacqFile;
0116 TTree *matacqTree;
0117
0118 TFile *ADCFile;
0119 TTree *ADCtrees;
0120
0121 TFile *APDFile;
0122 TTree *header[2];
0123 TTree *APDtrees;
0124
0125 int doesRefFileExist;
0126 int IsThereDataADC[nColor];
0127 int IsHeaderFilled[nColor];
0128
0129 double ttMat, peakMat, peak;
0130 int evtMat, colMat;
0131
0132
0133
0134 int phi, eta;
0135 int event;
0136 int color;
0137 double adc[10];
0138 int adcG[10];
0139 double tt;
0140 double ttrig;
0141 double pn0, pn1;
0142 double pn[50];
0143 double apdAmpl;
0144 double apdTime;
0145 double pnAmpl;
0146 };
0147 #endif