Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-11 04:33:29

0001 // Producer for validation histograms for Calo and PF background subtracted
0002 // objects Modified by Raghav Kunnawalkam Elayavalli, Aug 18th 2014
0003 //                                          , Oct 22nd 2014 to run in 73X
0004 
0005 #include "JetTester_HeavyIons.h"
0006 
0007 using namespace edm;
0008 using namespace reco;
0009 using namespace std;
0010 
0011 JetTester_HeavyIons::JetTester_HeavyIons(const edm::ParameterSet &iConfig)
0012     : mInputCollection(iConfig.getParameter<edm::InputTag>("src")),
0013       mInputGenCollection(iConfig.getParameter<edm::InputTag>("srcGen")),
0014       mInputPFCandCollection(iConfig.getParameter<edm::InputTag>("PFcands")),
0015       // mInputCandCollection           (iConfig.getParameter<edm::InputTag>
0016       // ("Cands")), rhoTag (iConfig.getParameter<edm::InputTag> ("srcRho")),
0017       mOutputFile(iConfig.getUntrackedParameter<std::string>("OutputFile", "")),
0018       JetType(iConfig.getUntrackedParameter<std::string>("JetType")),
0019       UEAlgo(iConfig.getUntrackedParameter<std::string>("UEAlgo")),
0020       Background(iConfig.getParameter<edm::InputTag>("Background")),
0021       mRecoJetPtThreshold(iConfig.getParameter<double>("recoJetPtThreshold")),
0022       mMatchGenPtThreshold(iConfig.getParameter<double>("matchGenPtThreshold")),
0023       mGenEnergyFractionThreshold(iConfig.getParameter<double>("genEnergyFractionThreshold")),
0024       mReverseEnergyFractionThreshold(iConfig.getParameter<double>("reverseEnergyFractionThreshold")),
0025       mRThreshold(iConfig.getParameter<double>("RThreshold")),
0026       JetCorrectionService(iConfig.getParameter<std::string>("JetCorrections")) {
0027   std::string inputCollectionLabel(mInputCollection.label());
0028 
0029   isCaloJet = (std::string("calo") == JetType);
0030   isJPTJet = (std::string("jpt") == JetType);
0031   isPFJet = (std::string("pf") == JetType);
0032 
0033   // consumes
0034   pvToken_ = consumes<std::vector<reco::Vertex>>(edm::InputTag("offlinePrimaryVertices"));
0035   caloTowersToken_ = consumes<CaloTowerCollection>(edm::InputTag("towerMaker"));
0036   if (isCaloJet)
0037     caloJetsToken_ = consumes<reco::CaloJetCollection>(mInputCollection);
0038   if (isJPTJet)
0039     jptJetsToken_ = consumes<reco::JPTJetCollection>(mInputCollection);
0040   if (isPFJet) {
0041     if (std::string("Pu") == UEAlgo)
0042       basicJetsToken_ = consumes<reco::BasicJetCollection>(mInputCollection);
0043   }
0044 
0045   genJetsToken_ = consumes<reco::GenJetCollection>(edm::InputTag(mInputGenCollection));
0046   evtToken_ = consumes<GenEventInfoProduct>(edm::InputTag("generator"));
0047   pfCandToken_ = consumes<reco::PFCandidateCollection>(mInputPFCandCollection);
0048   pfCandViewToken_ = consumes<reco::CandidateView>(mInputPFCandCollection);
0049   caloCandViewToken_ = consumes<reco::CandidateView>(edm::InputTag("towerMaker"));
0050   backgrounds_ = consumes<edm::ValueMap<reco::VoronoiBackground>>(Background);
0051   backgrounds_value_ = consumes<std::vector<float>>(Background);
0052   centralityTag_ = iConfig.getParameter<InputTag>("centralitycollection");
0053   centralityToken = consumes<reco::Centrality>(centralityTag_);
0054 
0055   centralityBinTag_ = (iConfig.getParameter<edm::InputTag>("centralitybincollection"));
0056   centralityBinToken = consumes<int>(centralityBinTag_);
0057   hiVertexToken_ = consumes<std::vector<reco::Vertex>>(edm::InputTag("hiSelectedVertex"));
0058 
0059   // need to initialize the PF cand histograms : which are also event variables
0060   if (isPFJet) {
0061     mNPFpart = nullptr;
0062     mPFPt = nullptr;
0063     mPFEta = nullptr;
0064     mPFPhi = nullptr;
0065     mPFArea = nullptr;
0066     mSumPFPt = nullptr;
0067     mSumSquaredPFPt = nullptr;
0068     mSumPFPt_HF = nullptr;
0069 
0070     mSumPFPt_n5p191_n2p650 = nullptr;
0071     mSumPFPt_n2p650_n2p043 = nullptr;
0072     mSumPFPt_n2p043_n1p740 = nullptr;
0073     mSumPFPt_n1p740_n1p479 = nullptr;
0074     mSumPFPt_n1p479_n1p131 = nullptr;
0075     mSumPFPt_n1p131_n0p783 = nullptr;
0076     mSumPFPt_n0p783_n0p522 = nullptr;
0077     mSumPFPt_n0p522_0p522 = nullptr;
0078     mSumPFPt_0p522_0p783 = nullptr;
0079     mSumPFPt_0p783_1p131 = nullptr;
0080     mSumPFPt_1p131_1p479 = nullptr;
0081     mSumPFPt_1p479_1p740 = nullptr;
0082     mSumPFPt_1p740_2p043 = nullptr;
0083     mSumPFPt_2p043_2p650 = nullptr;
0084     mSumPFPt_2p650_5p191 = nullptr;
0085 
0086     mPFCandpT_vs_eta_Unknown = nullptr;        // pf id 0
0087     mPFCandpT_vs_eta_ChargedHadron = nullptr;  // pf id - 1
0088     mPFCandpT_vs_eta_electron = nullptr;       // pf id - 2
0089     mPFCandpT_vs_eta_muon = nullptr;           // pf id - 3
0090     mPFCandpT_vs_eta_photon = nullptr;         // pf id - 4
0091     mPFCandpT_vs_eta_NeutralHadron = nullptr;  // pf id - 5
0092     mPFCandpT_vs_eta_HadE_inHF = nullptr;      // pf id - 6
0093     mPFCandpT_vs_eta_EME_inHF = nullptr;       // pf id - 7
0094 
0095     mPFCandpT_Barrel_Unknown = nullptr;        // pf id 0
0096     mPFCandpT_Barrel_ChargedHadron = nullptr;  // pf id - 1
0097     mPFCandpT_Barrel_electron = nullptr;       // pf id - 2
0098     mPFCandpT_Barrel_muon = nullptr;           // pf id - 3
0099     mPFCandpT_Barrel_photon = nullptr;         // pf id - 4
0100     mPFCandpT_Barrel_NeutralHadron = nullptr;  // pf id - 5
0101     mPFCandpT_Barrel_HadE_inHF = nullptr;      // pf id - 6
0102     mPFCandpT_Barrel_EME_inHF = nullptr;       // pf id - 7
0103 
0104     mPFCandpT_Endcap_Unknown = nullptr;        // pf id 0
0105     mPFCandpT_Endcap_ChargedHadron = nullptr;  // pf id - 1
0106     mPFCandpT_Endcap_electron = nullptr;       // pf id - 2
0107     mPFCandpT_Endcap_muon = nullptr;           // pf id - 3
0108     mPFCandpT_Endcap_photon = nullptr;         // pf id - 4
0109     mPFCandpT_Endcap_NeutralHadron = nullptr;  // pf id - 5
0110     mPFCandpT_Endcap_HadE_inHF = nullptr;      // pf id - 6
0111     mPFCandpT_Endcap_EME_inHF = nullptr;       // pf id - 7
0112 
0113     mPFCandpT_Forward_Unknown = nullptr;        // pf id 0
0114     mPFCandpT_Forward_ChargedHadron = nullptr;  // pf id - 1
0115     mPFCandpT_Forward_electron = nullptr;       // pf id - 2
0116     mPFCandpT_Forward_muon = nullptr;           // pf id - 3
0117     mPFCandpT_Forward_photon = nullptr;         // pf id - 4
0118     mPFCandpT_Forward_NeutralHadron = nullptr;  // pf id - 5
0119     mPFCandpT_Forward_HadE_inHF = nullptr;      // pf id - 6
0120     mPFCandpT_Forward_EME_inHF = nullptr;       // pf id - 7
0121   }
0122   if (isCaloJet) {
0123     mNCalopart = nullptr;
0124     mCaloPt = nullptr;
0125     mCaloEta = nullptr;
0126     mCaloPhi = nullptr;
0127     mCaloArea = nullptr;
0128 
0129     mSumCaloPt = nullptr;
0130     mSumSquaredCaloPt = nullptr;
0131     mSumCaloPt_HF = nullptr;
0132 
0133     mSumCaloPt_n5p191_n2p650 = nullptr;
0134     mSumCaloPt_n2p650_n2p043 = nullptr;
0135     mSumCaloPt_n2p043_n1p740 = nullptr;
0136     mSumCaloPt_n1p740_n1p479 = nullptr;
0137     mSumCaloPt_n1p479_n1p131 = nullptr;
0138     mSumCaloPt_n1p131_n0p783 = nullptr;
0139     mSumCaloPt_n0p783_n0p522 = nullptr;
0140     mSumCaloPt_n0p522_0p522 = nullptr;
0141     mSumCaloPt_0p522_0p783 = nullptr;
0142     mSumCaloPt_0p783_1p131 = nullptr;
0143     mSumCaloPt_1p131_1p479 = nullptr;
0144     mSumCaloPt_1p479_1p740 = nullptr;
0145     mSumCaloPt_1p740_2p043 = nullptr;
0146     mSumCaloPt_2p043_2p650 = nullptr;
0147     mSumCaloPt_2p650_5p191 = nullptr;
0148   }
0149   mSumpt = nullptr;
0150 
0151   // Events variables
0152   mNvtx = nullptr;
0153   mHF = nullptr;
0154 
0155   // Jet parameters
0156   mEta = nullptr;
0157   mPhi = nullptr;
0158   mEnergy = nullptr;
0159   mP = nullptr;
0160   mPt = nullptr;
0161   mMass = nullptr;
0162   mConstituents = nullptr;
0163   mJetArea = nullptr;
0164   mjetpileup = nullptr;
0165   mNJets_40 = nullptr;
0166   mNJets = nullptr;
0167 
0168   mGenEta = nullptr;
0169   mGenPhi = nullptr;
0170   mGenPt = nullptr;
0171   mPtHat = nullptr;
0172 
0173   mPtRecoOverGen_B_20_30_Cent_0_10 = nullptr;
0174   mPtRecoOverGen_E_20_30_Cent_0_10 = nullptr;
0175   mPtRecoOverGen_F_20_30_Cent_0_10 = nullptr;
0176   mPtRecoOverGen_B_30_50_Cent_0_10 = nullptr;
0177   mPtRecoOverGen_E_30_50_Cent_0_10 = nullptr;
0178   mPtRecoOverGen_F_30_50_Cent_0_10 = nullptr;
0179   mPtRecoOverGen_B_50_80_Cent_0_10 = nullptr;
0180   mPtRecoOverGen_E_50_80_Cent_0_10 = nullptr;
0181   mPtRecoOverGen_F_50_80_Cent_0_10 = nullptr;
0182   mPtRecoOverGen_B_80_120_Cent_0_10 = nullptr;
0183   mPtRecoOverGen_E_80_120_Cent_0_10 = nullptr;
0184   mPtRecoOverGen_F_80_120_Cent_0_10 = nullptr;
0185   mPtRecoOverGen_B_120_180_Cent_0_10 = nullptr;
0186   mPtRecoOverGen_E_120_180_Cent_0_10 = nullptr;
0187   mPtRecoOverGen_F_120_180_Cent_0_10 = nullptr;
0188   mPtRecoOverGen_B_180_300_Cent_0_10 = nullptr;
0189   mPtRecoOverGen_E_180_300_Cent_0_10 = nullptr;
0190   mPtRecoOverGen_F_180_300_Cent_0_10 = nullptr;
0191   mPtRecoOverGen_B_300_Inf_Cent_0_10 = nullptr;
0192   mPtRecoOverGen_E_300_Inf_Cent_0_10 = nullptr;
0193   mPtRecoOverGen_F_300_Inf_Cent_0_10 = nullptr;
0194 
0195   mPtRecoOverGen_B_20_30_Cent_10_30 = nullptr;
0196   mPtRecoOverGen_E_20_30_Cent_10_30 = nullptr;
0197   mPtRecoOverGen_F_20_30_Cent_10_30 = nullptr;
0198   mPtRecoOverGen_B_30_50_Cent_10_30 = nullptr;
0199   mPtRecoOverGen_E_30_50_Cent_10_30 = nullptr;
0200   mPtRecoOverGen_F_30_50_Cent_10_30 = nullptr;
0201   mPtRecoOverGen_B_50_80_Cent_10_30 = nullptr;
0202   mPtRecoOverGen_E_50_80_Cent_10_30 = nullptr;
0203   mPtRecoOverGen_F_50_80_Cent_10_30 = nullptr;
0204   mPtRecoOverGen_B_80_120_Cent_10_30 = nullptr;
0205   mPtRecoOverGen_E_80_120_Cent_10_30 = nullptr;
0206   mPtRecoOverGen_F_80_120_Cent_10_30 = nullptr;
0207   mPtRecoOverGen_B_120_180_Cent_10_30 = nullptr;
0208   mPtRecoOverGen_E_120_180_Cent_10_30 = nullptr;
0209   mPtRecoOverGen_F_120_180_Cent_10_30 = nullptr;
0210   mPtRecoOverGen_B_180_300_Cent_10_30 = nullptr;
0211   mPtRecoOverGen_E_180_300_Cent_10_30 = nullptr;
0212   mPtRecoOverGen_F_180_300_Cent_10_30 = nullptr;
0213   mPtRecoOverGen_B_300_Inf_Cent_10_30 = nullptr;
0214   mPtRecoOverGen_E_300_Inf_Cent_10_30 = nullptr;
0215   mPtRecoOverGen_F_300_Inf_Cent_10_30 = nullptr;
0216 
0217   mPtRecoOverGen_B_20_30_Cent_30_50 = nullptr;
0218   mPtRecoOverGen_E_20_30_Cent_30_50 = nullptr;
0219   mPtRecoOverGen_F_20_30_Cent_30_50 = nullptr;
0220   mPtRecoOverGen_B_30_50_Cent_30_50 = nullptr;
0221   mPtRecoOverGen_E_30_50_Cent_30_50 = nullptr;
0222   mPtRecoOverGen_F_30_50_Cent_30_50 = nullptr;
0223   mPtRecoOverGen_B_50_80_Cent_30_50 = nullptr;
0224   mPtRecoOverGen_E_50_80_Cent_30_50 = nullptr;
0225   mPtRecoOverGen_F_50_80_Cent_30_50 = nullptr;
0226   mPtRecoOverGen_B_80_120_Cent_30_50 = nullptr;
0227   mPtRecoOverGen_E_80_120_Cent_30_50 = nullptr;
0228   mPtRecoOverGen_F_80_120_Cent_30_50 = nullptr;
0229   mPtRecoOverGen_B_120_180_Cent_30_50 = nullptr;
0230   mPtRecoOverGen_E_120_180_Cent_30_50 = nullptr;
0231   mPtRecoOverGen_F_120_180_Cent_30_50 = nullptr;
0232   mPtRecoOverGen_B_180_300_Cent_30_50 = nullptr;
0233   mPtRecoOverGen_E_180_300_Cent_30_50 = nullptr;
0234   mPtRecoOverGen_F_180_300_Cent_30_50 = nullptr;
0235   mPtRecoOverGen_B_300_Inf_Cent_30_50 = nullptr;
0236   mPtRecoOverGen_E_300_Inf_Cent_30_50 = nullptr;
0237   mPtRecoOverGen_F_300_Inf_Cent_30_50 = nullptr;
0238 
0239   mPtRecoOverGen_B_20_30_Cent_50_80 = nullptr;
0240   mPtRecoOverGen_E_20_30_Cent_50_80 = nullptr;
0241   mPtRecoOverGen_F_20_30_Cent_50_80 = nullptr;
0242   mPtRecoOverGen_B_30_50_Cent_50_80 = nullptr;
0243   mPtRecoOverGen_E_30_50_Cent_50_80 = nullptr;
0244   mPtRecoOverGen_F_30_50_Cent_50_80 = nullptr;
0245   mPtRecoOverGen_B_50_80_Cent_50_80 = nullptr;
0246   mPtRecoOverGen_E_50_80_Cent_50_80 = nullptr;
0247   mPtRecoOverGen_F_50_80_Cent_50_80 = nullptr;
0248   mPtRecoOverGen_B_80_120_Cent_50_80 = nullptr;
0249   mPtRecoOverGen_E_80_120_Cent_50_80 = nullptr;
0250   mPtRecoOverGen_F_80_120_Cent_50_80 = nullptr;
0251   mPtRecoOverGen_B_120_180_Cent_50_80 = nullptr;
0252   mPtRecoOverGen_E_120_180_Cent_50_80 = nullptr;
0253   mPtRecoOverGen_F_120_180_Cent_50_80 = nullptr;
0254   mPtRecoOverGen_B_180_300_Cent_50_80 = nullptr;
0255   mPtRecoOverGen_E_180_300_Cent_50_80 = nullptr;
0256   mPtRecoOverGen_F_180_300_Cent_50_80 = nullptr;
0257   mPtRecoOverGen_B_300_Inf_Cent_50_80 = nullptr;
0258   mPtRecoOverGen_E_300_Inf_Cent_50_80 = nullptr;
0259   mPtRecoOverGen_F_300_Inf_Cent_50_80 = nullptr;
0260 
0261   mPtRecoOverGen_GenPt_B_Cent_0_10 = nullptr;
0262   mPtRecoOverGen_GenPt_E_Cent_0_10 = nullptr;
0263   mPtRecoOverGen_GenPt_F_Cent_0_10 = nullptr;
0264   mPtRecoOverGen_GenPt_B_Cent_10_30 = nullptr;
0265   mPtRecoOverGen_GenPt_E_Cent_10_30 = nullptr;
0266   mPtRecoOverGen_GenPt_F_Cent_10_30 = nullptr;
0267   mPtRecoOverGen_GenPt_B_Cent_30_50 = nullptr;
0268   mPtRecoOverGen_GenPt_E_Cent_30_50 = nullptr;
0269   mPtRecoOverGen_GenPt_F_Cent_30_50 = nullptr;
0270   mPtRecoOverGen_GenPt_B_Cent_50_80 = nullptr;
0271   mPtRecoOverGen_GenPt_E_Cent_50_80 = nullptr;
0272   mPtRecoOverGen_GenPt_F_Cent_50_80 = nullptr;
0273 
0274   mPtRecoOverGen_GenEta_20_30_Cent_0_10 = nullptr;
0275   mPtRecoOverGen_GenEta_30_50_Cent_0_10 = nullptr;
0276   mPtRecoOverGen_GenEta_50_80_Cent_0_10 = nullptr;
0277   mPtRecoOverGen_GenEta_80_120_Cent_0_10 = nullptr;
0278   mPtRecoOverGen_GenEta_120_180_Cent_0_10 = nullptr;
0279   mPtRecoOverGen_GenEta_180_300_Cent_0_10 = nullptr;
0280   mPtRecoOverGen_GenEta_300_Inf_Cent_0_10 = nullptr;
0281 
0282   mPtRecoOverGen_GenEta_20_30_Cent_10_30 = nullptr;
0283   mPtRecoOverGen_GenEta_30_50_Cent_10_30 = nullptr;
0284   mPtRecoOverGen_GenEta_50_80_Cent_10_30 = nullptr;
0285   mPtRecoOverGen_GenEta_80_120_Cent_10_30 = nullptr;
0286   mPtRecoOverGen_GenEta_120_180_Cent_10_30 = nullptr;
0287   mPtRecoOverGen_GenEta_180_300_Cent_10_30 = nullptr;
0288   mPtRecoOverGen_GenEta_300_Inf_Cent_10_30 = nullptr;
0289 
0290   mPtRecoOverGen_GenEta_20_30_Cent_30_50 = nullptr;
0291   mPtRecoOverGen_GenEta_30_50_Cent_30_50 = nullptr;
0292   mPtRecoOverGen_GenEta_50_80_Cent_30_50 = nullptr;
0293   mPtRecoOverGen_GenEta_80_120_Cent_30_50 = nullptr;
0294   mPtRecoOverGen_GenEta_120_180_Cent_30_50 = nullptr;
0295   mPtRecoOverGen_GenEta_180_300_Cent_30_50 = nullptr;
0296   mPtRecoOverGen_GenEta_300_Inf_Cent_30_50 = nullptr;
0297 
0298   mPtRecoOverGen_GenEta_20_30_Cent_50_80 = nullptr;
0299   mPtRecoOverGen_GenEta_30_50_Cent_50_80 = nullptr;
0300   mPtRecoOverGen_GenEta_50_80_Cent_50_80 = nullptr;
0301   mPtRecoOverGen_GenEta_80_120_Cent_50_80 = nullptr;
0302   mPtRecoOverGen_GenEta_120_180_Cent_50_80 = nullptr;
0303   mPtRecoOverGen_GenEta_180_300_Cent_50_80 = nullptr;
0304   mPtRecoOverGen_GenEta_300_Inf_Cent_50_80 = nullptr;
0305 }
0306 
0307 void JetTester_HeavyIons::bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &iRun, edm::EventSetup const &) {
0308   ibooker.setCurrentFolder("JetMET/JetValidation/" + mInputCollection.label());
0309 
0310   double log10PtMin = 0.50;
0311   double log10PtMax = 3.75;
0312   int log10PtBins = 26;
0313 
0314   static const size_t ncms_hcal_edge_pseudorapidity = 82 + 1;
0315   static const double cms_hcal_edge_pseudorapidity[ncms_hcal_edge_pseudorapidity] = {
0316       -5.191, -4.889, -4.716, -4.538, -4.363, -4.191, -4.013, -3.839, -3.664, -3.489, -3.314, -3.139, -2.964, -2.853,
0317       -2.650, -2.500, -2.322, -2.172, -2.043, -1.930, -1.830, -1.740, -1.653, -1.566, -1.479, -1.392, -1.305, -1.218,
0318       -1.131, -1.044, -0.957, -0.879, -0.783, -0.696, -0.609, -0.522, -0.435, -0.348, -0.261, -0.174, -0.087, 0.000,
0319       0.087,  0.174,  0.261,  0.348,  0.435,  0.522,  0.609,  0.696,  0.783,  0.879,  0.957,  1.044,  1.131,  1.218,
0320       1.305,  1.392,  1.479,  1.566,  1.653,  1.740,  1.830,  1.930,  2.043,  2.172,  2.322,  2.500,  2.650,  2.853,
0321       2.964,  3.139,  3.314,  3.489,  3.664,  3.839,  4.013,  4.191,  4.363,  4.538,  4.716,  4.889,  5.191};
0322 
0323   double etaRange[91] = {-6.0, -5.8, -5.6, -5.4, -5.2, -5.0, -4.8, -4.6, -4.4, -4.2, -4.0, -3.8, -3.6, -3.4, -3.2, -3.0,
0324                          -2.9, -2.8, -2.7, -2.6, -2.5, -2.4, -2.3, -2.2, -2.1, -2.0, -1.9, -1.8, -1.7, -1.6, -1.5, -1.4,
0325                          -1.3, -1.2, -1.1, -1.0, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0.0,  0.1,  0.2,
0326                          0.3,  0.4,  0.5,  0.6,  0.7,  0.8,  0.9,  1.0,  1.1,  1.2,  1.3,  1.4,  1.5,  1.6,  1.7,  1.8,
0327                          1.9,  2.0,  2.1,  2.2,  2.3,  2.4,  2.5,  2.6,  2.7,  2.8,  2.9,  3.0,  3.2,  3.4,  3.6,  3.8,
0328                          4.0,  4.2,  4.4,  4.6,  4.8,  5.0,  5.2,  5.4,  5.6,  5.8,  6.0};
0329 
0330   double edge_pseudorapidity[etaBins_ + 1] = {-5.191,
0331                                               -2.650,
0332                                               -2.043,
0333                                               -1.740,
0334                                               -1.479,
0335                                               -1.131,
0336                                               -0.783,
0337                                               -0.522,
0338                                               0.522,
0339                                               0.783,
0340                                               1.131,
0341                                               1.479,
0342                                               1.740,
0343                                               2.043,
0344                                               2.650,
0345                                               5.191};
0346 
0347   TH2F *h2D_etabins_vs_pt2 = new TH2F(
0348       "h2D_etabins_vs_pt2", "etaBins (x axis), sum pt^{2} (y axis)", etaBins_, edge_pseudorapidity, 10000, 0, 10000);
0349   TH2F *h2D_etabins_vs_pt = new TH2F(
0350       "h2D_etabins_vs_pt", "etaBins (x axis), sum pt (y axis)", etaBins_, edge_pseudorapidity, 10000, -1000, 1000);
0351   TH2F *h2D_etabins_vs_phi = new TH2F("h2D_etabins_vs_phi",
0352                                       "candidate map, eta(x axis), phi (y axis), pt (z axis)",
0353                                       ncms_hcal_edge_pseudorapidity - 1,
0354                                       cms_hcal_edge_pseudorapidity,
0355                                       36,
0356                                       -TMath::Pi(),
0357                                       TMath::Pi());
0358   TH2F *h2D_pfcand_etabins_vs_pt =
0359       new TH2F("h2D_etabins_vs_pt", ";#eta;sum p_{T}", etaBins_, edge_pseudorapidity, 300, 0, 300);
0360 
0361   if (isPFJet) {
0362     mNPFpart = ibooker.book1D("NPFpart", "No of particle flow candidates", 1000, 0, 10000);
0363     mPFPt = ibooker.book1D("PFPt", "PF candidate p_{T}", 1000, -5000, 5000);
0364     mPFEta = ibooker.book1D("PFEta", "PF candidate #eta", 120, -6, 6);
0365     mPFPhi = ibooker.book1D("PFPhi", "PF candidate #phi", 70, -3.5, 3.5);
0366     mPFArea = ibooker.book1D("PFArea", "VS PF candidate area", 100, 0, 4);
0367 
0368     mSumPFPt = ibooker.book1D("SumPFPt", "Sum of initial PF p_{T}", 1000, -10000, 10000);
0369 
0370     mSumSquaredPFPt = ibooker.book1D("SumSquaredPFPt", "Sum of initial PF p_{T} squared", 10000, 0, 10000);
0371 
0372     mSumPFPt_HF = ibooker.book2D(
0373         "SumPFPt_HF", "HF energy (y axis) vs Sum initial PF p_{T} (x axis)", 1000, -1000, 1000, 1000, 0, 10000);
0374 
0375     mSumPFPt_n5p191_n2p650 =
0376         ibooker.book1D("mSumPFPt_n5p191_n2p650", "Sum PFPt  in the eta range -5.191 to -2.650", 1000, -5000, 5000);
0377     mSumPFPt_n2p650_n2p043 =
0378         ibooker.book1D("mSumPFPt_n2p650_n2p043", "Sum PFPt  in the eta range -2.650 to -2.043 ", 1000, -5000, 5000);
0379     mSumPFPt_n2p043_n1p740 =
0380         ibooker.book1D("mSumPFPt_n2p043_n1p740", "Sum PFPt  in the eta range -2.043 to -1.740", 1000, -1000, 1000);
0381     mSumPFPt_n1p740_n1p479 =
0382         ibooker.book1D("mSumPFPt_n1p740_n1p479", "Sum PFPt  in the eta range -1.740 to -1.479", 1000, -1000, 1000);
0383     mSumPFPt_n1p479_n1p131 =
0384         ibooker.book1D("mSumPFPt_n1p479_n1p131", "Sum PFPt  in the eta range -1.479 to -1.131", 1000, -1000, 1000);
0385     mSumPFPt_n1p131_n0p783 =
0386         ibooker.book1D("mSumPFPt_n1p131_n0p783", "Sum PFPt  in the eta range -1.131 to -0.783", 1000, -1000, 1000);
0387     mSumPFPt_n0p783_n0p522 =
0388         ibooker.book1D("mSumPFPt_n0p783_n0p522", "Sum PFPt  in the eta range -0.783 to -0.522", 1000, -1000, 1000);
0389     mSumPFPt_n0p522_0p522 =
0390         ibooker.book1D("mSumPFPt_n0p522_0p522", "Sum PFPt  in the eta range -0.522 to 0.522", 1000, -1000, 1000);
0391     mSumPFPt_0p522_0p783 =
0392         ibooker.book1D("mSumPFPt_0p522_0p783", "Sum PFPt  in the eta range 0.522 to 0.783", 1000, -1000, 1000);
0393     mSumPFPt_0p783_1p131 =
0394         ibooker.book1D("mSumPFPt_0p783_1p131", "Sum PFPt  in the eta range 0.783 to 1.131", 1000, -1000, 1000);
0395     mSumPFPt_1p131_1p479 =
0396         ibooker.book1D("mSumPFPt_1p131_1p479", "Sum PFPt  in the eta range 1.131 to 1.479", 1000, -1000, 1000);
0397     mSumPFPt_1p479_1p740 =
0398         ibooker.book1D("mSumPFPt_1p479_1p740", "Sum PFPt  in the eta range 1.479 to 1.740", 1000, -1000, 1000);
0399     mSumPFPt_1p740_2p043 =
0400         ibooker.book1D("mSumPFPt_1p740_2p043", "Sum PFPt  in the eta range 1.740 to 2.043", 1000, -1000, 1000);
0401     mSumPFPt_2p043_2p650 =
0402         ibooker.book1D("mSumPFPt_2p043_2p650", "Sum PFPt  in the eta range 2.043 to 2.650", 1000, -5000, 5000);
0403     mSumPFPt_2p650_5p191 =
0404         ibooker.book1D("mSumPFPt_2p650_5p191", "Sum PFPt  in the eta range 2.650 to 5.191", 1000, -5000, 5000);
0405 
0406     mPFCandpT_vs_eta_Unknown = ibooker.book2D("PF_cand_X_unknown", h2D_pfcand_etabins_vs_pt);         // pf id 0
0407     mPFCandpT_vs_eta_ChargedHadron = ibooker.book2D("PF_cand_chargedHad", h2D_pfcand_etabins_vs_pt);  // pf id - 1
0408     mPFCandpT_vs_eta_electron = ibooker.book2D("PF_cand_electron", h2D_pfcand_etabins_vs_pt);         // pf id - 2
0409     mPFCandpT_vs_eta_muon = ibooker.book2D("PF_cand_muon", h2D_pfcand_etabins_vs_pt);                 // pf id - 3
0410     mPFCandpT_vs_eta_photon = ibooker.book2D("PF_cand_photon", h2D_pfcand_etabins_vs_pt);             // pf id - 4
0411     mPFCandpT_vs_eta_NeutralHadron = ibooker.book2D("PF_cand_neutralHad", h2D_pfcand_etabins_vs_pt);  // pf id - 5
0412     mPFCandpT_vs_eta_HadE_inHF = ibooker.book2D("PF_cand_HadEner_inHF", h2D_pfcand_etabins_vs_pt);    // pf id - 6
0413     mPFCandpT_vs_eta_EME_inHF = ibooker.book2D("PF_cand_EMEner_inHF", h2D_pfcand_etabins_vs_pt);      // pf id - 7
0414 
0415     mPFCandpT_Barrel_Unknown = ibooker.book1D("mPFCandpT_Barrel_Unknown",
0416                                               Form(";PF candidate p_{T}, |#eta|<%2.2f; counts", BarrelEta),
0417                                               300,
0418                                               0,
0419                                               300);  // pf id  - 0
0420     mPFCandpT_Barrel_ChargedHadron = ibooker.book1D("mPFCandpT_Barrel_ChargedHadron",
0421                                                     Form(";PF candidate p_{T}, |#eta|<%2.2f; counts", BarrelEta),
0422                                                     300,
0423                                                     0,
0424                                                     300);  // pf id - 1
0425     mPFCandpT_Barrel_electron = ibooker.book1D("mPFCandpT_Barrel_electron",
0426                                                Form(";PF candidate p_{T}, |#eta|<%2.2f; counts", BarrelEta),
0427                                                300,
0428                                                0,
0429                                                300);  // pf id - 2
0430     mPFCandpT_Barrel_muon = ibooker.book1D("mPFCandpT_Barrel_muon",
0431                                            Form(";PF candidate p_{T}, |#eta|<%2.2f; counts", BarrelEta),
0432                                            300,
0433                                            0,
0434                                            300);  // pf id - 3
0435     mPFCandpT_Barrel_photon = ibooker.book1D("mPFCandpT_Barrel_photon",
0436                                              Form(";PF candidate p_{T}, |#eta|<%2.2f; counts", BarrelEta),
0437                                              300,
0438                                              0,
0439                                              300);  // pf id - 4
0440     mPFCandpT_Barrel_NeutralHadron = ibooker.book1D("mPFCandpT_Barrel_NeutralHadron",
0441                                                     Form(";PF candidate p_{T}, |#eta|<%2.2f; counts", BarrelEta),
0442                                                     300,
0443                                                     0,
0444                                                     300);  // pf id - 5
0445     mPFCandpT_Barrel_HadE_inHF = ibooker.book1D("mPFCandpT_Barrel_HadE_inHF",
0446                                                 Form(";PF candidate p_{T}, |#eta|<%2.2f; counts", BarrelEta),
0447                                                 300,
0448                                                 0,
0449                                                 300);  // pf id - 6
0450     mPFCandpT_Barrel_EME_inHF = ibooker.book1D("mPFCandpT_Barrel_EME_inHF",
0451                                                Form(";PF candidate p_{T}, |#eta|<%2.2f; counts", BarrelEta),
0452                                                300,
0453                                                0,
0454                                                300);  // pf id - 7
0455 
0456     mPFCandpT_Endcap_Unknown =
0457         ibooker.book1D("mPFCandpT_Endcap_Unknown",
0458                        Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", BarrelEta, EndcapEta),
0459                        300,
0460                        0,
0461                        300);  // pf id - 0
0462     mPFCandpT_Endcap_ChargedHadron =
0463         ibooker.book1D("mPFCandpT_Endcap_ChargedHadron",
0464                        Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", BarrelEta, EndcapEta),
0465                        300,
0466                        0,
0467                        300);  // pf id - 1
0468     mPFCandpT_Endcap_electron =
0469         ibooker.book1D("mPFCandpT_Endcap_electron",
0470                        Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", BarrelEta, EndcapEta),
0471                        300,
0472                        0,
0473                        300);  // pf id - 2
0474     mPFCandpT_Endcap_muon =
0475         ibooker.book1D("mPFCandpT_Endcap_muon",
0476                        Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", BarrelEta, EndcapEta),
0477                        300,
0478                        0,
0479                        300);  // pf id - 3
0480     mPFCandpT_Endcap_photon =
0481         ibooker.book1D("mPFCandpT_Endcap_photon",
0482                        Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", BarrelEta, EndcapEta),
0483                        300,
0484                        0,
0485                        300);  // pf id - 4
0486     mPFCandpT_Endcap_NeutralHadron =
0487         ibooker.book1D("mPFCandpT_Endcap_NeutralHadron",
0488                        Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", BarrelEta, EndcapEta),
0489                        300,
0490                        0,
0491                        300);  // pf id - 5
0492     mPFCandpT_Endcap_HadE_inHF =
0493         ibooker.book1D("mPFCandpT_Endcap_HadE_inHF",
0494                        Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", BarrelEta, EndcapEta),
0495                        300,
0496                        0,
0497                        300);  // pf id - 6
0498     mPFCandpT_Endcap_EME_inHF =
0499         ibooker.book1D("mPFCandpT_Endcap_EME_inHF",
0500                        Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", BarrelEta, EndcapEta),
0501                        300,
0502                        0,
0503                        300);  // pf id - 7
0504 
0505     mPFCandpT_Forward_Unknown =
0506         ibooker.book1D("mPFCandpT_Forward_Unknown",
0507                        Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", EndcapEta, ForwardEta),
0508                        300,
0509                        0,
0510                        300);  // pf id - 0
0511     mPFCandpT_Forward_ChargedHadron =
0512         ibooker.book1D("mPFCandpT_Forward_ChargedHadron",
0513                        Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", EndcapEta, ForwardEta),
0514                        300,
0515                        0,
0516                        300);  // pf id - 1
0517     mPFCandpT_Forward_electron =
0518         ibooker.book1D("mPFCandpT_Forward_electron",
0519                        Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", EndcapEta, ForwardEta),
0520                        300,
0521                        0,
0522                        300);  // pf id - 2
0523     mPFCandpT_Forward_muon =
0524         ibooker.book1D("mPFCandpT_Forward_muon",
0525                        Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", EndcapEta, ForwardEta),
0526                        300,
0527                        0,
0528                        300);  // pf id - 3
0529     mPFCandpT_Forward_photon =
0530         ibooker.book1D("mPFCandpT_Forward_photon",
0531                        Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", EndcapEta, ForwardEta),
0532                        300,
0533                        0,
0534                        300);  // pf id - 4
0535     mPFCandpT_Forward_NeutralHadron =
0536         ibooker.book1D("mPFCandpT_Forward_NeutralHadron",
0537                        Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", EndcapEta, ForwardEta),
0538                        300,
0539                        0,
0540                        300);  // pf id - 5
0541     mPFCandpT_Forward_HadE_inHF =
0542         ibooker.book1D("mPFCandpT_Forward_HadE_inHF",
0543                        Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", EndcapEta, ForwardEta),
0544                        300,
0545                        0,
0546                        300);  // pf id - 6
0547     mPFCandpT_Forward_EME_inHF =
0548         ibooker.book1D("mPFCandpT_Forward_EME_inHF",
0549                        Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", EndcapEta, ForwardEta),
0550                        300,
0551                        0,
0552                        300);  // pf id - 7
0553   }
0554 
0555   if (isCaloJet) {
0556     mNCalopart = ibooker.book1D("NCalopart", "No of particle flow candidates", 1000, 0, 10000);
0557     mCaloPt = ibooker.book1D("CaloPt", "Calo candidate p_{T}", 1000, -5000, 5000);
0558     mCaloEta = ibooker.book1D("CaloEta", "Calo candidate #eta", 120, -6, 6);
0559     mCaloPhi = ibooker.book1D("CaloPhi", "Calo candidate #phi", 70, -3.5, 3.5);
0560     mCaloArea = ibooker.book1D("CaloArea", "VS Calo candidate area", 100, 0, 4);
0561 
0562     mSumCaloPt = ibooker.book1D("SumCaloPt", "Sum Calo p_{T}", 1000, -10000, 10000);
0563 
0564     mSumSquaredCaloPt = ibooker.book1D("SumSquaredCaloPt", "Sum of initial Calo tower p_{T} squared", 10000, 0, 10000);
0565 
0566     mSumCaloPt_HF =
0567         ibooker.book2D("SumCaloPt_HF", "HF Energy (y axis) vs Sum Calo tower p_{T}", 1000, -1000, 1000, 1000, 0, 10000);
0568 
0569     mSumCaloPt_n5p191_n2p650 = ibooker.book1D(
0570         "mSumCaloPt_n5p191_n2p650", "Sum Calo tower pT variable in the eta range -5.191 to -2.650", 1000, -5000, 5000);
0571     mSumCaloPt_n2p650_n2p043 = ibooker.book1D(
0572         "mSumCaloPt_n2p650_n2p043", "Sum Calo tower pT variable in the eta range -2.650 to -2.043", 1000, -5000, 5000);
0573     mSumCaloPt_n2p043_n1p740 = ibooker.book1D(
0574         "mSumCaloPt_n2p043_n1p740", "Sum Calo tower pT variable in the eta range -2.043 to -1.740", 1000, -1000, 1000);
0575     mSumCaloPt_n1p740_n1p479 = ibooker.book1D(
0576         "mSumCaloPt_n1p740_n1p479", "Sum Calo tower pT variable in the eta range -1.740 to -1.479", 1000, -1000, 1000);
0577     mSumCaloPt_n1p479_n1p131 = ibooker.book1D(
0578         "mSumCaloPt_n1p479_n1p131", "Sum Calo tower pT variable in the eta range -1.479 to -1.131", 1000, -1000, 1000);
0579     mSumCaloPt_n1p131_n0p783 = ibooker.book1D(
0580         "mSumCaloPt_n1p131_n0p783", "Sum Calo tower pT variable in the eta range -1.131 to -0.783", 1000, -1000, 1000);
0581     mSumCaloPt_n0p783_n0p522 = ibooker.book1D(
0582         "mSumCaloPt_n0p783_n0p522", "Sum Calo tower pT variable in the eta range -0.783 to -0.522", 1000, -1000, 1000);
0583     mSumCaloPt_n0p522_0p522 = ibooker.book1D(
0584         "mSumCaloPt_n0p522_0p522", "Sum Calo tower pT variable in the eta range -0.522 to 0.522", 1000, -1000, 1000);
0585     mSumCaloPt_0p522_0p783 = ibooker.book1D(
0586         "mSumCaloPt_0p522_0p783", "Sum Calo tower pT variable in the eta range 0.522 to 0.783", 1000, -1000, 1000);
0587     mSumCaloPt_0p783_1p131 = ibooker.book1D(
0588         "mSumCaloPt_0p783_1p131", "Sum Calo tower pT variable in the eta range 0.783 to 1.131", 1000, -1000, 1000);
0589     mSumCaloPt_1p131_1p479 = ibooker.book1D(
0590         "mSumCaloPt_1p131_1p479", "Sum Calo tower pT variable in the eta range 1.131 to 1.479", 1000, -1000, 1000);
0591     mSumCaloPt_1p479_1p740 = ibooker.book1D(
0592         "mSumCaloPt_1p479_1p740", "Sum Calo tower pT variable in the eta range 1.479 to 1.740", 1000, -1000, 1000);
0593     mSumCaloPt_1p740_2p043 = ibooker.book1D(
0594         "mSumCaloPt_1p740_2p043", "Sum Calo tower pT variable in the eta range 1.740 to 2.043", 1000, -1000, 1000);
0595     mSumCaloPt_2p043_2p650 = ibooker.book1D(
0596         "mSumCaloPt_2p043_2p650", "Sum Calo tower pT variable in the eta range 2.043 to 2.650", 1000, -5000, 5000);
0597     mSumCaloPt_2p650_5p191 = ibooker.book1D(
0598         "mSumCaloPt_2p650_5p191", "Sum Calo tower pT variable in the eta range 2.650 to 5.191", 1000, -5000, 5000);
0599   }
0600 
0601   // particle flow variables histograms
0602   mSumpt = ibooker.book1D("SumpT", "Sum p_{T} of all the PF candidates per event", 1000, 0, 10000);
0603 
0604   // Event variables
0605   mNvtx = ibooker.book1D("Nvtx", "number of vertices", 60, 0, 60);
0606   mHF = ibooker.book1D("HF", "HF energy distribution", 1000, 0, 10000);
0607 
0608   // Jet parameters
0609   mEta = ibooker.book1D("Eta", "Eta", 120, -6, 6);
0610   mPhi = ibooker.book1D("Phi", "Phi", 70, -3.5, 3.5);
0611   mPt = ibooker.book1D("Pt", "Pt", 100, 0, 1000);
0612   mP = ibooker.book1D("P", "P", 100, 0, 1000);
0613   mEnergy = ibooker.book1D("Energy", "Energy", 100, 0, 1000);
0614   mMass = ibooker.book1D("Mass", "Mass", 100, 0, 200);
0615   mConstituents = ibooker.book1D("Constituents", "Constituents", 100, 0, 100);
0616   mJetArea = ibooker.book1D("JetArea", "JetArea", 100, 0, 4);
0617   mjetpileup = ibooker.book1D("jetPileUp", "jetPileUp", 100, 0, 150);
0618   mNJets_40 = ibooker.book1D("NJets_pt_greater_40", "NJets pT > 40 GeV", 50, 0, 100);
0619   mNJets = ibooker.book1D("NJets", "NJets", 50, 0, 100);
0620 
0621   mGenEta = ibooker.book1D("Gen Eta", ";gen jet #eta;counts", 120, -6, 6);
0622   mGenPhi = ibooker.book1D("Gen Phi", ";gen jet #phi;counts", 70, -3.5, 3.5);
0623   mGenPt = ibooker.book1D("Gen pT", "gen jet p_{T}", 250, 0, 1000);
0624   mPtHat = ibooker.book1D("pThat", "#hat{p_{T}}", 250, 0, 1000);
0625 
0626   mPtRecoOverGen_B_20_30_Cent_0_10 =
0627       ibooker.book1D("PtRecoOverGen_B_20_30_Cent_0_10", "20<genpt<30; recopt/genpt (0-10%) (Barrel);counts", 90, 0, 2);
0628   mPtRecoOverGen_E_20_30_Cent_0_10 =
0629       ibooker.book1D("PtRecoOverGen_E_20_30_Cent_0_10", "20<genpt<30; recopt/genpt (0-10%) (EndCap);counts", 90, 0, 2);
0630   mPtRecoOverGen_F_20_30_Cent_0_10 =
0631       ibooker.book1D("PtRecoOverGen_F_20_30_Cent_0_10", "20<genpt<30; recopt/genpt (0-10%) (Forward);counts", 90, 0, 2);
0632   mPtRecoOverGen_B_30_50_Cent_0_10 =
0633       ibooker.book1D("PtRecoOverGen_B_30_50_Cent_0_10", "30<genpt<50; recopt/genpt (0-10%) (Barrel);counts", 90, 0, 2);
0634   mPtRecoOverGen_E_30_50_Cent_0_10 =
0635       ibooker.book1D("PtRecoOverGen_E_30_50_Cent_0_10", "30<genpt<50; recopt/genpt (0-10%) (EndCap);counts", 90, 0, 2);
0636   mPtRecoOverGen_F_30_50_Cent_0_10 =
0637       ibooker.book1D("PtRecoOverGen_F_30_50_Cent_0_10", "30<genpt<50; recopt/genpt (0-10%) (Forward);counts", 90, 0, 2);
0638   mPtRecoOverGen_B_50_80_Cent_0_10 =
0639       ibooker.book1D("PtRecoOverGen_B_50_80_Cent_0_10", "50<genpt<80; recopt/genpt (0-10%) (Barrel);counts", 90, 0, 2);
0640   mPtRecoOverGen_E_50_80_Cent_0_10 =
0641       ibooker.book1D("PtRecoOverGen_E_50_80_Cent_0_10", "50<genpt<80; recopt/genpt (0-10%) (EndCap);counts", 90, 0, 2);
0642   mPtRecoOverGen_F_50_80_Cent_0_10 =
0643       ibooker.book1D("PtRecoOverGen_F_50_80_Cent_0_10", "50<genpt<80; recopt/genpt (0-10%) (Forward);counts", 90, 0, 2);
0644   mPtRecoOverGen_B_80_120_Cent_0_10 = ibooker.book1D(
0645       "PtRecoOverGen_B_80_120_Cent_0_10", "80<genpt<120; recopt/genpt (0-10%) (Barrel);counts", 90, 0, 2);
0646   mPtRecoOverGen_E_80_120_Cent_0_10 = ibooker.book1D(
0647       "PtRecoOverGen_E_80_120_Cent_0_10", "80<genpt<120; recopt/genpt (0-10%) (EndCap);counts", 90, 0, 2);
0648   mPtRecoOverGen_F_80_120_Cent_0_10 = ibooker.book1D(
0649       "PtRecoOverGen_F_80_120_Cent_0_10", "80<genpt<120; recopt/genpt (0-10%) (Forward);counts", 90, 0, 2);
0650   mPtRecoOverGen_B_120_180_Cent_0_10 = ibooker.book1D(
0651       "PtRecoOverGen_B_120_180_Cent_0_10", "120<genpt<180; recopt/genpt (0-10%) (Barrel);counts", 90, 0, 2);
0652   mPtRecoOverGen_E_120_180_Cent_0_10 = ibooker.book1D(
0653       "PtRecoOverGen_E_120_180_Cent_0_10", "120<genpt<180; recopt/genpt (0-10%) (EndCap);counts", 90, 0, 2);
0654   mPtRecoOverGen_F_120_180_Cent_0_10 = ibooker.book1D(
0655       "PtRecoOverGen_F_120_180_Cent_0_10", "120<genpt<180; recopt/genpt (0-10%) (Forward);counts", 90, 0, 2);
0656   mPtRecoOverGen_B_180_300_Cent_0_10 = ibooker.book1D(
0657       "PtRecoOverGen_B_180_300_Cent_0_10", "180<genpt<300; recopt/genpt (0-10%) (Barrel);counts", 90, 0, 2);
0658   mPtRecoOverGen_E_180_300_Cent_0_10 = ibooker.book1D(
0659       "PtRecoOverGen_E_180_300_Cent_0_10", "180<genpt<300; recopt/genpt (0-10%) (EndCap);counts", 90, 0, 2);
0660   mPtRecoOverGen_F_180_300_Cent_0_10 = ibooker.book1D(
0661       "PtRecoOverGen_F_180_300_Cent_0_10", "180<genpt<300; recopt/genpt (0-10%) (Forward);counts", 90, 0, 2);
0662   mPtRecoOverGen_B_300_Inf_Cent_0_10 = ibooker.book1D(
0663       "PtRecoOverGen_B_300_Inf_Cent_0_10", "300<genpt<Inf; recopt/genpt (0-10%) (Barrel);counts", 90, 0, 2);
0664   mPtRecoOverGen_E_300_Inf_Cent_0_10 = ibooker.book1D(
0665       "PtRecoOverGen_E_300_Inf_Cent_0_10", "300<genpt<Inf; recopt/genpt (0-10%) (EndCap);counts", 90, 0, 2);
0666   mPtRecoOverGen_F_300_Inf_Cent_0_10 = ibooker.book1D(
0667       "PtRecoOverGen_F_300_Inf_Cent_0_10", "300<genpt<Inf; recopt/genpt (0-10%) (Forward);counts", 90, 0, 2);
0668 
0669   mPtRecoOverGen_B_20_30_Cent_10_30 = ibooker.book1D(
0670       "PtRecoOverGen_B_20_30_Cent_10_30", "20<genpt<30; recopt/genpt (10-30%) (Barrel);counts", 90, 0, 2);
0671   mPtRecoOverGen_E_20_30_Cent_10_30 = ibooker.book1D(
0672       "PtRecoOverGen_E_20_30_Cent_10_30", "20<genpt<30; recopt/genpt (10-30%) (EndCap);counts", 90, 0, 2);
0673   mPtRecoOverGen_F_20_30_Cent_10_30 = ibooker.book1D(
0674       "PtRecoOverGen_F_20_30_Cent_10_30", "20<genpt<30; recopt/genpt (10-30%) (Forward);counts", 90, 0, 2);
0675   mPtRecoOverGen_B_30_50_Cent_10_30 = ibooker.book1D(
0676       "PtRecoOverGen_B_30_50_Cent_10_30", "30<genpt<50; recopt/genpt (10-30%) (Barrel);counts", 90, 0, 2);
0677   mPtRecoOverGen_E_30_50_Cent_10_30 = ibooker.book1D(
0678       "PtRecoOverGen_E_30_50_Cent_10_30", "30<genpt<50; recopt/genpt (10-30%) (EndCap);counts", 90, 0, 2);
0679   mPtRecoOverGen_F_30_50_Cent_10_30 = ibooker.book1D(
0680       "PtRecoOverGen_F_30_50_Cent_10_30", "30<genpt<50; recopt/genpt (10-30%) (Forward);counts", 90, 0, 2);
0681   mPtRecoOverGen_B_50_80_Cent_10_30 = ibooker.book1D(
0682       "PtRecoOverGen_B_50_80_Cent_10_30", "50<genpt<80; recopt/genpt (10-30%) (Barrel);counts", 90, 0, 2);
0683   mPtRecoOverGen_E_50_80_Cent_10_30 = ibooker.book1D(
0684       "PtRecoOverGen_E_50_80_Cent_10_30", "50<genpt<80; recopt/genpt (10-30%) (EndCap);counts", 90, 0, 2);
0685   mPtRecoOverGen_F_50_80_Cent_10_30 = ibooker.book1D(
0686       "PtRecoOverGen_F_50_80_Cent_10_30", "50<genpt<80; recopt/genpt (10-30%) (Forward);counts", 90, 0, 2);
0687   mPtRecoOverGen_B_80_120_Cent_10_30 = ibooker.book1D(
0688       "PtRecoOverGen_B_80_120_Cent_10_30", "80<genpt<120; recopt/genpt (10-30%) (Barrel);counts", 90, 0, 2);
0689   mPtRecoOverGen_E_80_120_Cent_10_30 = ibooker.book1D(
0690       "PtRecoOverGen_E_80_120_Cent_10_30", "80<genpt<120; recopt/genpt (10-30%) (EndCap);counts", 90, 0, 2);
0691   mPtRecoOverGen_F_80_120_Cent_10_30 = ibooker.book1D(
0692       "PtRecoOverGen_F_80_120_Cent_10_30", "80<genpt<120; recopt/genpt (10-30%) (Forward);counts", 90, 0, 2);
0693   mPtRecoOverGen_B_120_180_Cent_10_30 = ibooker.book1D(
0694       "PtRecoOverGen_B_120_180_Cent_10_30", "120<genpt<180; recopt/genpt (10-30%) (Barrel);counts", 90, 0, 2);
0695   mPtRecoOverGen_E_120_180_Cent_10_30 = ibooker.book1D(
0696       "PtRecoOverGen_E_120_180_Cent_10_30", "120<genpt<180; recopt/genpt (10-30%) (EndCap);counts", 90, 0, 2);
0697   mPtRecoOverGen_F_120_180_Cent_10_30 = ibooker.book1D(
0698       "PtRecoOverGen_F_120_180_Cent_10_30", "120<genpt<180; recopt/genpt (10-30%) (Forward);counts", 90, 0, 2);
0699   mPtRecoOverGen_B_180_300_Cent_10_30 = ibooker.book1D(
0700       "PtRecoOverGen_B_180_300_Cent_10_30", "180<genpt<300; recopt/genpt (10-30%) (Barrel);counts", 90, 0, 2);
0701   mPtRecoOverGen_E_180_300_Cent_10_30 = ibooker.book1D(
0702       "PtRecoOverGen_E_180_300_Cent_10_30", "180<genpt<300; recopt/genpt (10-30%) (EndCap);counts", 90, 0, 2);
0703   mPtRecoOverGen_F_180_300_Cent_10_30 = ibooker.book1D(
0704       "PtRecoOverGen_F_180_300_Cent_10_30", "180<genpt<300; recopt/genpt (10-30%) (Forward);counts", 90, 0, 2);
0705   mPtRecoOverGen_B_300_Inf_Cent_10_30 = ibooker.book1D(
0706       "PtRecoOverGen_B_300_Inf_Cent_10_30", "300<genpt<Inf; recopt/genpt (10-30%) (Barrel);counts", 90, 0, 2);
0707   mPtRecoOverGen_E_300_Inf_Cent_10_30 = ibooker.book1D(
0708       "PtRecoOverGen_E_300_Inf_Cent_10_30", "300<genpt<Inf; recopt/genpt (10-30%) (EndCap);counts", 90, 0, 2);
0709   mPtRecoOverGen_F_300_Inf_Cent_10_30 = ibooker.book1D(
0710       "PtRecoOverGen_F_300_Inf_Cent_10_30", "300<genpt<Inf; recopt/genpt (10-30%) (Forward);counts", 90, 0, 2);
0711 
0712   mPtRecoOverGen_B_20_30_Cent_30_50 = ibooker.book1D(
0713       "PtRecoOverGen_B_20_30_Cent_30_50", "20<genpt<30; recopt/genpt (30-50%) (Barrel);counts", 90, 0, 2);
0714   mPtRecoOverGen_E_20_30_Cent_30_50 = ibooker.book1D(
0715       "PtRecoOverGen_E_20_30_Cent_30_50", "20<genpt<30; recopt/genpt (30-50%) (EndCap);counts", 90, 0, 2);
0716   mPtRecoOverGen_F_20_30_Cent_30_50 = ibooker.book1D(
0717       "PtRecoOverGen_F_20_30_Cent_30_50", "20<genpt<30; recopt/genpt (30-50%) (Forward);counts", 90, 0, 2);
0718   mPtRecoOverGen_B_30_50_Cent_30_50 = ibooker.book1D(
0719       "PtRecoOverGen_B_30_50_Cent_30_50", "30<genpt<50; recopt/genpt (30-50%) (Barrel);counts", 90, 0, 2);
0720   mPtRecoOverGen_E_30_50_Cent_30_50 = ibooker.book1D(
0721       "PtRecoOverGen_E_30_50_Cent_30_50", "30<genpt<50; recopt/genpt (30-50%) (EndCap);counts", 90, 0, 2);
0722   mPtRecoOverGen_F_30_50_Cent_30_50 = ibooker.book1D(
0723       "PtRecoOverGen_F_30_50_Cent_30_50", "30<genpt<50; recopt/genpt (30-50%) (Forward);counts", 90, 0, 2);
0724   mPtRecoOverGen_B_50_80_Cent_30_50 = ibooker.book1D(
0725       "PtRecoOverGen_B_50_80_Cent_30_50", "50<genpt<80; recopt/genpt (30-50%) (Barrel);counts", 90, 0, 2);
0726   mPtRecoOverGen_E_50_80_Cent_30_50 = ibooker.book1D(
0727       "PtRecoOverGen_E_50_80_Cent_30_50", "50<genpt<80; recopt/genpt (30-50%) (EndCap);counts", 90, 0, 2);
0728   mPtRecoOverGen_F_50_80_Cent_30_50 = ibooker.book1D(
0729       "PtRecoOverGen_F_50_80_Cent_30_50", "50<genpt<80; recopt/genpt (30-50%) (Forward);counts", 90, 0, 2);
0730   mPtRecoOverGen_B_80_120_Cent_30_50 = ibooker.book1D(
0731       "PtRecoOverGen_B_80_120_Cent_30_50", "80<genpt<120; recopt/genpt (30-50%) (Barrel);counts", 90, 0, 2);
0732   mPtRecoOverGen_E_80_120_Cent_30_50 = ibooker.book1D(
0733       "PtRecoOverGen_E_80_120_Cent_30_50", "80<genpt<120; recopt/genpt (30-50%) (EndCap);counts", 90, 0, 2);
0734   mPtRecoOverGen_F_80_120_Cent_30_50 = ibooker.book1D(
0735       "PtRecoOverGen_F_80_120_Cent_30_50", "80<genpt<120; recopt/genpt (30-50%) (Forward);counts", 90, 0, 2);
0736   mPtRecoOverGen_B_120_180_Cent_30_50 = ibooker.book1D(
0737       "PtRecoOverGen_B_120_180_Cent_30_50", "120<genpt<180; recopt/genpt (30-50%) (Barrel);counts", 90, 0, 2);
0738   mPtRecoOverGen_E_120_180_Cent_30_50 = ibooker.book1D(
0739       "PtRecoOverGen_E_120_180_Cent_30_50", "120<genpt<180; recopt/genpt (30-50%) (EndCap);counts", 90, 0, 2);
0740   mPtRecoOverGen_F_120_180_Cent_30_50 = ibooker.book1D(
0741       "PtRecoOverGen_F_120_180_Cent_30_50", "120<genpt<180; recopt/genpt (30-50%) (Forward);counts", 90, 0, 2);
0742   mPtRecoOverGen_B_180_300_Cent_30_50 = ibooker.book1D(
0743       "PtRecoOverGen_B_180_300_Cent_30_50", "180<genpt<300; recopt/genpt (30-50%) (Barrel);counts", 90, 0, 2);
0744   mPtRecoOverGen_E_180_300_Cent_30_50 = ibooker.book1D(
0745       "PtRecoOverGen_E_180_300_Cent_30_50", "180<genpt<300; recopt/genpt (30-50%) (EndCap);counts", 90, 0, 2);
0746   mPtRecoOverGen_F_180_300_Cent_30_50 = ibooker.book1D(
0747       "PtRecoOverGen_F_180_300_Cent_30_50", "180<genpt<300; recopt/genpt (30-50%) (Forward);counts", 90, 0, 2);
0748   mPtRecoOverGen_B_300_Inf_Cent_30_50 = ibooker.book1D(
0749       "PtRecoOverGen_B_300_Inf_Cent_30_50", "300<genpt<Inf; recopt/genpt (30-50%) (Barrel);counts", 90, 0, 2);
0750   mPtRecoOverGen_E_300_Inf_Cent_30_50 = ibooker.book1D(
0751       "PtRecoOverGen_E_300_Inf_Cent_30_50", "300<genpt<Inf; recopt/genpt (30-50%) (EndCap);counts", 90, 0, 2);
0752   mPtRecoOverGen_F_300_Inf_Cent_30_50 = ibooker.book1D(
0753       "PtRecoOverGen_F_300_Inf_Cent_30_50", "300<genpt<Inf; recopt/genpt (30-50%) (Forward);counts", 90, 0, 2);
0754 
0755   mPtRecoOverGen_B_20_30_Cent_50_80 = ibooker.book1D(
0756       "PtRecoOverGen_B_20_30_Cent_50_80", "20<genpt<30; recopt/genpt (50-80%) (Barrel);counts", 90, 0, 2);
0757   mPtRecoOverGen_E_20_30_Cent_50_80 = ibooker.book1D(
0758       "PtRecoOverGen_E_20_30_Cent_50_80", "20<genpt<30; recopt/genpt (50-80%) (EndCap);counts", 90, 0, 2);
0759   mPtRecoOverGen_F_20_30_Cent_50_80 = ibooker.book1D(
0760       "PtRecoOverGen_F_20_30_Cent_50_80", "20<genpt<30; recopt/genpt (50-80%) (Forward);counts", 90, 0, 2);
0761   mPtRecoOverGen_B_30_50_Cent_50_80 = ibooker.book1D(
0762       "PtRecoOverGen_B_30_50_Cent_50_80", "30<genpt<50; recopt/genpt (50-80%) (Barrel);counts", 90, 0, 2);
0763   mPtRecoOverGen_E_30_50_Cent_50_80 = ibooker.book1D(
0764       "PtRecoOverGen_E_30_50_Cent_50_80", "30<genpt<50; recopt/genpt (50-80%) (EndCap);counts", 90, 0, 2);
0765   mPtRecoOverGen_F_30_50_Cent_50_80 = ibooker.book1D(
0766       "PtRecoOverGen_F_30_50_Cent_50_80", "30<genpt<50; recopt/genpt (50-80%) (Forward);counts", 90, 0, 2);
0767   mPtRecoOverGen_B_50_80_Cent_50_80 = ibooker.book1D(
0768       "PtRecoOverGen_B_50_80_Cent_50_80", "50<genpt<80; recopt/genpt (50-80%) (Barrel);counts", 90, 0, 2);
0769   mPtRecoOverGen_E_50_80_Cent_50_80 = ibooker.book1D(
0770       "PtRecoOverGen_E_50_80_Cent_50_80", "50<genpt<80; recopt/genpt (50-80%) (EndCap);counts", 90, 0, 2);
0771   mPtRecoOverGen_F_50_80_Cent_50_80 = ibooker.book1D(
0772       "PtRecoOverGen_F_50_80_Cent_50_80", "50<genpt<80; recopt/genpt (50-80%) (Forward);counts", 90, 0, 2);
0773   mPtRecoOverGen_B_80_120_Cent_50_80 = ibooker.book1D(
0774       "PtRecoOverGen_B_80_120_Cent_50_80", "80<genpt<120; recopt/genpt (50-80%) (Barrel);counts", 90, 0, 2);
0775   mPtRecoOverGen_E_80_120_Cent_50_80 = ibooker.book1D(
0776       "PtRecoOverGen_E_80_120_Cent_50_80", "80<genpt<120; recopt/genpt (50-80%) (EndCap);counts", 90, 0, 2);
0777   mPtRecoOverGen_F_80_120_Cent_50_80 = ibooker.book1D(
0778       "PtRecoOverGen_F_80_120_Cent_50_80", "80<genpt<120; recopt/genpt (50-80%) (Forward);counts", 90, 0, 2);
0779   mPtRecoOverGen_B_120_180_Cent_50_80 = ibooker.book1D(
0780       "PtRecoOverGen_B_120_180_Cent_50_80", "120<genpt<180; recopt/genpt (50-80%) (Barrel);counts", 90, 0, 2);
0781   mPtRecoOverGen_E_120_180_Cent_50_80 = ibooker.book1D(
0782       "PtRecoOverGen_E_120_180_Cent_50_80", "120<genpt<180; recopt/genpt (50-80%) (EndCap);counts", 90, 0, 2);
0783   mPtRecoOverGen_F_120_180_Cent_50_80 = ibooker.book1D(
0784       "PtRecoOverGen_F_120_180_Cent_50_80", "120<genpt<180; recopt/genpt (50-80%) (Forward);counts", 90, 0, 2);
0785   mPtRecoOverGen_B_180_300_Cent_50_80 = ibooker.book1D(
0786       "PtRecoOverGen_B_180_300_Cent_50_80", "180<genpt<300; recopt/genpt (50-80%) (Barrel);counts", 90, 0, 2);
0787   mPtRecoOverGen_E_180_300_Cent_50_80 = ibooker.book1D(
0788       "PtRecoOverGen_E_180_300_Cent_50_80", "180<genpt<300; recopt/genpt (50-80%) (EndCap);counts", 90, 0, 2);
0789   mPtRecoOverGen_F_180_300_Cent_50_80 = ibooker.book1D(
0790       "PtRecoOverGen_F_180_300_Cent_50_80", "180<genpt<300; recopt/genpt (50-80%) (Forward);counts", 90, 0, 2);
0791   mPtRecoOverGen_B_300_Inf_Cent_50_80 = ibooker.book1D(
0792       "PtRecoOverGen_B_300_Inf_Cent_50_80", "300<genpt<Inf; recopt/genpt (50-80%) (Barrel);counts", 90, 0, 2);
0793   mPtRecoOverGen_E_300_Inf_Cent_50_80 = ibooker.book1D(
0794       "PtRecoOverGen_E_300_Inf_Cent_50_80", "300<genpt<Inf; recopt/genpt (50-80%) (EndCap);counts", 90, 0, 2);
0795   mPtRecoOverGen_F_300_Inf_Cent_50_80 = ibooker.book1D(
0796       "PtRecoOverGen_F_300_Inf_Cent_50_80", "300<genpt<Inf; recopt/genpt (50-80%) (Forward);counts", 90, 0, 2);
0797 
0798   mPtRecoOverGen_GenPt_B_Cent_0_10 = ibooker.bookProfile("PtRecoOverGen_GenPt_B_Cent_0_10",
0799                                                          Form("|#eta|<%2.2f, (0-10cent);genpt;recopt/genpt", BarrelEta),
0800                                                          log10PtBins,
0801                                                          log10PtMin,
0802                                                          log10PtMax,
0803                                                          0,
0804                                                          2,
0805                                                          " ");
0806   mPtRecoOverGen_GenPt_E_Cent_0_10 =
0807       ibooker.bookProfile("PtRecoOverGen_GenPt_E_Cent_0_10",
0808                           Form("%2.2f<|#eta|<%2.2f, (0-10cent);genpt;recopt/genpt", BarrelEta, EndcapEta),
0809                           log10PtBins,
0810                           log10PtMin,
0811                           log10PtMax,
0812                           0,
0813                           2,
0814                           " ");
0815   mPtRecoOverGen_GenPt_F_Cent_0_10 =
0816       ibooker.bookProfile("PtRecoOverGen_GenPt_F_Cent_0_10",
0817                           Form("%2.2f<|#eta|<%2.2f, (0-10cent);genpt;recopt/genpt", EndcapEta, ForwardEta),
0818                           log10PtBins,
0819                           log10PtMin,
0820                           log10PtMax,
0821                           0,
0822                           2,
0823                           " ");
0824   mPtRecoOverGen_GenPt_B_Cent_10_30 =
0825       ibooker.bookProfile("PtRecoOverGen_GenPt_B_Cent_10_30",
0826                           Form("|#eta|<%2.2f, (10-30cent);genpt;recopt/genpt", BarrelEta),
0827                           log10PtBins,
0828                           log10PtMin,
0829                           log10PtMax,
0830                           0,
0831                           2,
0832                           " ");
0833   mPtRecoOverGen_GenPt_E_Cent_10_30 =
0834       ibooker.bookProfile("PtRecoOverGen_GenPt_E_Cent_10_30",
0835                           Form("%2.2f<|#eta|<%2.2f, (10-30cent);genpt;recopt/genpt", BarrelEta, EndcapEta),
0836                           log10PtBins,
0837                           log10PtMin,
0838                           log10PtMax,
0839                           0,
0840                           2,
0841                           " ");
0842   mPtRecoOverGen_GenPt_F_Cent_10_30 =
0843       ibooker.bookProfile("PtRecoOverGen_GenPt_F_Cent_10_30",
0844                           Form("%2.2f<|#eta|<%2.2f, (10-30cent);genpt;recopt/genpt", EndcapEta, ForwardEta),
0845                           log10PtBins,
0846                           log10PtMin,
0847                           log10PtMax,
0848                           0,
0849                           2,
0850                           " ");
0851   mPtRecoOverGen_GenPt_B_Cent_30_50 =
0852       ibooker.bookProfile("PtRecoOverGen_GenPt_B_Cent_30_50",
0853                           Form("|#eta|<%2.2f, (30-50cent);genpt;recopt/genpt", BarrelEta),
0854                           log10PtBins,
0855                           log10PtMin,
0856                           log10PtMax,
0857                           0,
0858                           2,
0859                           " ");
0860   mPtRecoOverGen_GenPt_E_Cent_30_50 =
0861       ibooker.bookProfile("PtRecoOverGen_GenPt_E_Cent_30_50",
0862                           Form("%2.2f<|#eta|<%2.2f, (30-50cent);genpt;recopt/genpt", BarrelEta, EndcapEta),
0863                           log10PtBins,
0864                           log10PtMin,
0865                           log10PtMax,
0866                           0,
0867                           2,
0868                           " ");
0869   mPtRecoOverGen_GenPt_F_Cent_30_50 =
0870       ibooker.bookProfile("PtRecoOverGen_GenPt_F_Cent_30_50",
0871                           Form("%2.2f<|#eta|<%2.2f, (30-50cent);genpt;recopt/genpt", EndcapEta, ForwardEta),
0872                           log10PtBins,
0873                           log10PtMin,
0874                           log10PtMax,
0875                           0,
0876                           2,
0877                           " ");
0878   mPtRecoOverGen_GenPt_B_Cent_50_80 =
0879       ibooker.bookProfile("PtRecoOverGen_GenPt_B_Cent_50_80",
0880                           Form("|#eta|<%2.2f, (50-80cent);genpt;recopt/genpt", BarrelEta),
0881                           log10PtBins,
0882                           log10PtMin,
0883                           log10PtMax,
0884                           0,
0885                           2,
0886                           " ");
0887   mPtRecoOverGen_GenPt_E_Cent_50_80 =
0888       ibooker.bookProfile("PtRecoOverGen_GenPt_E_Cent_50_80",
0889                           Form("%2.2f<|#eta|<%2.2f, (50-80cent);genpt;recopt/genpt", BarrelEta, EndcapEta),
0890                           log10PtBins,
0891                           log10PtMin,
0892                           log10PtMax,
0893                           0,
0894                           2,
0895                           " ");
0896   mPtRecoOverGen_GenPt_F_Cent_50_80 =
0897       ibooker.bookProfile("PtRecoOverGen_GenPt_F_Cent_50_80",
0898                           Form("%2.2f<|#eta|<%2.2f, (50-80cent);genpt;recopt/genpt", EndcapEta, ForwardEta),
0899                           log10PtBins,
0900                           log10PtMin,
0901                           log10PtMax,
0902                           0,
0903                           2,
0904                           " ");
0905 
0906   mPtRecoOverGen_GenEta_20_30_Cent_0_10 = ibooker.bookProfile(
0907       "PtRecoOverGen_GenEta_20_30_Cent_0_10", "20<genpt<30 (0-10%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0908   mPtRecoOverGen_GenEta_30_50_Cent_0_10 = ibooker.bookProfile(
0909       "PtRecoOverGen_GenEta_30_50_Cent_0_10", "30<genpt<50 (0-10%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0910   mPtRecoOverGen_GenEta_50_80_Cent_0_10 = ibooker.bookProfile(
0911       "PtRecoOverGen_GenEta_50_80_Cent_0_10", "50<genpt<80 (0-10%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0912   mPtRecoOverGen_GenEta_80_120_Cent_0_10 = ibooker.bookProfile(
0913       "PtRecoOverGen_GenEta_80_120_Cent_0_10", "80<genpt<120 (0-10%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0914   mPtRecoOverGen_GenEta_120_180_Cent_0_10 = ibooker.bookProfile(
0915       "PtRecoOverGen_GenEta_120_180_Cent_0_10", "120<genpt<180 (0-10%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0916   mPtRecoOverGen_GenEta_180_300_Cent_0_10 = ibooker.bookProfile(
0917       "PtRecoOverGen_GenEta_180_300_Cent_0_10", "180<genpt<300 (0-10%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0918   mPtRecoOverGen_GenEta_300_Inf_Cent_0_10 = ibooker.bookProfile(
0919       "PtRecoOverGen_GenEta_300_Inf_Cent_0_10", "300<genpt<Inf (0-10%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0920 
0921   mPtRecoOverGen_GenEta_20_30_Cent_10_30 = ibooker.bookProfile(
0922       "PtRecoOverGen_GenEta_20_30_Cent_10_30", "20<genpt<30 (10-30%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0923   mPtRecoOverGen_GenEta_30_50_Cent_10_30 = ibooker.bookProfile(
0924       "PtRecoOverGen_GenEta_30_50_Cent_10_30", "30<genpt<50 (10-30%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0925   mPtRecoOverGen_GenEta_50_80_Cent_10_30 = ibooker.bookProfile(
0926       "PtRecoOverGen_GenEta_50_80_Cent_10_30", "50<genpt<80 (10-30%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0927   mPtRecoOverGen_GenEta_80_120_Cent_10_30 = ibooker.bookProfile(
0928       "PtRecoOverGen_GenEta_80_120_Cent_10_30", "80<genpt<120 (10-30%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0929   mPtRecoOverGen_GenEta_120_180_Cent_10_30 = ibooker.bookProfile(
0930       "PtRecoOverGen_GenEta_120_180_Cent_10_30", "120<genpt<180 (10-30%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0931   mPtRecoOverGen_GenEta_180_300_Cent_10_30 = ibooker.bookProfile(
0932       "PtRecoOverGen_GenEta_180_300_Cent_10_30", "180<genpt<300 (10-30%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0933   mPtRecoOverGen_GenEta_300_Inf_Cent_10_30 = ibooker.bookProfile(
0934       "PtRecoOverGen_GenEta_300_Inf_Cent_10_30", "300<genpt<Inf (10-30%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0935 
0936   mPtRecoOverGen_GenEta_20_30_Cent_30_50 = ibooker.bookProfile(
0937       "PtRecoOverGen_GenEta_20_30_Cent_30_50", "20<genpt<30 (30-50%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0938   mPtRecoOverGen_GenEta_30_50_Cent_30_50 = ibooker.bookProfile(
0939       "PtRecoOverGen_GenEta_30_50_Cent_30_50", "30<genpt<50 (30-50%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0940   mPtRecoOverGen_GenEta_50_80_Cent_30_50 = ibooker.bookProfile(
0941       "PtRecoOverGen_GenEta_50_80_Cent_30_50", "50<genpt<80 (30-50%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0942   mPtRecoOverGen_GenEta_80_120_Cent_30_50 = ibooker.bookProfile(
0943       "PtRecoOverGen_GenEta_80_120_Cent_30_50", "80<genpt<120 (30-50%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0944   mPtRecoOverGen_GenEta_120_180_Cent_30_50 = ibooker.bookProfile(
0945       "PtRecoOverGen_GenEta_120_180_Cent_30_50", "120<genpt<180 (30-50%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0946   mPtRecoOverGen_GenEta_180_300_Cent_30_50 = ibooker.bookProfile(
0947       "PtRecoOverGen_GenEta_180_300_Cent_30_50", "180<genpt<300 (30-50%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0948   mPtRecoOverGen_GenEta_300_Inf_Cent_30_50 = ibooker.bookProfile(
0949       "PtRecoOverGen_GenEta_300_Inf_Cent_30_50", "300<genpt<Inf (30-50%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0950 
0951   mPtRecoOverGen_GenEta_20_30_Cent_50_80 = ibooker.bookProfile(
0952       "PtRecoOverGen_GenEta_20_30_Cent_50_80", "20<genpt<30 (50-80%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0953   mPtRecoOverGen_GenEta_30_50_Cent_50_80 = ibooker.bookProfile(
0954       "PtRecoOverGen_GenEta_30_50_Cent_50_80", "30<genpt<50 (50-80%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0955   mPtRecoOverGen_GenEta_50_80_Cent_50_80 = ibooker.bookProfile(
0956       "PtRecoOverGen_GenEta_50_80_Cent_50_80", "50<genpt<80 (50-80%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0957   mPtRecoOverGen_GenEta_80_120_Cent_50_80 = ibooker.bookProfile(
0958       "PtRecoOverGen_GenEta_80_120_Cent_50_80", "80<genpt<120 (50-80%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0959   mPtRecoOverGen_GenEta_120_180_Cent_50_80 = ibooker.bookProfile(
0960       "PtRecoOverGen_GenEta_120_180_Cent_50_80", "120<genpt<180 (50-80%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0961   mPtRecoOverGen_GenEta_180_300_Cent_50_80 = ibooker.bookProfile(
0962       "PtRecoOverGen_GenEta_180_300_Cent_50_80", "180<genpt<300 (50-80%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0963   mPtRecoOverGen_GenEta_300_Inf_Cent_50_80 = ibooker.bookProfile(
0964       "PtRecoOverGen_GenEta_300_Inf_Cent_50_80", "300<genpt<Inf (50-80%);geneta;recopt/genpt", 90, etaRange, 0, 2, " ");
0965 
0966   if (mOutputFile.empty())
0967     LogInfo("OutputInfo") << " Histograms will NOT be saved";
0968   else
0969     LogInfo("OutputInfo") << " Histograms will be saved to file:" << mOutputFile;
0970 
0971   delete h2D_etabins_vs_pt2;
0972   delete h2D_etabins_vs_pt;
0973   delete h2D_etabins_vs_phi;
0974   delete h2D_pfcand_etabins_vs_pt;
0975 }
0976 
0977 //------------------------------------------------------------------------------
0978 // ~JetTester_HeavyIons
0979 //------------------------------------------------------------------------------
0980 JetTester_HeavyIons::~JetTester_HeavyIons() {}
0981 
0982 //------------------------------------------------------------------------------
0983 // beginJob
0984 //------------------------------------------------------------------------------
0985 // void JetTester_HeavyIons::beginJob() {
0986 //  //std::cout<<"inside the begin job function"<<endl;
0987 //}
0988 
0989 //------------------------------------------------------------------------------
0990 // endJob
0991 //------------------------------------------------------------------------------
0992 // void JetTester_HeavyIons::endJob()
0993 //{
0994 //  if (!mOutputFile.empty() && &*edm::Service<DQMStore>())
0995 //    {
0996 //      edm::Service<DQMStore>()->save(mOutputFile);
0997 //    }
0998 //}
0999 
1000 //------------------------------------------------------------------------------
1001 // analyze
1002 //------------------------------------------------------------------------------
1003 void JetTester_HeavyIons::analyze(const edm::Event &mEvent, const edm::EventSetup &mSetup) {
1004   // Get the primary vertices
1005   //----------------------------------------------------------------------------
1006   edm::Handle<vector<reco::Vertex>> pvHandle;
1007   mEvent.getByToken(pvToken_, pvHandle);
1008   reco::Vertex::Point vtx(0, 0, 0);
1009   edm::Handle<reco::VertexCollection> vtxs;
1010   // vtx = getVtx(mEvent);
1011 
1012   mEvent.getByToken(hiVertexToken_, vtxs);
1013   int greatestvtx = 0;
1014   int nVertex = vtxs->size();
1015 
1016   for (unsigned int i = 0; i < vtxs->size(); ++i) {
1017     unsigned int daughter = (*vtxs)[i].tracksSize();
1018     if (daughter > (*vtxs)[greatestvtx].tracksSize())
1019       greatestvtx = i;
1020   }
1021 
1022   if (nVertex <= 0) {
1023     vtx = reco::Vertex::Point(0, 0, 0);
1024   }
1025   vtx = (*vtxs)[greatestvtx].position();
1026 
1027   int nGoodVertices = 0;
1028 
1029   if (pvHandle.isValid()) {
1030     for (unsigned i = 0; i < pvHandle->size(); i++) {
1031       if ((*pvHandle)[i].ndof() > 4 && (fabs((*pvHandle)[i].z()) <= 24) && (fabs((*pvHandle)[i].position().rho()) <= 2))
1032         nGoodVertices++;
1033     }
1034   }
1035 
1036   mNvtx->Fill(nGoodVertices);
1037 
1038   // Get the Jet collection
1039   //----------------------------------------------------------------------------
1040   // math::XYZTLorentzVector p4tmp[2];
1041 
1042   std::vector<Jet> recoJets;
1043   recoJets.clear();
1044 
1045   edm::Handle<CaloJetCollection> caloJets;
1046   edm::Handle<JPTJetCollection> jptJets;
1047   edm::Handle<PFJetCollection> pfJets;
1048   edm::Handle<BasicJetCollection> basicJets;
1049 
1050   // Get the Particle flow candidates and the Voronoi variables
1051   edm::Handle<reco::PFCandidateCollection> pfCandidates;
1052   edm::Handle<CaloTowerCollection> caloCandidates;
1053   edm::Handle<reco::CandidateView> pfcandidates_;
1054   edm::Handle<reco::CandidateView> calocandidates_;
1055 
1056   // get the centrality
1057   edm::Handle<reco::Centrality> cent;
1058   mEvent.getByToken(centralityToken, cent);  //_centralitytag comes from the cfg
1059 
1060   mHF->Fill(cent->EtHFtowerSum());
1061   Float_t HF_energy = cent->EtHFtowerSum();
1062 
1063   edm::Handle<int> cbin;
1064   mEvent.getByToken(centralityBinToken, cbin);
1065   if (!cent.isValid())
1066     return;
1067 
1068   int hibin = -999;
1069   if (cbin.isValid()) {
1070     hibin = *cbin;
1071   }
1072   // else  edm::LogWarning("JetTester_HeavyIons") << "invalid collection:
1073   // centralityBin " << std::endl;
1074 
1075   bool isCentral = false;
1076   bool ismidCentral = false;
1077   bool ismidPeripheral = false;
1078   bool isPeripheral = false;
1079 
1080   if (hibin < 20)
1081     isCentral = true;
1082   if (hibin >= 20 && hibin < 60)
1083     ismidCentral = true;
1084   if (hibin >= 60 && hibin < 100)
1085     ismidPeripheral = true;
1086   if (hibin >= 100 && hibin < 160)
1087     isPeripheral = true;
1088 
1089   if (isCaloJet)
1090     mEvent.getByToken(caloJetsToken_, caloJets);
1091   if (isJPTJet)
1092     mEvent.getByToken(jptJetsToken_, jptJets);
1093   if (isPFJet) {
1094     if (std::string("Pu") == UEAlgo)
1095       mEvent.getByToken(basicJetsToken_, basicJets);
1096   }
1097 
1098   mEvent.getByToken(pfCandToken_, pfCandidates);
1099   mEvent.getByToken(pfCandViewToken_, pfcandidates_);
1100 
1101   mEvent.getByToken(caloTowersToken_, caloCandidates);
1102   mEvent.getByToken(caloCandViewToken_, calocandidates_);
1103 
1104   const reco::PFCandidateCollection *pfCandidateColl = pfCandidates.product();
1105 
1106   Int_t NPFpart = 0;
1107   Int_t NCaloTower = 0;
1108   Float_t pfPt = 0;
1109   Float_t pfEta = 0;
1110   Int_t pfID = 0;
1111   Float_t pfPhi = 0;
1112   Float_t caloPt = 0;
1113   Float_t caloEta = 0;
1114   Float_t caloPhi = 0;
1115   Float_t SumPt_value = 0;
1116 
1117   double edge_pseudorapidity[etaBins_ + 1] = {-5.191,
1118                                               -2.650,
1119                                               -2.043,
1120                                               -1.740,
1121                                               -1.479,
1122                                               -1.131,
1123                                               -0.783,
1124                                               -0.522,
1125                                               0.522,
1126                                               0.783,
1127                                               1.131,
1128                                               1.479,
1129                                               1.740,
1130                                               2.043,
1131                                               2.650,
1132                                               5.191};
1133 
1134   if (isCaloJet) {
1135     Float_t SumCaloPt[etaBins_];
1136     Float_t SumSquaredCaloPt[etaBins_];
1137 
1138     for (int i = 0; i < etaBins_; i++) {
1139       SumCaloPt[i] = 0;
1140       SumSquaredCaloPt[i] = 0;
1141     }
1142 
1143     for (unsigned icand = 0; icand < caloCandidates->size(); icand++) {
1144       const CaloTower &tower = (*caloCandidates)[icand];
1145       reco::CandidateViewRef ref(calocandidates_, icand);
1146       if (tower.p4(vtx).Et() < 0.1)
1147         continue;
1148 
1149       NCaloTower++;
1150 
1151       caloPt = tower.p4(vtx).Et();
1152       caloEta = tower.p4(vtx).Eta();
1153       caloPhi = tower.p4(vtx).Phi();
1154 
1155       for (size_t k = 0; k < nedge_pseudorapidity - 1; k++) {
1156         if (caloEta >= edge_pseudorapidity[k] && caloEta < edge_pseudorapidity[k + 1]) {
1157           SumCaloPt[k] = SumCaloPt[k] + caloPt;
1158           SumSquaredCaloPt[k] = SumSquaredCaloPt[k] + caloPt * caloPt;
1159         }  // eta selection statement
1160 
1161       }  // eta bin loop
1162 
1163       SumPt_value = SumPt_value + caloPt;
1164 
1165       mCaloPt->Fill(caloPt);
1166       mCaloEta->Fill(caloEta);
1167       mCaloPhi->Fill(caloPhi);
1168 
1169     }  // calo tower candidate  loop
1170 
1171     Float_t Evt_SumCaloPt = 0;
1172 
1173     Float_t Evt_SumSquaredCaloPt = 0;
1174 
1175     mSumCaloPt_n5p191_n2p650->Fill(SumCaloPt[0]);
1176     mSumCaloPt_n2p650_n2p043->Fill(SumCaloPt[1]);
1177     mSumCaloPt_n2p043_n1p740->Fill(SumCaloPt[2]);
1178     mSumCaloPt_n1p740_n1p479->Fill(SumCaloPt[3]);
1179     mSumCaloPt_n1p479_n1p131->Fill(SumCaloPt[4]);
1180     mSumCaloPt_n1p131_n0p783->Fill(SumCaloPt[5]);
1181     mSumCaloPt_n0p783_n0p522->Fill(SumCaloPt[6]);
1182     mSumCaloPt_n0p522_0p522->Fill(SumCaloPt[7]);
1183     mSumCaloPt_0p522_0p783->Fill(SumCaloPt[8]);
1184     mSumCaloPt_0p783_1p131->Fill(SumCaloPt[9]);
1185     mSumCaloPt_1p131_1p479->Fill(SumCaloPt[10]);
1186     mSumCaloPt_1p479_1p740->Fill(SumCaloPt[11]);
1187     mSumCaloPt_1p740_2p043->Fill(SumCaloPt[12]);
1188     mSumCaloPt_2p043_2p650->Fill(SumCaloPt[13]);
1189     mSumCaloPt_2p650_5p191->Fill(SumCaloPt[14]);
1190 
1191     for (size_t k = 0; k < nedge_pseudorapidity - 1; k++) {
1192       Evt_SumCaloPt = Evt_SumCaloPt + SumCaloPt[k];
1193 
1194       Evt_SumSquaredCaloPt = Evt_SumSquaredCaloPt + SumSquaredCaloPt[k];
1195 
1196     }  // eta bin loop
1197 
1198     mSumCaloPt->Fill(Evt_SumCaloPt);
1199 
1200     mSumSquaredCaloPt->Fill(Evt_SumSquaredCaloPt);
1201 
1202     mSumCaloPt_HF->Fill(Evt_SumCaloPt, HF_energy);
1203 
1204     mNCalopart->Fill(NCaloTower);
1205     mSumpt->Fill(SumPt_value);
1206 
1207   }  // is calo jet
1208 
1209   if (isPFJet) {
1210     Float_t SumPFPt[etaBins_];
1211 
1212     Float_t SumSquaredPFPt[etaBins_];
1213 
1214     for (int i = 0; i < etaBins_; i++) {
1215       SumPFPt[i] = 0;
1216       SumSquaredPFPt[i] = 0;
1217     }
1218 
1219     for (unsigned icand = 0; icand < pfCandidateColl->size(); icand++) {
1220       const reco::PFCandidate pfCandidate = pfCandidateColl->at(icand);
1221       reco::CandidateViewRef ref(pfcandidates_, icand);
1222 
1223       if (pfCandidate.pt() < 0.5)
1224         continue;
1225 
1226       NPFpart++;
1227       pfPt = pfCandidate.pt();
1228       pfEta = pfCandidate.eta();
1229       pfPhi = pfCandidate.phi();
1230       pfID = pfCandidate.particleId();
1231 
1232       bool inBarrel = false;
1233       bool inEndcap = false;
1234       bool inForward = false;
1235 
1236       if (fabs(pfEta) < BarrelEta)
1237         inBarrel = true;
1238       if (fabs(pfEta) >= BarrelEta && fabs(pfEta) < EndcapEta)
1239         inEndcap = true;
1240       if (fabs(pfEta) >= EndcapEta && fabs(pfEta) < ForwardEta)
1241         inForward = true;
1242 
1243       switch (pfID) {
1244         case 0:
1245           mPFCandpT_vs_eta_Unknown->Fill(pfPt, pfEta);
1246           if (inBarrel)
1247             mPFCandpT_Barrel_Unknown->Fill(pfPt);
1248           if (inEndcap)
1249             mPFCandpT_Endcap_Unknown->Fill(pfPt);
1250           if (inForward)
1251             mPFCandpT_Forward_Unknown->Fill(pfPt);
1252           break;
1253         case 1:
1254           mPFCandpT_vs_eta_ChargedHadron->Fill(pfPt, pfEta);
1255           if (inBarrel)
1256             mPFCandpT_Barrel_ChargedHadron->Fill(pfPt);
1257           if (inEndcap)
1258             mPFCandpT_Endcap_ChargedHadron->Fill(pfPt);
1259           if (inForward)
1260             mPFCandpT_Forward_ChargedHadron->Fill(pfPt);
1261           break;
1262         case 2:
1263           mPFCandpT_vs_eta_electron->Fill(pfPt, pfEta);
1264           if (inBarrel)
1265             mPFCandpT_Barrel_electron->Fill(pfPt);
1266           if (inEndcap)
1267             mPFCandpT_Endcap_electron->Fill(pfPt);
1268           if (inForward)
1269             mPFCandpT_Forward_electron->Fill(pfPt);
1270           break;
1271         case 3:
1272           mPFCandpT_vs_eta_muon->Fill(pfPt, pfEta);
1273           if (inBarrel)
1274             mPFCandpT_Barrel_muon->Fill(pfPt);
1275           if (inEndcap)
1276             mPFCandpT_Endcap_muon->Fill(pfPt);
1277           if (inForward)
1278             mPFCandpT_Forward_muon->Fill(pfPt);
1279           break;
1280         case 4:
1281           mPFCandpT_vs_eta_photon->Fill(pfPt, pfEta);
1282           if (inBarrel)
1283             mPFCandpT_Barrel_photon->Fill(pfPt);
1284           if (inEndcap)
1285             mPFCandpT_Endcap_photon->Fill(pfPt);
1286           if (inForward)
1287             mPFCandpT_Forward_photon->Fill(pfPt);
1288           break;
1289         case 5:
1290           mPFCandpT_vs_eta_NeutralHadron->Fill(pfPt, pfEta);
1291           if (inBarrel)
1292             mPFCandpT_Barrel_NeutralHadron->Fill(pfPt);
1293           if (inEndcap)
1294             mPFCandpT_Endcap_NeutralHadron->Fill(pfPt);
1295           if (inForward)
1296             mPFCandpT_Forward_NeutralHadron->Fill(pfPt);
1297           break;
1298         case 6:
1299           mPFCandpT_vs_eta_HadE_inHF->Fill(pfPt, pfEta);
1300           if (inBarrel)
1301             mPFCandpT_Barrel_HadE_inHF->Fill(pfPt);
1302           if (inEndcap)
1303             mPFCandpT_Endcap_HadE_inHF->Fill(pfPt);
1304           if (inForward)
1305             mPFCandpT_Forward_HadE_inHF->Fill(pfPt);
1306           break;
1307         case 7:
1308           mPFCandpT_vs_eta_EME_inHF->Fill(pfPt, pfEta);
1309           if (inBarrel)
1310             mPFCandpT_Barrel_EME_inHF->Fill(pfPt);
1311           if (inEndcap)
1312             mPFCandpT_Endcap_EME_inHF->Fill(pfPt);
1313           if (inForward)
1314             mPFCandpT_Forward_EME_inHF->Fill(pfPt);
1315       }
1316 
1317       for (size_t k = 0; k < nedge_pseudorapidity - 1; k++) {
1318         if (pfEta >= edge_pseudorapidity[k] && pfEta < edge_pseudorapidity[k + 1]) {
1319           SumPFPt[k] = SumPFPt[k] + pfPt;
1320 
1321           SumSquaredPFPt[k] = SumSquaredPFPt[k] + pfPt * pfPt;
1322 
1323         }  // eta selection statement
1324 
1325       }  // eta bin loop
1326 
1327       SumPt_value = SumPt_value + pfPt;
1328 
1329       mPFPt->Fill(pfPt);
1330       mPFEta->Fill(pfEta);
1331       mPFPhi->Fill(pfPhi);
1332 
1333     }  // pf candidate loop
1334 
1335     Float_t Evt_SumPFPt = 0;
1336 
1337     Float_t Evt_SumSquaredPFPt = 0;
1338 
1339     mSumPFPt_n5p191_n2p650->Fill(SumPFPt[0]);
1340     mSumPFPt_n2p650_n2p043->Fill(SumPFPt[1]);
1341     mSumPFPt_n2p043_n1p740->Fill(SumPFPt[2]);
1342     mSumPFPt_n1p740_n1p479->Fill(SumPFPt[3]);
1343     mSumPFPt_n1p479_n1p131->Fill(SumPFPt[4]);
1344     mSumPFPt_n1p131_n0p783->Fill(SumPFPt[5]);
1345     mSumPFPt_n0p783_n0p522->Fill(SumPFPt[6]);
1346     mSumPFPt_n0p522_0p522->Fill(SumPFPt[7]);
1347     mSumPFPt_0p522_0p783->Fill(SumPFPt[8]);
1348     mSumPFPt_0p783_1p131->Fill(SumPFPt[9]);
1349     mSumPFPt_1p131_1p479->Fill(SumPFPt[10]);
1350     mSumPFPt_1p479_1p740->Fill(SumPFPt[11]);
1351     mSumPFPt_1p740_2p043->Fill(SumPFPt[12]);
1352     mSumPFPt_2p043_2p650->Fill(SumPFPt[13]);
1353     mSumPFPt_2p650_5p191->Fill(SumPFPt[14]);
1354 
1355     for (size_t k = 0; k < nedge_pseudorapidity - 1; k++) {
1356       Evt_SumPFPt = Evt_SumPFPt + SumPFPt[k];
1357 
1358       Evt_SumSquaredPFPt = Evt_SumSquaredPFPt + SumSquaredPFPt[k];
1359 
1360     }  // eta bin loop
1361 
1362     mSumPFPt->Fill(Evt_SumPFPt);
1363 
1364     mSumSquaredPFPt->Fill(Evt_SumSquaredPFPt);
1365 
1366     mSumPFPt_HF->Fill(Evt_SumPFPt, HF_energy);
1367 
1368     mNPFpart->Fill(NPFpart);
1369     mSumpt->Fill(SumPt_value);
1370   }
1371 
1372   if (isCaloJet) {
1373     for (unsigned ijet = 0; ijet < caloJets->size(); ijet++)
1374       recoJets.push_back((*caloJets)[ijet]);
1375   }
1376 
1377   if (isJPTJet) {
1378     for (unsigned ijet = 0; ijet < jptJets->size(); ijet++)
1379       recoJets.push_back((*jptJets)[ijet]);
1380   }
1381 
1382   if (isPFJet) {
1383     if (std::string("Pu") == UEAlgo) {
1384       for (unsigned ijet = 0; ijet < basicJets->size(); ijet++)
1385         recoJets.push_back((*basicJets)[ijet]);
1386     }
1387   }
1388 
1389   if (isCaloJet && !caloJets.isValid())
1390     return;
1391   if (isJPTJet && !jptJets.isValid())
1392     return;
1393   if (isPFJet) {
1394     if (std::string("Pu") == UEAlgo) {
1395       if (!basicJets.isValid())
1396         return;
1397     }
1398   }
1399 
1400   int nJet_40 = 0;
1401 
1402   mNJets->Fill(recoJets.size());
1403 
1404   for (unsigned ijet = 0; ijet < recoJets.size(); ijet++) {
1405     if (recoJets[ijet].pt() > mRecoJetPtThreshold) {
1406       // counting forward and barrel jets
1407       // get an idea of no of jets with pT>40 GeV
1408       if (recoJets[ijet].pt() > 40)
1409         nJet_40++;
1410 
1411       if (mEta)
1412         mEta->Fill(recoJets[ijet].eta());
1413       if (mjetpileup)
1414         mjetpileup->Fill(recoJets[ijet].pileup());
1415       if (mJetArea)
1416         mJetArea->Fill(recoJets[ijet].jetArea());
1417       if (mPhi)
1418         mPhi->Fill(recoJets[ijet].phi());
1419       if (mEnergy)
1420         mEnergy->Fill(recoJets[ijet].energy());
1421       if (mP)
1422         mP->Fill(recoJets[ijet].p());
1423       if (mPt)
1424         mPt->Fill(recoJets[ijet].pt());
1425       if (mMass)
1426         mMass->Fill(recoJets[ijet].mass());
1427       if (mConstituents)
1428         mConstituents->Fill(recoJets[ijet].nConstituents());
1429     }
1430   }
1431 
1432   if (mNJets_40)
1433     mNJets_40->Fill(nJet_40);
1434 
1435   // Gen level information:
1436   if (!mEvent.isRealData()) {
1437     // Get ptHat
1438     //------------------------------------------------------------------------
1439     edm::Handle<GenEventInfoProduct> myGenEvt;
1440     mEvent.getByToken(evtToken_, myGenEvt);
1441 
1442     if (myGenEvt.isValid()) {
1443       if (myGenEvt->hasBinningValues()) {
1444         double ptHat = myGenEvt->binningValues()[0];
1445         if (mPtHat)
1446           mPtHat->Fill(ptHat);
1447       }
1448     }
1449     // Gen jets
1450     //------------------------------------------------------------------------
1451     edm::Handle<GenJetCollection> genJets;
1452     mEvent.getByToken(genJetsToken_, genJets);
1453 
1454     if (!genJets.isValid())
1455       return;
1456 
1457     for (GenJetCollection::const_iterator gjet = genJets->begin(); gjet != genJets->end(); gjet++) {
1458       if (gjet->pt() > mMatchGenPtThreshold) {
1459         if (mGenEta)
1460           mGenEta->Fill(gjet->eta());
1461         if (mGenPhi)
1462           mGenPhi->Fill(gjet->phi());
1463         if (mGenPt)
1464           mGenPt->Fill(gjet->pt());
1465       }
1466     }
1467 
1468     if (!(mInputGenCollection.label().empty())) {
1469       for (GenJetCollection::const_iterator gjet = genJets->begin(); gjet != genJets->end(); gjet++) {
1470         if (fabs(gjet->eta()) > 6.)
1471           continue;  // Out of the detector
1472         if (gjet->pt() < mMatchGenPtThreshold)
1473           continue;
1474         if (recoJets.empty())
1475           continue;
1476 
1477         bool inBarrel = false;
1478         bool inEndcap = false;
1479         bool inForward = false;
1480 
1481         if (fabs(gjet->eta()) < BarrelEta)
1482           inBarrel = true;
1483         if (fabs(gjet->eta()) >= BarrelEta && fabs(gjet->eta()) < EndcapEta)
1484           inEndcap = true;
1485         if (fabs(gjet->eta()) >= EndcapEta && fabs(gjet->eta()) < ForwardEta)
1486           inForward = true;
1487 
1488         // pt response
1489         //------------------------------------------------------------
1490         int iMatch = -1;
1491         double deltaRBest = 999;
1492         double JetPtBest = 0;
1493         for (unsigned ijet = 0; ijet < recoJets.size(); ++ijet) {
1494           double recoPt = recoJets[ijet].pt();
1495           if (recoPt > 10) {
1496             double delR = deltaR(gjet->eta(), gjet->phi(), recoJets[ijet].eta(), recoJets[ijet].phi());
1497             if (delR < deltaRBest) {
1498               deltaRBest = delR;
1499               JetPtBest = recoPt;
1500               iMatch = ijet;
1501             }
1502           }
1503         }
1504         if (iMatch < 0)
1505           continue;
1506 
1507         // fillMatchHists(gjet->eta(),  gjet->phi(),  gjet->pt(),
1508         // recoJets[iMatch].eta(), recoJets[iMatch].phi(),
1509         // recoJets[iMatch].pt(), hibin);
1510         if (deltaRBest < mRThreshold) {
1511           double genpt = gjet->pt();
1512           double geneta = gjet->eta();
1513           double response = JetPtBest / genpt;
1514           // Fill all the response histograms here: for each pT bin, eta region,
1515           // centrality bin
1516 
1517           if (inBarrel) {
1518             if (isCentral)
1519               mPtRecoOverGen_GenPt_B_Cent_0_10->Fill(log10(genpt), response);
1520             if (ismidCentral)
1521               mPtRecoOverGen_GenPt_B_Cent_10_30->Fill(log10(genpt), response);
1522             if (ismidPeripheral)
1523               mPtRecoOverGen_GenPt_B_Cent_30_50->Fill(log10(genpt), response);
1524             if (isPeripheral)
1525               mPtRecoOverGen_GenPt_B_Cent_50_80->Fill(log10(genpt), response);
1526           }
1527           if (inEndcap) {
1528             if (isCentral)
1529               mPtRecoOverGen_GenPt_E_Cent_0_10->Fill(log10(genpt), response);
1530             if (ismidCentral)
1531               mPtRecoOverGen_GenPt_E_Cent_10_30->Fill(log10(genpt), response);
1532             if (ismidPeripheral)
1533               mPtRecoOverGen_GenPt_E_Cent_30_50->Fill(log10(genpt), response);
1534             if (isPeripheral)
1535               mPtRecoOverGen_GenPt_E_Cent_50_80->Fill(log10(genpt), response);
1536           }
1537           if (inForward) {
1538             if (isCentral)
1539               mPtRecoOverGen_GenPt_F_Cent_0_10->Fill(log10(genpt), response);
1540             if (ismidCentral)
1541               mPtRecoOverGen_GenPt_F_Cent_10_30->Fill(log10(genpt), response);
1542             if (ismidPeripheral)
1543               mPtRecoOverGen_GenPt_F_Cent_30_50->Fill(log10(genpt), response);
1544             if (isPeripheral)
1545               mPtRecoOverGen_GenPt_F_Cent_50_80->Fill(log10(genpt), response);
1546           }
1547 
1548           if (gjet->pt() >= 20 && gjet->pt() < 30) {
1549             if (isCentral) {
1550               mPtRecoOverGen_GenEta_20_30_Cent_0_10->Fill(geneta, response);
1551               if (inBarrel)
1552                 mPtRecoOverGen_B_20_30_Cent_0_10->Fill(response);
1553               if (inEndcap)
1554                 mPtRecoOverGen_E_20_30_Cent_0_10->Fill(response);
1555               if (inForward)
1556                 mPtRecoOverGen_F_20_30_Cent_0_10->Fill(response);
1557             }  //
1558             if (ismidCentral) {
1559               mPtRecoOverGen_GenEta_20_30_Cent_10_30->Fill(geneta, response);
1560               if (inBarrel)
1561                 mPtRecoOverGen_B_20_30_Cent_10_30->Fill(response);
1562               if (inEndcap)
1563                 mPtRecoOverGen_E_20_30_Cent_10_30->Fill(response);
1564               if (inForward)
1565                 mPtRecoOverGen_F_20_30_Cent_10_30->Fill(response);
1566             }  //
1567             if (ismidPeripheral) {
1568               mPtRecoOverGen_GenEta_20_30_Cent_30_50->Fill(geneta, response);
1569               if (inBarrel)
1570                 mPtRecoOverGen_B_20_30_Cent_30_50->Fill(response);
1571               if (inEndcap)
1572                 mPtRecoOverGen_E_20_30_Cent_30_50->Fill(response);
1573               if (inForward)
1574                 mPtRecoOverGen_F_20_30_Cent_30_50->Fill(response);
1575             }  //
1576             if (isPeripheral) {
1577               mPtRecoOverGen_GenEta_20_30_Cent_50_80->Fill(geneta, response);
1578               if (inBarrel)
1579                 mPtRecoOverGen_B_20_30_Cent_50_80->Fill(response);
1580               if (inEndcap)
1581                 mPtRecoOverGen_E_20_30_Cent_50_80->Fill(response);
1582               if (inForward)
1583                 mPtRecoOverGen_F_20_30_Cent_50_80->Fill(response);
1584             }  //
1585           }  // pt bin 20-30
1586 
1587           if (gjet->pt() >= 30 && gjet->pt() < 50) {
1588             if (isCentral) {
1589               mPtRecoOverGen_GenEta_30_50_Cent_0_10->Fill(geneta, response);
1590               if (inBarrel)
1591                 mPtRecoOverGen_B_30_50_Cent_0_10->Fill(response);
1592               if (inEndcap)
1593                 mPtRecoOverGen_E_30_50_Cent_0_10->Fill(response);
1594               if (inForward)
1595                 mPtRecoOverGen_F_30_50_Cent_0_10->Fill(response);
1596             }  //
1597             if (ismidCentral) {
1598               mPtRecoOverGen_GenEta_30_50_Cent_10_30->Fill(geneta, response);
1599               if (inBarrel)
1600                 mPtRecoOverGen_B_30_50_Cent_10_30->Fill(response);
1601               if (inEndcap)
1602                 mPtRecoOverGen_E_30_50_Cent_10_30->Fill(response);
1603               if (inForward)
1604                 mPtRecoOverGen_F_30_50_Cent_10_30->Fill(response);
1605             }  //
1606             if (ismidPeripheral) {
1607               mPtRecoOverGen_GenEta_30_50_Cent_30_50->Fill(geneta, response);
1608               if (inBarrel)
1609                 mPtRecoOverGen_B_30_50_Cent_30_50->Fill(response);
1610               if (inEndcap)
1611                 mPtRecoOverGen_E_30_50_Cent_30_50->Fill(response);
1612               if (inForward)
1613                 mPtRecoOverGen_F_30_50_Cent_30_50->Fill(response);
1614             }  //
1615             if (isPeripheral) {
1616               mPtRecoOverGen_GenEta_30_50_Cent_50_80->Fill(geneta, response);
1617               if (inBarrel)
1618                 mPtRecoOverGen_B_30_50_Cent_50_80->Fill(response);
1619               if (inEndcap)
1620                 mPtRecoOverGen_E_30_50_Cent_50_80->Fill(response);
1621               if (inForward)
1622                 mPtRecoOverGen_F_30_50_Cent_50_80->Fill(response);
1623             }  //
1624           }  // pt bin 30-50
1625 
1626           if (gjet->pt() >= 50 && gjet->pt() < 80) {
1627             if (isCentral) {
1628               mPtRecoOverGen_GenEta_50_80_Cent_0_10->Fill(geneta, response);
1629               if (inBarrel)
1630                 mPtRecoOverGen_B_50_80_Cent_0_10->Fill(response);
1631               if (inEndcap)
1632                 mPtRecoOverGen_E_50_80_Cent_0_10->Fill(response);
1633               if (inForward)
1634                 mPtRecoOverGen_F_50_80_Cent_0_10->Fill(response);
1635             }  //
1636             if (ismidCentral) {
1637               mPtRecoOverGen_GenEta_50_80_Cent_10_30->Fill(geneta, response);
1638               if (inBarrel)
1639                 mPtRecoOverGen_B_50_80_Cent_10_30->Fill(response);
1640               if (inEndcap)
1641                 mPtRecoOverGen_E_50_80_Cent_10_30->Fill(response);
1642               if (inForward)
1643                 mPtRecoOverGen_F_50_80_Cent_10_30->Fill(response);
1644             }  //
1645             if (ismidPeripheral) {
1646               mPtRecoOverGen_GenEta_50_80_Cent_30_50->Fill(geneta, response);
1647               if (inBarrel)
1648                 mPtRecoOverGen_B_50_80_Cent_30_50->Fill(response);
1649               if (inEndcap)
1650                 mPtRecoOverGen_E_50_80_Cent_30_50->Fill(response);
1651               if (inForward)
1652                 mPtRecoOverGen_F_50_80_Cent_30_50->Fill(response);
1653             }  //
1654             if (isPeripheral) {
1655               mPtRecoOverGen_GenEta_50_80_Cent_50_80->Fill(geneta, response);
1656               if (inBarrel)
1657                 mPtRecoOverGen_B_50_80_Cent_50_80->Fill(response);
1658               if (inEndcap)
1659                 mPtRecoOverGen_E_50_80_Cent_50_80->Fill(response);
1660               if (inForward)
1661                 mPtRecoOverGen_F_50_80_Cent_50_80->Fill(response);
1662             }  //
1663           }  // pt bin 50-80
1664 
1665           if (gjet->pt() >= 80 && gjet->pt() < 120) {
1666             if (isCentral) {
1667               mPtRecoOverGen_GenEta_80_120_Cent_0_10->Fill(geneta, response);
1668               if (inBarrel)
1669                 mPtRecoOverGen_B_80_120_Cent_0_10->Fill(response);
1670               if (inEndcap)
1671                 mPtRecoOverGen_E_80_120_Cent_0_10->Fill(response);
1672               if (inForward)
1673                 mPtRecoOverGen_F_80_120_Cent_0_10->Fill(response);
1674             }  //
1675             if (ismidCentral) {
1676               mPtRecoOverGen_GenEta_80_120_Cent_10_30->Fill(geneta, response);
1677               if (inBarrel)
1678                 mPtRecoOverGen_B_80_120_Cent_10_30->Fill(response);
1679               if (inEndcap)
1680                 mPtRecoOverGen_E_80_120_Cent_10_30->Fill(response);
1681               if (inForward)
1682                 mPtRecoOverGen_F_80_120_Cent_10_30->Fill(response);
1683             }  //
1684             if (ismidPeripheral) {
1685               mPtRecoOverGen_GenEta_80_120_Cent_30_50->Fill(geneta, response);
1686               if (inBarrel)
1687                 mPtRecoOverGen_B_80_120_Cent_30_50->Fill(response);
1688               if (inEndcap)
1689                 mPtRecoOverGen_E_80_120_Cent_30_50->Fill(response);
1690               if (inForward)
1691                 mPtRecoOverGen_F_80_120_Cent_30_50->Fill(response);
1692             }  //
1693             if (isPeripheral) {
1694               mPtRecoOverGen_GenEta_80_120_Cent_50_80->Fill(geneta, response);
1695               if (inBarrel)
1696                 mPtRecoOverGen_B_80_120_Cent_50_80->Fill(response);
1697               if (inEndcap)
1698                 mPtRecoOverGen_E_80_120_Cent_50_80->Fill(response);
1699               if (inForward)
1700                 mPtRecoOverGen_F_80_120_Cent_50_80->Fill(response);
1701             }  //
1702           }  // pt bin 80-120
1703 
1704           if (gjet->pt() >= 120 && gjet->pt() < 180) {
1705             if (isCentral) {
1706               mPtRecoOverGen_GenEta_120_180_Cent_0_10->Fill(geneta, response);
1707               if (inBarrel)
1708                 mPtRecoOverGen_B_120_180_Cent_0_10->Fill(response);
1709               if (inEndcap)
1710                 mPtRecoOverGen_E_120_180_Cent_0_10->Fill(response);
1711               if (inForward)
1712                 mPtRecoOverGen_F_120_180_Cent_0_10->Fill(response);
1713             }  //
1714             if (ismidCentral) {
1715               mPtRecoOverGen_GenEta_120_180_Cent_10_30->Fill(geneta, response);
1716               if (inBarrel)
1717                 mPtRecoOverGen_B_120_180_Cent_10_30->Fill(response);
1718               if (inEndcap)
1719                 mPtRecoOverGen_E_120_180_Cent_10_30->Fill(response);
1720               if (inForward)
1721                 mPtRecoOverGen_F_120_180_Cent_10_30->Fill(response);
1722             }  //
1723             if (ismidPeripheral) {
1724               mPtRecoOverGen_GenEta_120_180_Cent_30_50->Fill(geneta, response);
1725               if (inBarrel)
1726                 mPtRecoOverGen_B_120_180_Cent_30_50->Fill(response);
1727               if (inEndcap)
1728                 mPtRecoOverGen_E_120_180_Cent_30_50->Fill(response);
1729               if (inForward)
1730                 mPtRecoOverGen_F_120_180_Cent_30_50->Fill(response);
1731             }  //
1732             if (isPeripheral) {
1733               mPtRecoOverGen_GenEta_120_180_Cent_50_80->Fill(geneta, response);
1734               if (inBarrel)
1735                 mPtRecoOverGen_B_120_180_Cent_50_80->Fill(response);
1736               if (inEndcap)
1737                 mPtRecoOverGen_E_120_180_Cent_50_80->Fill(response);
1738               if (inForward)
1739                 mPtRecoOverGen_F_120_180_Cent_50_80->Fill(response);
1740             }  //
1741           }  // pt bin 120-180
1742 
1743           if (gjet->pt() >= 180 && gjet->pt() < 300) {
1744             if (isCentral) {
1745               mPtRecoOverGen_GenEta_180_300_Cent_0_10->Fill(geneta, response);
1746               if (inBarrel)
1747                 mPtRecoOverGen_B_180_300_Cent_0_10->Fill(response);
1748               if (inEndcap)
1749                 mPtRecoOverGen_E_180_300_Cent_0_10->Fill(response);
1750               if (inForward)
1751                 mPtRecoOverGen_F_180_300_Cent_0_10->Fill(response);
1752             }  //
1753             if (ismidCentral) {
1754               mPtRecoOverGen_GenEta_180_300_Cent_10_30->Fill(geneta, response);
1755               if (inBarrel)
1756                 mPtRecoOverGen_B_180_300_Cent_10_30->Fill(response);
1757               if (inEndcap)
1758                 mPtRecoOverGen_E_180_300_Cent_10_30->Fill(response);
1759               if (inForward)
1760                 mPtRecoOverGen_F_180_300_Cent_10_30->Fill(response);
1761             }  //
1762             if (ismidPeripheral) {
1763               mPtRecoOverGen_GenEta_180_300_Cent_30_50->Fill(geneta, response);
1764               if (inBarrel)
1765                 mPtRecoOverGen_B_180_300_Cent_30_50->Fill(response);
1766               if (inEndcap)
1767                 mPtRecoOverGen_E_180_300_Cent_30_50->Fill(response);
1768               if (inForward)
1769                 mPtRecoOverGen_F_180_300_Cent_30_50->Fill(response);
1770             }  //
1771             if (isPeripheral) {
1772               mPtRecoOverGen_GenEta_180_300_Cent_50_80->Fill(geneta, response);
1773               if (inBarrel)
1774                 mPtRecoOverGen_B_180_300_Cent_50_80->Fill(response);
1775               if (inEndcap)
1776                 mPtRecoOverGen_E_180_300_Cent_50_80->Fill(response);
1777               if (inForward)
1778                 mPtRecoOverGen_F_180_300_Cent_50_80->Fill(response);
1779             }  //
1780           }  // pt bin 180-300
1781 
1782           if (gjet->pt() >= 300) {
1783             if (isCentral) {
1784               mPtRecoOverGen_GenEta_300_Inf_Cent_0_10->Fill(geneta, response);
1785               if (inBarrel)
1786                 mPtRecoOverGen_B_300_Inf_Cent_0_10->Fill(response);
1787               if (inEndcap)
1788                 mPtRecoOverGen_E_300_Inf_Cent_0_10->Fill(response);
1789               if (inForward)
1790                 mPtRecoOverGen_F_300_Inf_Cent_0_10->Fill(response);
1791             }  //
1792             if (ismidCentral) {
1793               mPtRecoOverGen_GenEta_300_Inf_Cent_10_30->Fill(geneta, response);
1794               if (inBarrel)
1795                 mPtRecoOverGen_B_300_Inf_Cent_10_30->Fill(response);
1796               if (inEndcap)
1797                 mPtRecoOverGen_E_300_Inf_Cent_10_30->Fill(response);
1798               if (inForward)
1799                 mPtRecoOverGen_F_300_Inf_Cent_10_30->Fill(response);
1800             }  //
1801             if (ismidPeripheral) {
1802               mPtRecoOverGen_GenEta_300_Inf_Cent_30_50->Fill(geneta, response);
1803               if (inBarrel)
1804                 mPtRecoOverGen_B_300_Inf_Cent_30_50->Fill(response);
1805               if (inEndcap)
1806                 mPtRecoOverGen_E_300_Inf_Cent_30_50->Fill(response);
1807               if (inForward)
1808                 mPtRecoOverGen_F_300_Inf_Cent_30_50->Fill(response);
1809             }  //
1810             if (isPeripheral) {
1811               mPtRecoOverGen_GenEta_300_Inf_Cent_50_80->Fill(geneta, response);
1812               if (inBarrel)
1813                 mPtRecoOverGen_B_300_Inf_Cent_50_80->Fill(response);
1814               if (inEndcap)
1815                 mPtRecoOverGen_E_300_Inf_Cent_50_80->Fill(response);
1816               if (inForward)
1817                 mPtRecoOverGen_F_300_Inf_Cent_50_80->Fill(response);
1818             }  //
1819           }  // pt bin 300-Inf
1820 
1821         }  // delta R < mRthreshold
1822 
1823       }  // gen jet collection loop
1824 
1825     }  // not empty gen collection
1826 
1827   }  // is the event real
1828 }