Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:14:17

0001 #ifndef TreeAnalysisHcalScale_h
0002 #define TreeAnalysisHcalScale_h
0003 
0004 //////////////////////////////////////////////////////////
0005 // This class has been automatically generated and then 
0006 // modified to accept six different files 
0007 //////////////////////////////////////////////////////////
0008 
0009 #include <cstdlib>
0010 #include <iostream>
0011 #include <fstream>
0012 #include <vector>
0013 #include <string>
0014 #include <cmath>
0015 
0016 
0017 #include <TROOT.h>
0018 #include <TChain.h>
0019 #include <TFile.h>
0020 #include "TDirectory.h"
0021 #include "TH1F.h"
0022 #include "TH2.h"
0023 #include "TProfile.h"
0024 #include "TChain.h"
0025 #include "TString.h"
0026 
0027 class TreeAnalysisHcalScale {
0028 
0029 public :
0030   static const int NEtaBins = 51, NPBins = 5, NParticle=6;
0031   double genPartPBins[NPBins+1];
0032   double weights[NParticle];
0033   //  double genPartEtaBins[4];
0034   TFile *fout;
0035 
0036   TH1F  *h_trackP[NParticle], *h_trackEtaAll[NParticle], *h_trackPt[NParticle];
0037   TH1F  *h_trackEta[NParticle], *h_trackPhi[NParticle], *h_IsotrackPhi[NParticle];
0038   TH1F  *h_trackHcalEta[NParticle], *h_IsotrackHcalIEta[NParticle], *h_FracIsotrackHcalIEta[NParticle], *h_trackHcalPhi[NParticle];
0039   TH1F  *h_hCone[NParticle], *h_conehmaxNearP[NParticle];
0040   TH1F  *h_eMipDR[NParticle], *h_eECALDR[NParticle], *h_eHCALDR[NParticle];
0041   TH1F  *h_e11x11_20Sig[NParticle], *h_e15x15_20Sig[NParticle];
0042   
0043   TH1F  *h_eHcalFrac_all[NPBins][NEtaBins];
0044   TH1F  *h_eHcalFrac_trunc_all[NPBins][NEtaBins];
0045   TH1F  *h_Response_all[NPBins][NEtaBins];
0046   TH1F  *h_Response_trunc_all[NPBins][NEtaBins];
0047   TH1F  *h_Response_E11x11_all[NPBins][NEtaBins];
0048   TH1F  *h_Response_E11x11_trunc_all[NPBins][NEtaBins];
0049   
0050   TH1F  *h_eHcalFrac[NParticle+1][NPBins][NEtaBins];
0051   TH1F  *h_Response[NParticle+1][NPBins][NEtaBins];
0052   TH1F  *h_Response_E11x11[NParticle+1][NPBins][NEtaBins];
0053   TH1F  *h_eHcalFrac_trunc[NParticle+1][NPBins][NEtaBins];
0054   TH1F  *h_Response_trunc[NParticle+1][NPBins][NEtaBins];
0055   TH1F  *h_Response_E11x11_trunc[NParticle+1][NPBins][NEtaBins];
0056   TH1F  *h_hneutIso[NParticle+1][NPBins][NEtaBins];
0057   TH1F  *h_eneutIso[NParticle+1][NPBins][NEtaBins];
0058   TH1F  *h_eneutIsoNxN[NParticle+1][NPBins][NEtaBins];
0059 
0060   //================================
0061   TTree          *fChain;   //!pointer to the analyzed TTree or TChain
0062   Int_t           fCurrent; //!current Tree number in a TChain
0063 
0064   // Declaration of leaf types
0065   //   Int_t           t_EvtNo;
0066   Int_t                 t_RunNo;
0067   Int_t                 t_Lumi;
0068   Int_t                 t_Bunch;
0069   std::vector<double>  *t_trackP;
0070   std::vector<double>  *t_trackPt;
0071   std::vector<double>  *t_trackEta;
0072   std::vector<double>  *t_trackPhi;
0073   std::vector<double>  *t_trackHcalEta;
0074   std::vector<double>  *t_trackHcalPhi;
0075   std::vector<double>  *t_hCone;
0076   std::vector<double>  *t_conehmaxNearP;
0077   std::vector<double>  *t_eMipDR;
0078   std::vector<double>  *t_eMipDR_2;
0079   std::vector<double>  *t_eECALDR;
0080   std::vector<double>  *t_eECALDR_2;
0081   std::vector<double>  *t_eHCALDR;
0082   std::vector<double>  *t_e11x11_20Sig;
0083   std::vector<double>  *t_e15x15_20Sig;  
0084   Int_t                 t_nTracks;
0085 
0086   // List of branches
0087   //   TBranch        *b_t_EvtNo;   //!
0088   TBranch        *b_t_RunNo;   //!
0089   TBranch        *b_t_Lumi;   //!
0090   TBranch        *b_t_Bunch;   //!
0091   TBranch        *b_t_trackP;   //!
0092   TBranch        *b_t_trackPt;   //!
0093   TBranch        *b_t_trackEta;   //!
0094   TBranch        *b_t_trackPhi;   //!
0095   TBranch        *b_t_trackHcalEta;   //!
0096   TBranch        *b_t_trackHcalPhi;   //!
0097   TBranch        *b_t_hCone;   //!
0098   TBranch        *b_t_conehmaxNearP;   //!
0099   TBranch        *b_t_eMipDR;   //!
0100   TBranch        *b_t_eMipDR_2;   //!
0101   TBranch        *b_t_eECALDR;   //
0102   TBranch        *b_t_eECALDR_2;   //!
0103   TBranch        *b_t_eHCALDR;   //!
0104   TBranch        *b_t_e11x11_20Sig;   //!
0105   TBranch        *b_t_e15x15_20Sig;   //!
0106   
0107   unsigned int   ipBin, nmaxBin, nIsoTrkTotal;
0108 
0109   TreeAnalysisHcalScale(const char *outFileName, std::vector<std::string>& particles);
0110   virtual ~TreeAnalysisHcalScale();
0111   virtual Int_t    Cut(Long64_t entry);
0112   virtual Int_t    GetEntry(Long64_t entry);
0113   virtual Long64_t LoadTree(Long64_t entry);
0114   virtual void     Init(TChain *tree);
0115   virtual void     Loop(int cut=1 );
0116   virtual Bool_t   Notify();
0117   virtual void     Show(Long64_t entry = -1);
0118   
0119   void             BookHistograms(const char *outFileName, 
0120                   std::vector<std::string>& particles);
0121   void             clear();
0122   void             setParticle(unsigned int ip, unsigned int nmax);
0123   void             AddWeight(std::vector<std::string> particleNames);
0124 };
0125 
0126 #endif