00001 // $Id: EcalPerEvtLaserAnalyzer.h 00002 00003 #include <memory> 00004 #include <FWCore/Framework/interface/EDAnalyzer.h> 00005 00006 class TTree; 00007 class TFile; 00008 00009 // Define geometrical constants 00010 // NOT the same for "EB" and "EE" 00011 // 00012 // "EB" "EE" 00013 // 00014 // 0 0 00015 // 1 2 1 2 00016 // 3 4 00017 // 5 6 00018 // 7 8 00019 // 00020 // 00021 #define NSIDES 2 // Number of sides (0, 1) 00022 00023 // "EB" geometry 00024 #define NCRYSEB 1700 // Number of crystals per EB supermodule 00025 #define NTTEB 68 // Number of EB Trigger Towers 00026 #define NPNEB 10 // Number of PN per EB supermodule 00027 00028 // "EE" geometry 00029 #define NCRYSEE 825 // Number of crystals per EE supermodule 00030 #define NTTEE 33 // Number of EE Trigger Towers 00031 #define NPNEE 4 // Number of PN per EE supermodule 00032 00033 00034 00035 class EcalPerEvtLaserAnalyzer: public edm::EDAnalyzer{ 00036 00037 public: 00038 00039 explicit EcalPerEvtLaserAnalyzer(const edm::ParameterSet& iConfig); 00040 ~EcalPerEvtLaserAnalyzer(); 00041 00042 00043 virtual void analyze( const edm::Event & e, const edm::EventSetup& c); 00044 virtual void beginJob(); 00045 virtual void endJob(); 00046 00047 enum VarCol { iBlue, iRed, nColor }; 00048 00049 private: 00050 00051 int iEvent; 00052 00053 00054 // Framework parameters 00055 00056 unsigned int _nsamples; 00057 unsigned int _presample; 00058 unsigned int _firstsample; 00059 unsigned int _lastsample; 00060 unsigned int _samplemin; 00061 unsigned int _samplemax; 00062 unsigned int _nsamplesPN; 00063 unsigned int _presamplePN; 00064 unsigned int _firstsamplePN; 00065 unsigned int _lastsamplePN; 00066 unsigned int _timingcutlow; 00067 unsigned int _timingcuthigh; 00068 unsigned int _niter ; 00069 int _fedid ; 00070 unsigned int _tower ; 00071 unsigned int _channel ; 00072 std::string _ecalPart; 00073 00074 std::string resdir_; 00075 std::string refalphabeta_; 00076 std::string digiCollection_; 00077 std::string digiPNCollection_; 00078 std::string digiProducer_; 00079 std::string eventHeaderCollection_; 00080 std::string eventHeaderProducer_; 00081 00082 00083 // Output file names 00084 00085 std::string alphafile; 00086 std::string ADCfile; 00087 std::string APDfile; 00088 std::string resfile; 00089 00090 00091 // Define geometrical constants 00092 // Default values correspond to "EB" geometry (1700 crystals) 00093 00094 unsigned int nCrys; 00095 unsigned int nTT; 00096 unsigned int nSides; 00097 00098 00099 int IsFileCreated; 00100 00101 // Define number of channels (68 or 1700) for alpha and beta calculation 00102 00103 unsigned int nCh; 00104 00105 // Identify run type 00106 00107 int runType; 00108 int runNum; 00109 int dccID; 00110 int fedID; 00111 int lightside; 00112 00113 int channelNumber; 00114 00115 00116 std::vector<int> colors; 00117 00118 // Temporary root files and trees 00119 TFile *matacqFile; 00120 TTree *matacqTree; 00121 00122 TFile *ADCFile; 00123 TTree *ADCtrees; 00124 00125 TFile *APDFile; 00126 TTree *header[2]; 00127 TTree *APDtrees; 00128 00129 00130 int doesRefFileExist; 00131 int IsThereDataADC[nColor]; 00132 int IsHeaderFilled[nColor]; 00133 00134 double ttMat, peakMat, peak; 00135 int evtMat, colMat; 00136 00137 // Declaration of leaves types for temporary trees 00138 00139 int phi, eta; 00140 int event ; 00141 int color ; 00142 double adc[10]; 00143 int adcG[10]; 00144 double tt; 00145 double ttrig; 00146 double pn0,pn1; 00147 double pn[50]; 00148 double apdAmpl; 00149 double apdTime; 00150 double pnAmpl; 00151 00152 00153 00154 00155 00156 }; 00157 00158