Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:27:18

0001 #include "TH1.h"
0002 #include "TFile.h"
0003 #include "TTree.h"
0004 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
0005 #include "TBDataFormats/HcalTBObjects/interface/HcalTBTriggerData.h"
0006 #include "TBDataFormats/HcalTBObjects/interface/HcalTBTiming.h"
0007 #include "TBDataFormats/HcalTBObjects/interface/HcalTBBeamCounters.h"
0008 #include "TBDataFormats/HcalTBObjects/interface/HcalTBEventPosition.h"
0009 #include <map>
0010 #include <vector>
0011 
0012 typedef struct TRIGGGER {
0013   int runNum;
0014   int eventNum;
0015   int beamTrigger;
0016   int fakeTrigger;
0017   int calibTrigger;
0018   int outSpillPedestalTrigger;
0019   int inSpillPedestalTrigger;
0020   int laserTrigger;
0021   int ledTrigger;
0022   int spillTrigger;
0023 } TRIGGER;
0024 
0025 typedef struct TDC {
0026   double trigger;
0027   double ttcL1;
0028   double beamCoincidence[5];
0029   double laserFlash;
0030   double qiePhase;
0031   double TOF1;
0032   double TOF2;
0033   double m1[5];
0034   double m2[5];
0035   double m3[5];
0036   double s1[5];
0037   double s2[5];
0038   double s3[5];
0039   double s4[5];
0040   double bh1[5];
0041   double bh2[5];
0042   double bh3[5];
0043   double bh4[5];
0044 } TDC;
0045 
0046 typedef struct ADC {
0047   double VM;
0048   double V3;
0049   double V6;
0050   double VH1;
0051   double VH2;
0052   double VH3;
0053   double VH4;
0054   double Ecal7x7;
0055   double Sci521;
0056   double Sci528;
0057   double CK1;
0058   double CK2;
0059   double CK3;
0060   double SciVLE;
0061   double S1;
0062   double S2;
0063   double S3;
0064   double S4;
0065   double VMF;
0066   double VMB;
0067   double VM1;
0068   double VM2;
0069   double VM3;
0070   double VM4;
0071   double VM5;
0072   double VM6;
0073   double VM7;
0074   double VM8;
0075   double TOF1;
0076   double TOF2;
0077   double BH1;
0078   double BH2;
0079   double BH3;
0080   double BH4;
0081 } ADC;
0082 
0083 typedef struct CHAMB {
0084   double WCAx[5];
0085   double WCAy[5];
0086   double WCBx[5];
0087   double WCBy[5];
0088   double WCCx[5];
0089   double WCCy[5];
0090   double WCDx[5];
0091   double WCDy[5];
0092   double WCEx[5];
0093   double WCEy[5];
0094   double WCFx[5];
0095   double WCFy[5];
0096   double WCGx[5];
0097   double WCGy[5];
0098   double WCHx[5];
0099   double WCHy[5];
0100 } CHAMB;
0101 
0102 typedef struct ZDCN {
0103   double zdcHADMod1;
0104   double zdcHADMod2;
0105   double zdcHADMod3;
0106   double zdcHADMod4;
0107   double zdcEMMod1;
0108   double zdcEMMod2;
0109   double zdcEMMod3;
0110   double zdcEMMod4;
0111   double zdcEMMod5;
0112   double zdcScint1;
0113   double zdcScint2;
0114   double zdcExtras[7];
0115 } ZDCN;
0116 
0117 typedef struct ZDCP {
0118   double zdcHADMod1;
0119   double zdcHADMod2;
0120   double zdcHADMod3;
0121   double zdcHADMod4;
0122   double zdcEMMod1;
0123   double zdcEMMod2;
0124   double zdcEMMod3;
0125   double zdcEMMod4;
0126   double zdcEMMod5;
0127   double zdcScint1;
0128   double zdcScint2;
0129   double zdcExtras[7];
0130 } ZDCP;
0131 
0132 class ZdcTBAnalysis {
0133 public:
0134   ZdcTBAnalysis();
0135   void setup(const std::string& histoFileName);
0136   void analyze(const ZDCRecHitCollection& hf);
0137   void analyze(const HcalTBTriggerData& trg);
0138   void analyze(const HcalTBBeamCounters& bc);
0139   void analyze(const HcalTBTiming& times);
0140   void analyze(const HcalTBEventPosition& chpos);
0141   void fillTree();
0142   void done();
0143 
0144 private:
0145   int iside;
0146   int isection;
0147   int ichannel;
0148   int idepth;
0149   double energy;
0150   HcalZDCDetId detID;
0151 
0152   int runNumber;
0153   int eventNumber;
0154   bool isBeamTrigger;
0155   bool isFakeTrigger;
0156   bool isCalibTrigger;
0157   bool isOutSpillPedestalTrigger;
0158   bool isInSpillPedestalTrigger;
0159   bool isLaserTrigger;
0160   bool isLedTrigger;
0161   bool isSpillTrigger;
0162 
0163   double trigger_time;
0164   double ttc_L1a_time;
0165   double beam_coincidence[5];
0166   double laser_flash;
0167   double qie_phase;
0168   double TOF1_time;
0169   double TOF2_time;
0170 
0171   double m1hits[5];
0172   double m2hits[5];
0173   double m3hits[5];
0174   double s1hits[5];
0175   double s2hits[5];
0176   double s3hits[5];
0177   double s4hits[5];
0178   double bh1hits[5];
0179   double bh2hits[5];
0180   double bh3hits[5];
0181   double bh4hits[5];
0182 
0183   double VMadc;
0184   double V3adc;
0185   double V6adc;
0186   double VH1adc;
0187   double VH2adc;
0188   double VH3adc;
0189   double VH4adc;
0190   double Ecal7x7adc;
0191   double Sci521adc;
0192   double Sci528adc;
0193 
0194   double CK1adc;
0195   double CK2adc;
0196   double CK3adc;
0197   double SciVLEadc;
0198   double S1adc;
0199   double S2adc;
0200   double S3adc;
0201   double S4adc;
0202 
0203   double VMFadc;
0204   double VMBadc;
0205   double VM1adc;
0206   double VM2adc;
0207   double VM3adc;
0208   double VM4adc;
0209   double VM5adc;
0210   double VM6adc;
0211   double VM7adc;
0212   double VM8adc;
0213   double TOF1adc;
0214   double TOF2adc;
0215   double BH1adc;
0216   double BH2adc;
0217   double BH3adc;
0218   double BH4adc;
0219 
0220   std::vector<double> wcax;
0221   std::vector<double> wcay;
0222   std::vector<double> wcbx;
0223   std::vector<double> wcby;
0224   std::vector<double> wccx;
0225   std::vector<double> wccy;
0226   std::vector<double> wcdx;
0227   std::vector<double> wcdy;
0228   std::vector<double> wcex;
0229   std::vector<double> wcey;
0230   std::vector<double> wcfx;
0231   std::vector<double> wcfy;
0232   std::vector<double> wcgx;
0233   std::vector<double> wcgy;
0234   std::vector<double> wchx;
0235   std::vector<double> wchy;
0236 
0237   TRIGGER trigger;
0238   TDC tdc;
0239   ADC adc;
0240   CHAMB chamb;
0241   ZDCP zdcp;
0242   ZDCN zdcn;
0243 
0244   TFile* outFile;
0245   TTree* ZdcAnalize;
0246 };