00001 #include "TH1.h" 00002 #include "TFile.h" 00003 #include "TTree.h" 00004 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" 00005 #include "TBDataFormats/HcalTBObjects/interface/HcalTBTriggerData.h" 00006 #include "TBDataFormats/HcalTBObjects/interface/HcalTBTiming.h" 00007 #include "TBDataFormats/HcalTBObjects/interface/HcalTBBeamCounters.h" 00008 #include "TBDataFormats/HcalTBObjects/interface/HcalTBEventPosition.h" 00009 #include <map> 00010 #include <vector> 00011 00012 typedef struct TRIGGGER{ 00013 int runNum; 00014 int eventNum; 00015 int beamTrigger; 00016 int fakeTrigger; 00017 int calibTrigger; 00018 int outSpillPedestalTrigger; 00019 int inSpillPedestalTrigger; 00020 int laserTrigger; 00021 int ledTrigger; 00022 int spillTrigger; 00023 }TRIGGER; 00024 00025 typedef struct TDC{ 00026 double trigger; 00027 double ttcL1; 00028 double beamCoincidence[5]; 00029 double laserFlash; 00030 double qiePhase; 00031 double TOF1; 00032 double TOF2; 00033 double m1[5]; 00034 double m2[5]; 00035 double m3[5]; 00036 double s1[5]; 00037 double s2[5]; 00038 double s3[5]; 00039 double s4[5]; 00040 double bh1[5]; 00041 double bh2[5]; 00042 double bh3[5]; 00043 double bh4[5]; 00044 }TDC; 00045 00046 typedef struct ADC{ 00047 double VM; 00048 double V3; 00049 double V6; 00050 double VH1; 00051 double VH2; 00052 double VH3; 00053 double VH4; 00054 double Ecal7x7; 00055 double Sci521; 00056 double Sci528; 00057 double CK1; 00058 double CK2; 00059 double CK3; 00060 double SciVLE; 00061 double S1; 00062 double S2; 00063 double S3; 00064 double S4; 00065 double VMF; 00066 double VMB; 00067 double VM1; 00068 double VM2; 00069 double VM3; 00070 double VM4; 00071 double VM5; 00072 double VM6; 00073 double VM7; 00074 double VM8; 00075 double TOF1; 00076 double TOF2; 00077 double BH1; 00078 double BH2; 00079 double BH3; 00080 double BH4; 00081 }ADC; 00082 00083 typedef struct CHAMB{ 00084 double WCAx[5]; 00085 double WCAy[5]; 00086 double WCBx[5]; 00087 double WCBy[5]; 00088 double WCCx[5]; 00089 double WCCy[5]; 00090 double WCDx[5]; 00091 double WCDy[5]; 00092 double WCEx[5]; 00093 double WCEy[5]; 00094 double WCFx[5]; 00095 double WCFy[5]; 00096 double WCGx[5]; 00097 double WCGy[5]; 00098 double WCHx[5]; 00099 double WCHy[5]; 00100 }CHAMB; 00101 00102 00103 typedef struct ZDCN{ 00104 double zdcHADMod1; 00105 double zdcHADMod2; 00106 double zdcHADMod3; 00107 double zdcHADMod4; 00108 double zdcEMMod1; 00109 double zdcEMMod2; 00110 double zdcEMMod3; 00111 double zdcEMMod4; 00112 double zdcEMMod5; 00113 double zdcScint1; 00114 double zdcScint2; 00115 double zdcExtras[7]; 00116 }ZDCN; 00117 00118 typedef struct ZDCP{ 00119 double zdcHADMod1; 00120 double zdcHADMod2; 00121 double zdcHADMod3; 00122 double zdcHADMod4; 00123 double zdcEMMod1; 00124 double zdcEMMod2; 00125 double zdcEMMod3; 00126 double zdcEMMod4; 00127 double zdcEMMod5; 00128 double zdcScint1; 00129 double zdcScint2; 00130 double zdcExtras[7]; 00131 }ZDCP; 00132 00133 class ZdcTBAnalysis { 00134 public: 00135 ZdcTBAnalysis(); 00136 void setup(const std::string& histoFileName); 00137 void analyze(const ZDCRecHitCollection& hf); 00138 void analyze(const HcalTBTriggerData& trg); 00139 void analyze(const HcalTBBeamCounters& bc); 00140 void analyze(const HcalTBTiming& times); 00141 void analyze(const HcalTBEventPosition& chpos); 00142 void fillTree(); 00143 void done(); 00144 00145 private: 00146 int iside; 00147 int isection; 00148 int ichannel; 00149 int idepth; 00150 double energy; 00151 HcalZDCDetId detID; 00152 00153 int runNumber; 00154 int eventNumber; 00155 bool isBeamTrigger; 00156 bool isFakeTrigger; 00157 bool isCalibTrigger; 00158 bool isOutSpillPedestalTrigger; 00159 bool isInSpillPedestalTrigger; 00160 bool isLaserTrigger; 00161 bool isLedTrigger; 00162 bool isSpillTrigger; 00163 00164 double trigger_time; 00165 double ttc_L1a_time; 00166 double beam_coincidence[5]; 00167 double laser_flash; 00168 double qie_phase; 00169 double TOF1_time; 00170 double TOF2_time; 00171 00172 double m1hits[5]; 00173 double m2hits[5]; 00174 double m3hits[5]; 00175 double s1hits[5]; 00176 double s2hits[5]; 00177 double s3hits[5]; 00178 double s4hits[5]; 00179 double bh1hits[5]; 00180 double bh2hits[5]; 00181 double bh3hits[5]; 00182 double bh4hits[5]; 00183 00184 double VMadc; 00185 double V3adc; 00186 double V6adc; 00187 double VH1adc; 00188 double VH2adc; 00189 double VH3adc; 00190 double VH4adc; 00191 double Ecal7x7adc; 00192 double Sci521adc; 00193 double Sci528adc; 00194 00195 double CK1adc; 00196 double CK2adc; 00197 double CK3adc; 00198 double SciVLEadc; 00199 double S1adc; 00200 double S2adc; 00201 double S3adc; 00202 double S4adc; 00203 00204 double VMFadc; 00205 double VMBadc; 00206 double VM1adc; 00207 double VM2adc; 00208 double VM3adc; 00209 double VM4adc; 00210 double VM5adc; 00211 double VM6adc; 00212 double VM7adc; 00213 double VM8adc; 00214 double TOF1adc; 00215 double TOF2adc; 00216 double BH1adc; 00217 double BH2adc; 00218 double BH3adc; 00219 double BH4adc; 00220 00221 std::vector<double> wcax; 00222 std::vector<double> wcay; 00223 std::vector<double> wcbx; 00224 std::vector<double> wcby; 00225 std::vector<double> wccx; 00226 std::vector<double> wccy; 00227 std::vector<double> wcdx; 00228 std::vector<double> wcdy; 00229 std::vector<double> wcex; 00230 std::vector<double> wcey; 00231 std::vector<double> wcfx; 00232 std::vector<double> wcfy; 00233 std::vector<double> wcgx; 00234 std::vector<double> wcgy; 00235 std::vector<double> wchx; 00236 std::vector<double> wchy; 00237 00238 TRIGGER trigger; 00239 TDC tdc; 00240 ADC adc; 00241 CHAMB chamb; 00242 ZDCP zdcp; 00243 ZDCN zdcn; 00244 00245 TFile* outFile; 00246 TTree* ZdcAnalize; 00247 00248 };