From af5cb7b7dd7ec9a26d585439d45b7d3b29f8ffac Mon Sep 17 00:00:00 2001 From: Alejandro Gomez Espinosa Date: Wed, 19 Jun 2019 11:57:21 +0200 Subject: [PATCH 1/9] fix problem with data and subjets --- plugins/JetTester.cc | 2315 +++++++++++++++++--------------------- python/jetToolbox_cff.py | 105 +- test/jettoolbox_cfg.py | 46 +- 3 files changed, 1138 insertions(+), 1328 deletions(-) diff --git a/plugins/JetTester.cc b/plugins/JetTester.cc index 32a689439d4..b38b1029c62 100644 --- a/plugins/JetTester.cc +++ b/plugins/JetTester.cc @@ -67,237 +67,318 @@ class JetTester : public edm::EDAnalyzer { //virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; // ----------member data --------------------------- - edm::EDGetTokenT ak4jetMiniToken_; - edm::EDGetTokenT ak8jetMiniToken_; - edm::EDGetTokenT puppijetMiniToken_; + edm::EDGetTokenT ak4PFCHSminiAODjetToken_; + edm::EDGetTokenT ak4PFPuppiminiAODjetToken_; + edm::EDGetTokenT ak4PFCHSUpdatedjetToken_; edm::EDGetTokenT ak4PFCHSjetToken_; - edm::EDGetTokenT ak8PFjetToken_; + edm::EDGetTokenT ak4PFPuppijetToken_; + edm::EDGetTokenT ak4PFjetToken_; + edm::EDGetTokenT ak8PFPuppiminiAODjetToken_; + edm::EDGetTokenT ak8PFPuppiUpdatedjetToken_; + edm::EDGetTokenT ak8PFPuppijetToken_; + edm::EDGetTokenT ak8PFCHSjetToken_; edm::EDGetTokenT ca8PFCHSjetToken_; edm::EDGetTokenT kt8PFCHSjetToken_; edm::EDGetTokenT ak8PFPUPPIjetToken_; - edm::EDGetTokenT ak12PFCHSjetToken_; + edm::EDGetTokenT ak8PFPuppimodSDjetToken_; + edm::EDGetTokenT ak8PFSKjetToken_; + edm::EDGetTokenT ak8PFCSjetToken_; + edm::EDGetTokenT ca12PFCHSjetToken_; edm::EDGetTokenT ak15PFCHSjetToken_; - edm::EDGetTokenT ak4PFCHSSoftDropSubjetsToken_; - edm::EDGetTokenT ak8PFSoftDropSubjetsToken_; - edm::EDGetTokenT ak8PFCHSSoftDropSubjetsToken_; - edm::EDGetTokenT ca8PFCHSSoftDropSubjetsToken_; - edm::EDGetTokenT kt8PFCHSSoftDropSubjetsToken_; - edm::EDGetTokenT ak8PFPUPPISoftDropSubjetsToken_; - edm::EDGetTokenT ak12PFCHSSoftDropSubjetsToken_; - edm::EDGetTokenT ak15PFCHSSoftDropSubjetsToken_; - edm::EDGetTokenT puppijetToken_; - edm::EDGetTokenT ak4genjetToken_; - edm::EDGetTokenT ak8genjetToken_; + //edm::EDGetTokenT ak4genjetToken_; + //edm::EDGetTokenT ak8genjetToken_; edm::EDGetTokenT > prunedGenToken_; edm::EDGetTokenT rhoToken_; edm::EDGetTokenT > vtxToken_; - TH1D * h_ak4chs_pt ; - TH1D * h_ak4chs_mass ; - TH1D * h_ak4chs_rapidity ; - TH1D * h_ak4chs_prunedMass ; - TH1D * h_ak4chs_trimmedMass ; - TH1D * h_ak4chs_filteredMass ; - TH1D * h_ak4chs_softDropMass ; - TH1D * h_ak4chs_tau1 ; - TH1D * h_ak4chs_tau2 ; - TH1D * h_ak4chs_tau3 ; - TH1D * h_ak4chs_tau4 ; - TH1D * h_ak4chs_tau32 ; - TH1D * h_ak4chs_tau21 ; - TH1D * h_ak4chs_ndau ; - TH1D * h_ak4chs_subjetMass ; + TH1D * h_ak4chsminiAOD_pt ; + TH1D * h_ak4chsminiAOD_uncpt ; + TH1D * h_ak4chsminiAOD_eta ; + TH1D * h_ak4chsminiAOD_btagCSVv2 ; + TH1D * h_ak4chsminiAOD_area ; + TH1D * h_ak4chsminiAOD_nhf ; + TH1D * h_ak4chsminiAOD_nemf ; + TH1D * h_ak4chsminiAOD_chf ; + TH1D * h_ak4chsminiAOD_muf ; + TH1D * h_ak4chsminiAOD_cemf ; + TH1D * h_ak4chsminiAOD_numConst ; + TH1D * h_ak4chsminiAOD_numNeuPar ; + TH1D * h_ak4chsminiAOD_chm ; + TH1D * h_ak4puppiminiAOD_pt ; + TH1D * h_ak4puppiminiAOD_uncpt ; + TH1D * h_ak4puppiminiAOD_eta ; + TH1D * h_ak4puppiminiAOD_btagCSVv2 ; + TH1D * h_ak4puppiminiAOD_area ; + TH1D * h_ak4puppiminiAOD_nhf ; + TH1D * h_ak4puppiminiAOD_nemf ; + TH1D * h_ak4puppiminiAOD_chf ; + TH1D * h_ak4puppiminiAOD_muf ; + TH1D * h_ak4puppiminiAOD_cemf ; + TH1D * h_ak4puppiminiAOD_numConst ; + TH1D * h_ak4puppiminiAOD_numNeuPar ; + TH1D * h_ak4puppiminiAOD_chm ; + TH1D * h_ak4chsupdated_pt ; + TH1D * h_ak4chsupdated_uncpt ; + TH1D * h_ak4chsupdated_eta ; + TH1D * h_ak4chsupdated_btagCSVv2 ; + TH1D * h_ak4chsupdated_btagCvsL ; + TH1D * h_ak4chsupdated_btagCvsB ; + TH1D * h_ak4chsupdated_btagDeepCSVb ; + TH1D * h_ak4chsupdated_btagDeepCSVbb; + TH1D * h_ak4chsupdated_btagDeepCSVc ; + TH1D * h_ak4chsupdated_btagDeepCSVl ; + TH1D * h_ak4chsupdated_btagDeepFlavourb ; + TH1D * h_ak4chsupdated_btagDeepFlavourbb; + TH1D * h_ak4chsupdated_btagDeepFlavourc ; + TH1D * h_ak4chsupdated_btagDeepFlavourl ; + TH1D * h_ak4chsupdated_btagDeepFlavourg ; + TH1D * h_ak4chsupdated_btagDeepFlavourlepb; + TH1D * h_ak4chsupdated_area ; + TH1D * h_ak4chsupdated_pileupJetId ; + TH1D * h_ak4chsupdated_nhf ; + TH1D * h_ak4chsupdated_nemf ; + TH1D * h_ak4chsupdated_chf ; + TH1D * h_ak4chsupdated_muf ; + TH1D * h_ak4chsupdated_cemf ; + TH1D * h_ak4chsupdated_numConst ; + TH1D * h_ak4chsupdated_numNeuPar ; + TH1D * h_ak4chsupdated_chm ; + TH1D * h_ak4chs_pt ; + TH1D * h_ak4chs_uncpt ; + TH1D * h_ak4chs_eta ; + TH1D * h_ak4chs_btagCSVv2 ; + TH1D * h_ak4chs_pileupJetId ; + TH1D * h_ak4chs_qglikelihood ; TH1D * h_ak4chs_area ; - TH1D * h_ak4chs_pt200_mass ; - TH1D * h_ak4chs_pt200_prunedMass ; - TH1D * h_ak4chs_pt200_trimmedMass ; - TH1D * h_ak4chs_pt200_filteredMass ; - TH1D * h_ak4chs_pt200_softDropMass ; - TH1D * h_ak4chs_pt200_tau32 ; - TH1D * h_ak4chs_pt200_tau21 ; - TH1D * h_ak4chs_pt200_subjetMass ; - TH1D * h_ak4chs_pt500_mass ; - TH1D * h_ak4chs_pt500_prunedMass ; - TH1D * h_ak4chs_pt500_trimmedMass ; - TH1D * h_ak4chs_pt500_filteredMass ; - TH1D * h_ak4chs_pt500_softDropMass ; - TH1D * h_ak4chs_pt500_tau32 ; - TH1D * h_ak4chs_pt500_tau21 ; - TH1D * h_ak4chs_pt500_subjetMass ; + TH1D * h_ak4chs_nhf ; + TH1D * h_ak4chs_nemf ; + TH1D * h_ak4chs_chf ; + TH1D * h_ak4chs_muf ; + TH1D * h_ak4chs_cemf ; + TH1D * h_ak4chs_numConst ; + TH1D * h_ak4chs_numNeuPar ; + TH1D * h_ak4chs_chm ; + TH1D * h_ak4puppi_pt ; + TH1D * h_ak4puppi_uncpt ; + TH1D * h_ak4puppi_eta ; + TH1D * h_ak4puppi_btagCSVv2 ; + TH1D * h_ak4puppi_area ; + TH1D * h_ak4puppi_nhf ; + TH1D * h_ak4puppi_nemf ; + TH1D * h_ak4puppi_chf ; + TH1D * h_ak4puppi_muf ; + TH1D * h_ak4puppi_cemf ; + TH1D * h_ak4puppi_numConst ; + TH1D * h_ak4puppi_numNeuPar ; + TH1D * h_ak4puppi_chm ; + TH1D * h_ak4pf_pt ; + TH1D * h_ak4pf_uncpt ; + TH1D * h_ak4pf_eta ; + TH1D * h_ak4pf_btagCSVv2 ; + TH1D * h_ak4pf_area ; + TH1D * h_ak4pf_nhf ; + TH1D * h_ak4pf_nemf ; + TH1D * h_ak4pf_chf ; + TH1D * h_ak4pf_muf ; + TH1D * h_ak4pf_cemf ; + TH1D * h_ak4pf_numConst ; + TH1D * h_ak4pf_numNeuPar ; + TH1D * h_ak4pf_chm ; - TH1D * h_ak8pf_pt ; - TH1D * h_ak8pf_mass ; - TH1D * h_ak8pf_rapidity ; - TH1D * h_ak8pf_prunedMass ; - TH1D * h_ak8pf_trimmedMass ; - TH1D * h_ak8pf_filteredMass ; - TH1D * h_ak8pf_softDropMass ; - TH1D * h_ak8pf_tau1 ; - TH1D * h_ak8pf_tau2 ; - TH1D * h_ak8pf_tau3 ; - TH1D * h_ak8pf_tau4 ; - TH1D * h_ak8pf_tau32 ; - TH1D * h_ak8pf_tau21 ; - TH1D * h_ak8pf_ndau ; - TH1D * h_ak8pf_subjetMass ; - TH1D * h_ak8pf_area ; - TH1D * h_ak8pf_pt200_mass ; - TH1D * h_ak8pf_pt200_prunedMass ; - TH1D * h_ak8pf_pt200_trimmedMass ; - TH1D * h_ak8pf_pt200_filteredMass ; - TH1D * h_ak8pf_pt200_softDropMass ; - TH1D * h_ak8pf_pt200_tau32 ; - TH1D * h_ak8pf_pt200_tau21 ; - TH1D * h_ak8pf_pt200_subjetMass ; - TH1D * h_ak8pf_pt500_mass ; - TH1D * h_ak8pf_pt500_prunedMass ; - TH1D * h_ak8pf_pt500_trimmedMass ; - TH1D * h_ak8pf_pt500_filteredMass ; - TH1D * h_ak8pf_pt500_softDropMass ; - TH1D * h_ak8pf_pt500_tau32 ; - TH1D * h_ak8pf_pt500_tau21 ; - TH1D * h_ak8pf_pt500_subjetMass ; - - TH1D * h_ak8chs_pt ; - TH1D * h_ak8chs_mass ; - TH1D * h_ak8chs_rapidity ; - TH1D * h_ak8chs_prunedMass ; - TH1D * h_ak8chs_trimmedMass ; - TH1D * h_ak8chs_filteredMass ; - TH1D * h_ak8chs_softDropMass ; - TH1D * h_ak8chs_tau1 ; - TH1D * h_ak8chs_tau2 ; - TH1D * h_ak8chs_tau3 ; - TH1D * h_ak8chs_tau4 ; - TH1D * h_ak8chs_tau32 ; - TH1D * h_ak8chs_tau21 ; - TH1D * h_ak8chs_ndau ; - TH1D * h_ak8chs_subjetMass ; - TH1D * h_ak8chs_area ; - TH1D * h_ak8chs_pt200_mass ; - TH1D * h_ak8chs_pt200_prunedMass ; - TH1D * h_ak8chs_pt200_trimmedMass ; - TH1D * h_ak8chs_pt200_filteredMass ; - TH1D * h_ak8chs_pt200_softDropMass ; - TH1D * h_ak8chs_pt200_tau32 ; - TH1D * h_ak8chs_pt200_tau21 ; - TH1D * h_ak8chs_pt200_subjetMass ; - TH1D * h_ak8chs_pt500_mass ; - TH1D * h_ak8chs_pt500_prunedMass ; - TH1D * h_ak8chs_pt500_trimmedMass ; - TH1D * h_ak8chs_pt500_filteredMass ; - TH1D * h_ak8chs_pt500_softDropMass ; - TH1D * h_ak8chs_pt500_tau32 ; - TH1D * h_ak8chs_pt500_tau21 ; - TH1D * h_ak8chs_pt500_subjetMass ; + TH1D * h_ak8miniAOD_pt ; + TH1D * h_ak8miniAOD_mass ; + TH1D * h_ak8miniAOD_eta ; + TH1D * h_ak8miniAOD_phi ; + TH1D * h_ak8miniAOD_CHSPrunedMass ; + TH1D * h_ak8miniAOD_CHSSoftDropMass ; + TH1D * h_ak8miniAOD_PuppiSoftDropMass ; + TH1D * h_ak8miniAOD_PuppiTau1 ; + TH1D * h_ak8miniAOD_PuppiTau2 ; + TH1D * h_ak8miniAOD_PuppiTau3 ; + TH1D * h_ak8miniAOD_PuppiTau4 ; + TH1D * h_ak8miniAOD_PuppiTau32 ; + TH1D * h_ak8miniAOD_PuppiTau21 ; + TH1D * h_ak8miniAOD_CHSTau1 ; + TH1D * h_ak8miniAOD_CHSTau2 ; + TH1D * h_ak8miniAOD_CHSTau3 ; + TH1D * h_ak8miniAOD_CHSTau4 ; + TH1D * h_ak8miniAOD_CHSTau32 ; + TH1D * h_ak8miniAOD_CHSTau21 ; + TH1D * h_ak8miniAOD_PuppiECFnb1N2 ; + TH1D * h_ak8miniAOD_PuppiECFnb1N3 ; + TH1D * h_ak8miniAOD_PuppiECFnb2N2 ; + TH1D * h_ak8miniAOD_PuppiECFnb2N3 ; + TH1D * h_ak8miniAOD_ndau ; + TH1D * h_ak8miniAOD_area ; + TH1D * h_ak8miniAOD_subjetMass ; + TH1D * h_ak8miniAOD_subjetPt ; + TH1D * h_ak8miniAOD_subjetEta ; + TH1D * h_ak8miniAOD_subjetPhi ; + TH1D * h_ak8miniAOD_subjetBdisc ; + + TH1D * h_ak8puppiupdated_pt ; + TH1D * h_ak8puppiupdated_mass ; + TH1D * h_ak8puppiupdated_eta ; + TH1D * h_ak8puppiupdated_phi ; + TH1D * h_ak8puppiupdated_CHSPrunedMass ; + TH1D * h_ak8puppiupdated_CHSSoftDropMass ; + TH1D * h_ak8puppiupdated_PuppiSoftDropMass ; + TH1D * h_ak8puppiupdated_PuppiTau1 ; + TH1D * h_ak8puppiupdated_PuppiTau2 ; + TH1D * h_ak8puppiupdated_PuppiTau3 ; + TH1D * h_ak8puppiupdated_PuppiTau4 ; + TH1D * h_ak8puppiupdated_PuppiTau32 ; + TH1D * h_ak8puppiupdated_PuppiTau21 ; + TH1D * h_ak8puppiupdated_CHSTau1 ; + TH1D * h_ak8puppiupdated_CHSTau2 ; + TH1D * h_ak8puppiupdated_CHSTau3 ; + TH1D * h_ak8puppiupdated_CHSTau4 ; + TH1D * h_ak8puppiupdated_CHSTau32 ; + TH1D * h_ak8puppiupdated_CHSTau21 ; + TH1D * h_ak8puppiupdated_PuppiECFnb1N2 ; + TH1D * h_ak8puppiupdated_PuppiECFnb1N3 ; + TH1D * h_ak8puppiupdated_PuppiECFnb2N2 ; + TH1D * h_ak8puppiupdated_PuppiECFnb2N3 ; + TH1D * h_ak8puppiupdated_ndau ; + TH1D * h_ak8puppiupdated_area ; + TH1D * h_ak8puppiupdated_doubleB ; + TH1D * h_ak8puppiupdated_deepDoubleBvLQCD ; + TH1D * h_ak8puppiupdated_deepDoubleBvLHbb ; + TH1D * h_ak8puppiupdated_deepDoubleCvLQCD ; + TH1D * h_ak8puppiupdated_deepDoubleCvLHcc ; + TH1D * h_ak8puppiupdated_deepDoubleCvBHbb ; + TH1D * h_ak8puppiupdated_deepDoubleCvBHcc ; + TH1D * h_ak8puppiupdated_deepBoostedJetbbvsl; + TH1D * h_ak8puppiupdated_deepBoostedJetccvsl; + TH1D * h_ak8puppiupdated_deepBoostedJetTvsQCD; + TH1D * h_ak8puppiupdated_deepBoostedJetZHccvsQCD; + TH1D * h_ak8puppiupdated_deepBoostedJetWvsQCD; + TH1D * h_ak8puppiupdated_deepBoostedJetZHbbvsQCD; + TH1D * h_ak8puppiupdated_subjetMass ; + TH1D * h_ak8puppiupdated_subjetPt ; + TH1D * h_ak8puppiupdated_subjetEta ; + TH1D * h_ak8puppiupdated_subjetPhi ; + TH1D * h_ak8puppiupdated_subjetBdisc ; TH1D * h_ak8puppi_pt ; TH1D * h_ak8puppi_mass ; - TH1D * h_ak8puppi_rapidity ; - TH1D * h_ak8puppi_prunedMass ; - TH1D * h_ak8puppi_trimmedMass ; - TH1D * h_ak8puppi_filteredMass ; - TH1D * h_ak8puppi_softDropMass ; - TH1D * h_ak8puppi_tau1 ; - TH1D * h_ak8puppi_tau2 ; - TH1D * h_ak8puppi_tau3 ; - TH1D * h_ak8puppi_tau4 ; - TH1D * h_ak8puppi_tau32 ; - TH1D * h_ak8puppi_tau21 ; + TH1D * h_ak8puppi_eta ; + TH1D * h_ak8puppi_phi ; + TH1D * h_ak8puppi_PrunedMass ; + TH1D * h_ak8puppi_SoftDropMass ; + TH1D * h_ak8puppi_TrimmedMass ; + TH1D * h_ak8puppi_FilteredMass ; + TH1D * h_ak8puppi_Tau1 ; + TH1D * h_ak8puppi_Tau2 ; + TH1D * h_ak8puppi_Tau3 ; + TH1D * h_ak8puppi_Tau4 ; + TH1D * h_ak8puppi_Tau32 ; + TH1D * h_ak8puppi_Tau21 ; + TH1D * h_ak8puppi_ECFnb1N2 ; + TH1D * h_ak8puppi_ECFnb1N3 ; TH1D * h_ak8puppi_ndau ; + TH1D * h_ak8puppi_area ; + TH1D * h_ak8puppi_doubleB ; TH1D * h_ak8puppi_subjetMass ; - TH1D * h_ak8puppi_area ; - TH1D * h_ak8puppi_pt200_mass ; - TH1D * h_ak8puppi_pt200_prunedMass ; - TH1D * h_ak8puppi_pt200_trimmedMass ; - TH1D * h_ak8puppi_pt200_filteredMass ; - TH1D * h_ak8puppi_pt200_softDropMass ; - TH1D * h_ak8puppi_pt200_tau32 ; - TH1D * h_ak8puppi_pt200_tau21 ; - TH1D * h_ak8puppi_pt200_subjetMass ; - TH1D * h_ak8puppi_pt500_mass ; - TH1D * h_ak8puppi_pt500_prunedMass ; - TH1D * h_ak8puppi_pt500_trimmedMass ; - TH1D * h_ak8puppi_pt500_filteredMass ; - TH1D * h_ak8puppi_pt500_softDropMass ; - TH1D * h_ak8puppi_pt500_tau32 ; - TH1D * h_ak8puppi_pt500_tau21 ; - TH1D * h_ak8puppi_pt500_subjetMass ; + TH1D * h_ak8puppi_subjetPt ; + TH1D * h_ak8puppi_subjetEta ; + TH1D * h_ak8puppi_subjetPhi ; + TH1D * h_ak8puppi_subjetBdisc ; + TH1D * h_ak8chs_pt ; + TH1D * h_ak8chs_mass ; + TH1D * h_ak8chs_eta ; + TH1D * h_ak8chs_phi ; + TH1D * h_ak8chs_PrunedMass ; + TH1D * h_ak8chs_SoftDropMass ; + TH1D * h_ak8chs_TrimmedMass ; + TH1D * h_ak8chs_FilteredMass ; + TH1D * h_ak8chs_Tau1 ; + TH1D * h_ak8chs_Tau2 ; + TH1D * h_ak8chs_Tau3 ; + TH1D * h_ak8chs_Tau4 ; + TH1D * h_ak8chs_Tau32 ; + TH1D * h_ak8chs_Tau21 ; + TH1D * h_ak8chs_ndau ; + TH1D * h_ak8chs_area ; + TH1D * h_ak8chs_doubleB ; + TH1D * h_ak8chs_subjetMass ; + TH1D * h_ak8chs_subjetPt ; + TH1D * h_ak8chs_subjetEta ; + TH1D * h_ak8chs_subjetPhi ; + TH1D * h_ak8chs_subjetBdisc ; + + TH1D * h_ca8chs_pt ; + TH1D * h_ca8chs_mass ; + TH1D * h_ca8chs_eta ; + TH1D * h_ca8chs_phi ; + TH1D * h_ca8chs_PrunedMass ; + TH1D * h_ca8chs_SoftDropMass ; + TH1D * h_ca8chs_Tau1 ; + TH1D * h_ca8chs_Tau2 ; + TH1D * h_ca8chs_Tau3 ; + TH1D * h_ca8chs_Tau4 ; + TH1D * h_ca8chs_Tau32 ; + TH1D * h_ca8chs_Tau21 ; + TH1D * h_ca8chs_ndau ; + TH1D * h_ca8chs_area ; + TH1D * h_ca8chs_doubleB ; + TH1D * h_ca8chs_subjetMass ; + TH1D * h_ca8chs_subjetPt ; + TH1D * h_ca8chs_subjetEta ; + TH1D * h_ca8chs_subjetPhi ; + TH1D * h_ca8chs_subjetBdisc ; + TH1D * h_kt8chs_pt ; TH1D * h_kt8chs_mass ; - TH1D * h_kt8chs_rapidity ; - TH1D * h_kt8chs_prunedMass ; - TH1D * h_kt8chs_trimmedMass ; - TH1D * h_kt8chs_filteredMass ; - TH1D * h_kt8chs_softDropMass ; - TH1D * h_kt8chs_tau1 ; - TH1D * h_kt8chs_tau2 ; - TH1D * h_kt8chs_tau3 ; - TH1D * h_kt8chs_tau4 ; - TH1D * h_kt8chs_tau32 ; - TH1D * h_kt8chs_tau21 ; + TH1D * h_kt8chs_eta ; + TH1D * h_kt8chs_phi ; + TH1D * h_kt8chs_PrunedMass ; + TH1D * h_kt8chs_SoftDropMass ; + TH1D * h_kt8chs_Tau1 ; + TH1D * h_kt8chs_Tau2 ; + TH1D * h_kt8chs_Tau3 ; + TH1D * h_kt8chs_Tau4 ; + TH1D * h_kt8chs_Tau32 ; + TH1D * h_kt8chs_Tau21 ; TH1D * h_kt8chs_ndau ; + TH1D * h_kt8chs_area ; + TH1D * h_kt8chs_doubleB ; TH1D * h_kt8chs_subjetMass ; - TH1D * h_kt8chs_area ; - TH1D * h_kt8chs_pt200_mass ; - TH1D * h_kt8chs_pt200_prunedMass ; - TH1D * h_kt8chs_pt200_trimmedMass ; - TH1D * h_kt8chs_pt200_filteredMass ; - TH1D * h_kt8chs_pt200_softDropMass ; - TH1D * h_kt8chs_pt200_tau32 ; - TH1D * h_kt8chs_pt200_tau21 ; - TH1D * h_kt8chs_pt200_subjetMass ; - TH1D * h_kt8chs_pt500_mass ; - TH1D * h_kt8chs_pt500_prunedMass ; - TH1D * h_kt8chs_pt500_trimmedMass ; - TH1D * h_kt8chs_pt500_filteredMass ; - TH1D * h_kt8chs_pt500_softDropMass ; - TH1D * h_kt8chs_pt500_tau32 ; - TH1D * h_kt8chs_pt500_tau21 ; - TH1D * h_kt8chs_pt500_subjetMass ; + TH1D * h_kt8chs_subjetPt ; + TH1D * h_kt8chs_subjetEta ; + TH1D * h_kt8chs_subjetPhi ; + TH1D * h_kt8chs_subjetBdisc ; + + TH1D * h_ak8puppimodsd_pt ; + TH1D * h_ak8puppimodsd_mass ; + TH1D * h_ak8puppimodsd_eta ; + TH1D * h_ak8puppimodsd_phi ; + TH1D * h_ak8puppimodsd_SoftDropMass ; + + TH1D * h_ak8sk_pt ; + TH1D * h_ak8sk_mass ; + TH1D * h_ak8sk_eta ; + TH1D * h_ak8sk_phi ; + TH1D * h_ak8sk_SoftDropMass ; + + TH1D * h_ak8cs_pt ; + TH1D * h_ak8cs_mass ; + TH1D * h_ak8cs_eta ; + TH1D * h_ak8cs_phi ; + TH1D * h_ak8cs_SoftDropMass ; + + - TH1D * h_ca8chs_pt ; - TH1D * h_ca8chs_mass ; - TH1D * h_ca8chs_rapidity ; - TH1D * h_ca8chs_prunedMass ; - TH1D * h_ca8chs_trimmedMass ; - TH1D * h_ca8chs_filteredMass ; - TH1D * h_ca8chs_softDropMass ; - TH1D * h_ca8chs_tau1 ; - TH1D * h_ca8chs_tau2 ; - TH1D * h_ca8chs_tau3 ; - TH1D * h_ca8chs_tau4 ; - TH1D * h_ca8chs_tau32 ; - TH1D * h_ca8chs_tau21 ; - TH1D * h_ca8chs_ndau ; - TH1D * h_ca8chs_subjetMass ; - TH1D * h_ca8chs_area ; - TH1D * h_ca8chs_pt200_mass ; - TH1D * h_ca8chs_pt200_prunedMass ; - TH1D * h_ca8chs_pt200_trimmedMass ; - TH1D * h_ca8chs_pt200_filteredMass ; - TH1D * h_ca8chs_pt200_softDropMass ; - TH1D * h_ca8chs_pt200_tau32 ; - TH1D * h_ca8chs_pt200_tau21 ; - TH1D * h_ca8chs_pt200_subjetMass ; - TH1D * h_ca8chs_pt500_mass ; - TH1D * h_ca8chs_pt500_prunedMass ; - TH1D * h_ca8chs_pt500_trimmedMass ; - TH1D * h_ca8chs_pt500_filteredMass ; - TH1D * h_ca8chs_pt500_softDropMass ; - TH1D * h_ca8chs_pt500_tau32 ; - TH1D * h_ca8chs_pt500_tau21 ; - TH1D * h_ca8chs_pt500_subjetMass ; TH1D * h_ak12chs_pt ; TH1D * h_ak12chs_mass ; - TH1D * h_ak12chs_rapidity ; + TH1D * h_ak12chs_eta ; TH1D * h_ak12chs_prunedMass ; TH1D * h_ak12chs_trimmedMass ; TH1D * h_ak12chs_filteredMass ; @@ -330,7 +411,7 @@ class JetTester : public edm::EDAnalyzer { TH1D * h_ak15chs_pt ; TH1D * h_ak15chs_mass ; - TH1D * h_ak15chs_rapidity ; + TH1D * h_ak15chs_eta ; TH1D * h_ak15chs_prunedMass ; TH1D * h_ak15chs_trimmedMass ; TH1D * h_ak15chs_filteredMass ; @@ -366,277 +447,326 @@ class JetTester : public edm::EDAnalyzer { // constructors and destructor // JetTester::JetTester(const edm::ParameterSet& iConfig): - ak4jetMiniToken_(consumes(edm::InputTag("slimmedJets"))), - ak8jetMiniToken_(consumes(edm::InputTag("slimmedJetsAK8"))), + ak4PFCHSminiAODjetToken_(consumes(edm::InputTag("slimmedJets"))), + ak4PFPuppiminiAODjetToken_(consumes(edm::InputTag("slimmedJetsPuppi"))), + ak4PFCHSUpdatedjetToken_(consumes(edm::InputTag("selectedPatJetsAK4PFCHSUpdated"))), ak4PFCHSjetToken_(consumes(edm::InputTag("selectedPatJetsAK4PFCHS"))), - ak8PFjetToken_(consumes(edm::InputTag("selectedPatJetsAK8PF"))), - ak8PFCHSjetToken_(consumes(edm::InputTag("selectedPatJetsAK8PFCHS"))), + ak4PFPuppijetToken_(consumes(edm::InputTag("selectedPatJetsAK4PFPuppi"))), + ak4PFjetToken_(consumes(edm::InputTag("selectedPatJetsAK4PFPlain"))), + ak8PFPuppiminiAODjetToken_(consumes(edm::InputTag("slimmedJetsAK8"))), + ak8PFPuppiUpdatedjetToken_(consumes(edm::InputTag("selectedPatJetsAK8PFPuppiUpdated"))), + ak8PFPuppijetToken_(consumes(edm::InputTag("packedPatJetsAK8PFPuppiSoftDrop"))), + ak8PFCHSjetToken_(consumes(edm::InputTag("packedPatJetsAK8PFCHSSoftDrop"))), ca8PFCHSjetToken_(consumes(edm::InputTag("selectedPatJetsCA8PFCHS"))), kt8PFCHSjetToken_(consumes(edm::InputTag("selectedPatJetsKT8PFCHS"))), - ak8PFPUPPIjetToken_(consumes(edm::InputTag("selectedPatJetsAK8PFPuppi"))), - ak12PFCHSjetToken_(consumes(edm::InputTag("selectedPatJetsAK12PFCHS"))), + ak8PFPuppimodSDjetToken_(consumes(edm::InputTag("selectedPatJetsAK8PFPuppimodSD"))), + ak8PFSKjetToken_(consumes(edm::InputTag("selectedPatJetsAK8PFSK"))), + ak8PFCSjetToken_(consumes(edm::InputTag("selectedPatJetsAK8PFCS"))), + + ca12PFCHSjetToken_(consumes(edm::InputTag("selectedPatJetsHEPTopTagCHS"))), + //ca12PFCHSjetToken_(consumes(edm::InputTag("hepTopTagPFJetsCHS"))), ak15PFCHSjetToken_(consumes(edm::InputTag("selectedPatJetsAK15PFCHS"))), - ak4PFCHSSoftDropSubjetsToken_(consumes(edm::InputTag("selectedPatJetsAK4PFCHSSoftDropPacked","SubJets"))), - ak8PFSoftDropSubjetsToken_(consumes(edm::InputTag("selectedPatJetsAK8PFSoftDropPacked","SubJets"))), - ak8PFCHSSoftDropSubjetsToken_(consumes(edm::InputTag("selectedPatJetsAK8PFCHSSoftDropPacked","SubJets"))), - ca8PFCHSSoftDropSubjetsToken_(consumes(edm::InputTag("selectedPatJetsCA8PFCHSSoftDropPacked","SubJets"))), - kt8PFCHSSoftDropSubjetsToken_(consumes(edm::InputTag("selectedPatJetsKT8PFCHSSoftDropPacked","SubJets"))), - ak8PFPUPPISoftDropSubjetsToken_(consumes(edm::InputTag("selectedPatJetsAK8PFPuppiSoftDropPacked","SubJets"))), - ak12PFCHSSoftDropSubjetsToken_(consumes(edm::InputTag("selectedPatJetsAK12PFCHSSoftDropPacked","SubJets"))), - ak15PFCHSSoftDropSubjetsToken_(consumes(edm::InputTag("selectedPatJetsAK15PFCHSSoftDropPacked","SubJets"))), - puppijetToken_(consumes(edm::InputTag("slimmedJetsPuppi"))), - ak4genjetToken_(consumes(edm::InputTag("slimmedGenJets"))), - ak8genjetToken_(consumes(edm::InputTag("slimmedGenJetsAK8"))), + + //ak4genjetToken_(consumes(edm::InputTag("slimmedGenJets"))), + //ak8genjetToken_(consumes(edm::InputTag("slimmedGenJetsAK8"))), prunedGenToken_(consumes >(edm::InputTag("prunedGenParticles"))), rhoToken_(consumes(edm::InputTag("fixedGridRhoFastjetAll"))), vtxToken_(consumes >(edm::InputTag("offlineSlimmedPrimaryVertices"))) { edm::Service fs; + h_ak4chsminiAOD_pt = fs->make("h_ak4chsminiAOD_pt" ,"",100,0,3000); + h_ak4chsminiAOD_uncpt = fs->make("h_ak4chsminiAOD_uncpt" ,"",100,0,3000); + h_ak4chsminiAOD_eta = fs->make("h_ak4chsminiAOD_eta" ,"",100,-5, 5); + h_ak4chsminiAOD_btagCSVv2 = fs->make("h_ak4chsminiAOD_btagCSVv2" ,"",20, 0, 1); + h_ak4chsminiAOD_area = fs->make("h_ak4chsminiAOD_area" ,"",100,0, 8); + h_ak4chsminiAOD_nhf = fs->make("h_ak4chsminiAOD_nhf" ,"",20, 0, 1); + h_ak4chsminiAOD_nemf = fs->make("h_ak4chsminiAOD_nemf" ,"",20, 0, 1); + h_ak4chsminiAOD_chf = fs->make("h_ak4chsminiAOD_chf" ,"",20, 0, 1); + h_ak4chsminiAOD_muf = fs->make("h_ak4chsminiAOD_muf" ,"",20, 0, 1); + h_ak4chsminiAOD_cemf = fs->make("h_ak4chsminiAOD_cemf" ,"",20, 0, 1); + h_ak4chsminiAOD_numConst = fs->make("h_ak4chsminiAOD_numConst" ,"",100, 0, 100); + h_ak4chsminiAOD_numNeuPar = fs->make("h_ak4chsminiAOD_numNeuPar" ,"",100, 0, 100); + h_ak4chsminiAOD_chm = fs->make("h_ak4chsminiAOD_chm" ,"",100, 0, 100); + h_ak4puppiminiAOD_pt = fs->make("h_ak4puppiminiAOD_pt" ,"",100,0,3000); + h_ak4puppiminiAOD_uncpt = fs->make("h_ak4puppiminiAOD_uncpt" ,"",100,0,3000); + h_ak4puppiminiAOD_eta = fs->make("h_ak4puppiminiAOD_eta" ,"",100,-5, 5); + h_ak4puppiminiAOD_btagCSVv2 = fs->make("h_ak4puppiminiAOD_btagCSVv2" ,"",20, 0, 1); + h_ak4puppiminiAOD_area = fs->make("h_ak4puppiminiAOD_area" ,"",100,0, 8); + h_ak4puppiminiAOD_nhf = fs->make("h_ak4puppiminiAOD_nhf" ,"",20, 0, 1); + h_ak4puppiminiAOD_nemf = fs->make("h_ak4puppiminiAOD_nemf" ,"",20, 0, 1); + h_ak4puppiminiAOD_chf = fs->make("h_ak4puppiminiAOD_chf" ,"",20, 0, 1); + h_ak4puppiminiAOD_muf = fs->make("h_ak4puppiminiAOD_muf" ,"",20, 0, 1); + h_ak4puppiminiAOD_cemf = fs->make("h_ak4puppiminiAOD_cemf" ,"",20, 0, 1); + h_ak4puppiminiAOD_numConst = fs->make("h_ak4puppiminiAOD_numConst" ,"",100, 0, 100); + h_ak4puppiminiAOD_numNeuPar = fs->make("h_ak4puppiminiAOD_numNeuPar" ,"",100, 0, 100); + h_ak4puppiminiAOD_chm = fs->make("h_ak4puppiminiAOD_chm" ,"",100, 0, 100); + + h_ak4chsupdated_pt = fs->make("h_ak4chsupdated_pt" ,"",100,0,3000); + h_ak4chsupdated_uncpt = fs->make("h_ak4chsupdated_uncpt" ,"",100,0,3000); + h_ak4chsupdated_eta = fs->make("h_ak4chsupdated_eta" ,"",100,-5, 5); + h_ak4chsupdated_btagCSVv2 = fs->make("h_ak4chsupdated_btagCSVv2" ,"",20, 0, 1); + h_ak4chsupdated_btagCvsL = fs->make("h_ak4chsupdated_btagCvsL" ,"",40,-1, 1); + h_ak4chsupdated_btagCvsB = fs->make("h_ak4chsupdated_btagCvsB" ,"",40,-1, 1); + h_ak4chsupdated_btagDeepCSVb = fs->make("h_ak4chsupdated_btagDeepCSVb" ,"",20, 0, 1); + h_ak4chsupdated_btagDeepCSVbb = fs->make("h_ak4chsupdated_btagDeepCSVbb" ,"",20, 0, 1); + h_ak4chsupdated_btagDeepCSVc = fs->make("h_ak4chsupdated_btagDeepCSVc" ,"",20, 0, 1); + h_ak4chsupdated_btagDeepCSVl = fs->make("h_ak4chsupdated_btagDeepCSVl" ,"",20, 0, 1); + h_ak4chsupdated_btagDeepFlavourb = fs->make("h_ak4chsupdated_btagDeepFlavourb" ,"",20, 0, 1); + h_ak4chsupdated_btagDeepFlavourbb = fs->make("h_ak4chsupdated_btagDeepFlavourbb" ,"",20, 0, 1); + h_ak4chsupdated_btagDeepFlavourc = fs->make("h_ak4chsupdated_btagDeepFlavourc" ,"",20, 0, 1); + h_ak4chsupdated_btagDeepFlavourl = fs->make("h_ak4chsupdated_btagDeepFlavourl" ,"",20, 0, 1); + h_ak4chsupdated_btagDeepFlavourg = fs->make("h_ak4chsupdated_btagDeepFlavourg" ,"",20, 0, 1); + h_ak4chsupdated_btagDeepFlavourlepb = fs->make("h_ak4chsupdated_btagDeepFlavourlepb" ,"",20, 0, 1); + h_ak4chsupdated_area = fs->make("h_ak4chsupdated_area" ,"",100,0, 8); + h_ak4chsupdated_nhf = fs->make("h_ak4chsupdated_nhf" ,"",20, 0, 1); + h_ak4chsupdated_nemf = fs->make("h_ak4chsupdated_nemf" ,"",20, 0, 1); + h_ak4chsupdated_chf = fs->make("h_ak4chsupdated_chf" ,"",20, 0, 1); + h_ak4chsupdated_muf = fs->make("h_ak4chsupdated_muf" ,"",20, 0, 1); + h_ak4chsupdated_cemf = fs->make("h_ak4chsupdated_cemf" ,"",20, 0, 1); + h_ak4chsupdated_numConst = fs->make("h_ak4chsupdated_numConst" ,"",100, 0, 100); + h_ak4chsupdated_numNeuPar = fs->make("h_ak4chsupdated_numNeuPar" ,"",100, 0, 100); + h_ak4chsupdated_chm = fs->make("h_ak4chsupdated_chm" ,"",100, 0, 100); h_ak4chs_pt = fs->make("h_ak4chs_pt" ,"",100,0,3000); - h_ak4chs_mass = fs->make("h_ak4chs_mass" ,"",100,0,500); - h_ak4chs_rapidity = fs->make("h_ak4chs_rapidity" ,"",100,-5, 5); - h_ak4chs_prunedMass = fs->make("h_ak4chs_prunedMass" ,"",100,0,500); - h_ak4chs_trimmedMass = fs->make("h_ak4chs_trimmedMass" ,"",100,0,500); - h_ak4chs_filteredMass = fs->make("h_ak4chs_filteredMass" ,"",100,0,500); - h_ak4chs_softDropMass = fs->make("h_ak4chs_softDropMass" ,"",100,0,500); - h_ak4chs_tau1 = fs->make("h_ak4chs_tau1" ,"",100,0, 1); - h_ak4chs_tau2 = fs->make("h_ak4chs_tau2" ,"",100,0, 1); - h_ak4chs_tau3 = fs->make("h_ak4chs_tau3" ,"",100,0, 1); - h_ak4chs_tau4 = fs->make("h_ak4chs_tau4" ,"",100,0, 1); - h_ak4chs_tau32 = fs->make("h_ak4chs_tau32" ,"",100,0, 1); - h_ak4chs_tau21 = fs->make("h_ak4chs_tau21" ,"",100,0, 1); - h_ak4chs_ndau = fs->make("h_ak4chs_ndau" ,"",300,0,300); - h_ak4chs_subjetMass = fs->make("h_ak4chs_subjetMass" ,"",100,0,400); + h_ak4chs_uncpt = fs->make("h_ak4chs_uncpt" ,"",100,0,3000); + h_ak4chs_eta = fs->make("h_ak4chs_eta" ,"",100,-5, 5); + h_ak4chs_btagCSVv2 = fs->make("h_ak4chs_btagCSVv2" ,"",20, 0, 1); + h_ak4chs_pileupJetId = fs->make("h_ak4chs_pileupJetId" ,"",20, 0, 1); + h_ak4chs_qglikelihood = fs->make("h_ak4chs_qglikelihood" ,"",20, 0, 1); h_ak4chs_area = fs->make("h_ak4chs_area" ,"",100,0, 8); - h_ak4chs_pt200_mass = fs->make("h_ak4chs_pt200_mass" ,"",100,0,500); - h_ak4chs_pt200_prunedMass = fs->make("h_ak4chs_pt200_prunedMass" ,"",100,0,500); - h_ak4chs_pt200_trimmedMass = fs->make("h_ak4chs_pt200_trimmedMass" ,"",100,0,500); - h_ak4chs_pt200_filteredMass = fs->make("h_ak4chs_pt200_filteredMass" ,"",100,0,500); - h_ak4chs_pt200_softDropMass = fs->make("h_ak4chs_pt200_softDropMass" ,"",100,0,500); - h_ak4chs_pt200_tau32 = fs->make("h_ak4chs_pt200_tau32" ,"",100,0, 1); - h_ak4chs_pt200_tau21 = fs->make("h_ak4chs_pt200_tau21" ,"",100,0, 1); - h_ak4chs_pt200_subjetMass = fs->make("h_ak4chs_pt200_subjetMass" ,"",100,0,400); - h_ak4chs_pt500_mass = fs->make("h_ak4chs_pt500_mass" ,"",100,0,500); - h_ak4chs_pt500_prunedMass = fs->make("h_ak4chs_pt500_prunedMass" ,"",100,0,500); - h_ak4chs_pt500_trimmedMass = fs->make("h_ak4chs_pt500_trimmedMass" ,"",100,0,500); - h_ak4chs_pt500_filteredMass = fs->make("h_ak4chs_pt500_filteredMass" ,"",100,0,500); - h_ak4chs_pt500_softDropMass = fs->make("h_ak4chs_pt500_softDropMass" ,"",100,0,500); - h_ak4chs_pt500_tau32 = fs->make("h_ak4chs_pt500_tau32" ,"",100,0, 1); - h_ak4chs_pt500_tau21 = fs->make("h_ak4chs_pt500_tau21" ,"",100,0, 1); - h_ak4chs_pt500_subjetMass = fs->make("h_ak4chs_pt500_subjetMass" ,"",100,0,400); - - - h_ak8pf_pt = fs->make("h_ak8pf_pt" ,"",100,0,3000); - h_ak8pf_mass = fs->make("h_ak8pf_mass" ,"",100,0,500); - h_ak8pf_rapidity = fs->make("h_ak8pf_rapidity" ,"",100,-5, 5); - h_ak8pf_prunedMass = fs->make("h_ak8pf_prunedMass" ,"",100,0,500); - h_ak8pf_trimmedMass = fs->make("h_ak8pf_trimmedMass" ,"",100,0,500); - h_ak8pf_filteredMass = fs->make("h_ak8pf_filteredMass" ,"",100,0,500); - h_ak8pf_softDropMass = fs->make("h_ak8pf_softDropMass" ,"",100,0,500); - h_ak8pf_tau1 = fs->make("h_ak8pf_tau1" ,"",100,0, 1); - h_ak8pf_tau2 = fs->make("h_ak8pf_tau2" ,"",100,0, 1); - h_ak8pf_tau3 = fs->make("h_ak8pf_tau3" ,"",100,0, 1); - h_ak8pf_tau4 = fs->make("h_ak8pf_tau4" ,"",100,0, 1); - h_ak8pf_tau32 = fs->make("h_ak8pf_tau32" ,"",100,0, 1); - h_ak8pf_tau21 = fs->make("h_ak8pf_tau21" ,"",100,0, 1); - h_ak8pf_ndau = fs->make("h_ak8pf_ndau" ,"",300,0,300); - h_ak8pf_subjetMass = fs->make("h_ak8pf_subjetMass" ,"",100,0,400); - h_ak8pf_area = fs->make("h_ak8pf_area" ,"",100,0, 8); - h_ak8pf_pt200_mass = fs->make("h_ak8pf_pt200_mass" ,"",100,0,500); - h_ak8pf_pt200_prunedMass = fs->make("h_ak8pf_pt200_prunedMass" ,"",100,0,500); - h_ak8pf_pt200_trimmedMass = fs->make("h_ak8pf_pt200_trimmedMass" ,"",100,0,500); - h_ak8pf_pt200_filteredMass = fs->make("h_ak8pf_pt200_filteredMass" ,"",100,0,500); - h_ak8pf_pt200_softDropMass = fs->make("h_ak8pf_pt200_softDropMass" ,"",100,0,500); - h_ak8pf_pt200_tau32 = fs->make("h_ak8pf_pt200_tau32" ,"",100,0, 1); - h_ak8pf_pt200_tau21 = fs->make("h_ak8pf_pt200_tau21" ,"",100,0, 1); - h_ak8pf_pt200_subjetMass = fs->make("h_ak8pf_pt200_subjetMass" ,"",100,0,400); - h_ak8pf_pt500_mass = fs->make("h_ak8pf_pt500_mass" ,"",100,0,500); - h_ak8pf_pt500_prunedMass = fs->make("h_ak8pf_pt500_prunedMass" ,"",100,0,500); - h_ak8pf_pt500_trimmedMass = fs->make("h_ak8pf_pt500_trimmedMass" ,"",100,0,500); - h_ak8pf_pt500_filteredMass = fs->make("h_ak8pf_pt500_filteredMass" ,"",100,0,500); - h_ak8pf_pt500_softDropMass = fs->make("h_ak8pf_pt500_softDropMass" ,"",100,0,500); - h_ak8pf_pt500_tau32 = fs->make("h_ak8pf_pt500_tau32" ,"",100,0, 1); - h_ak8pf_pt500_tau21 = fs->make("h_ak8pf_pt500_tau21" ,"",100,0, 1); - h_ak8pf_pt500_subjetMass = fs->make("h_ak8pf_pt500_subjetMass" ,"",100,0,400); - - - h_ak8chs_pt = fs->make("h_ak8chs_pt" ,"",100,0,3000); - h_ak8chs_mass = fs->make("h_ak8chs_mass" ,"",100,0,500); - h_ak8chs_rapidity = fs->make("h_ak8chs_rapidity" ,"",100,-5, 5); - h_ak8chs_prunedMass = fs->make("h_ak8chs_prunedMass" ,"",100,0,500); - h_ak8chs_trimmedMass = fs->make("h_ak8chs_trimmedMass" ,"",100,0,500); - h_ak8chs_filteredMass = fs->make("h_ak8chs_filteredMass" ,"",100,0,500); - h_ak8chs_softDropMass = fs->make("h_ak8chs_softDropMass" ,"",100,0,500); - h_ak8chs_tau1 = fs->make("h_ak8chs_tau1" ,"",100,0, 1); - h_ak8chs_tau2 = fs->make("h_ak8chs_tau2" ,"",100,0, 1); - h_ak8chs_tau3 = fs->make("h_ak8chs_tau3" ,"",100,0, 1); - h_ak8chs_tau4 = fs->make("h_ak8chs_tau4" ,"",100,0, 1); - h_ak8chs_tau32 = fs->make("h_ak8chs_tau32" ,"",100,0, 1); - h_ak8chs_tau21 = fs->make("h_ak8chs_tau21" ,"",100,0, 1); - h_ak8chs_ndau = fs->make("h_ak8chs_ndau" ,"",300,0,300); - h_ak8chs_subjetMass = fs->make("h_ak8chs_subjetMass" ,"",100,0,400); - h_ak8chs_area = fs->make("h_ak8chs_area" ,"",100,0, 8); - h_ak8chs_pt200_mass = fs->make("h_ak8chs_pt200_mass" ,"",100,0,500); - h_ak8chs_pt200_prunedMass = fs->make("h_ak8chs_pt200_prunedMass" ,"",100,0,500); - h_ak8chs_pt200_trimmedMass = fs->make("h_ak8chs_pt200_trimmedMass" ,"",100,0,500); - h_ak8chs_pt200_filteredMass = fs->make("h_ak8chs_pt200_filteredMass" ,"",100,0,500); - h_ak8chs_pt200_softDropMass = fs->make("h_ak8chs_pt200_softDropMass" ,"",100,0,500); - h_ak8chs_pt200_tau32 = fs->make("h_ak8chs_pt200_tau32" ,"",100,0, 1); - h_ak8chs_pt200_tau21 = fs->make("h_ak8chs_pt200_tau21" ,"",100,0, 1); - h_ak8chs_pt200_subjetMass = fs->make("h_ak8chs_pt200_subjetMass" ,"",100,0,400); - h_ak8chs_pt500_mass = fs->make("h_ak8chs_pt500_mass" ,"",100,0,500); - h_ak8chs_pt500_prunedMass = fs->make("h_ak8chs_pt500_prunedMass" ,"",100,0,500); - h_ak8chs_pt500_trimmedMass = fs->make("h_ak8chs_pt500_trimmedMass" ,"",100,0,500); - h_ak8chs_pt500_filteredMass = fs->make("h_ak8chs_pt500_filteredMass" ,"",100,0,500); - h_ak8chs_pt500_softDropMass = fs->make("h_ak8chs_pt500_softDropMass" ,"",100,0,500); - h_ak8chs_pt500_tau32 = fs->make("h_ak8chs_pt500_tau32" ,"",100,0, 1); - h_ak8chs_pt500_tau21 = fs->make("h_ak8chs_pt500_tau21" ,"",100,0, 1); - h_ak8chs_pt500_subjetMass = fs->make("h_ak8chs_pt500_subjetMass" ,"",100,0,400); + h_ak4chs_nhf = fs->make("h_ak4chs_nhf" ,"",20, 0, 1); + h_ak4chs_nemf = fs->make("h_ak4chs_nemf" ,"",20, 0, 1); + h_ak4chs_chf = fs->make("h_ak4chs_chf" ,"",20, 0, 1); + h_ak4chs_muf = fs->make("h_ak4chs_muf" ,"",20, 0, 1); + h_ak4chs_cemf = fs->make("h_ak4chs_cemf" ,"",20, 0, 1); + h_ak4chs_numConst = fs->make("h_ak4chs_numConst" ,"",100, 0, 100); + h_ak4chs_numNeuPar = fs->make("h_ak4chs_numNeuPar" ,"",100, 0, 100); + h_ak4chs_chm = fs->make("h_ak4chs_chm" ,"",100, 0, 100); + + h_ak4puppi_pt = fs->make("h_ak4puppi_pt" ,"",100,0,3000); + h_ak4puppi_uncpt = fs->make("h_ak4puppi_uncpt" ,"",100,0,3000); + h_ak4puppi_eta = fs->make("h_ak4puppi_eta" ,"",100,-5, 5); + h_ak4puppi_btagCSVv2 = fs->make("h_ak4puppi_btagCSVv2" ,"",20, 0, 1); + h_ak4puppi_area = fs->make("h_ak4puppi_area" ,"",100,0, 8); + h_ak4puppi_nhf = fs->make("h_ak4puppi_nhf" ,"",20, 0, 1); + h_ak4puppi_nemf = fs->make("h_ak4puppi_nemf" ,"",20, 0, 1); + h_ak4puppi_chf = fs->make("h_ak4puppi_chf" ,"",20, 0, 1); + h_ak4puppi_muf = fs->make("h_ak4puppi_muf" ,"",20, 0, 1); + h_ak4puppi_cemf = fs->make("h_ak4puppi_cemf" ,"",20, 0, 1); + h_ak4puppi_numConst = fs->make("h_ak4puppi_numConst" ,"",100, 0, 100); + h_ak4puppi_numNeuPar = fs->make("h_ak4puppi_numNeuPar" ,"",100, 0, 100); + h_ak4puppi_chm = fs->make("h_ak4puppi_chm" ,"",100, 0, 100); + + + h_ak4pf_pt = fs->make("h_ak4pf_pt" ,"",100,0,3000); + h_ak4pf_uncpt = fs->make("h_ak4pf_uncpt" ,"",100,0,3000); + h_ak4pf_eta = fs->make("h_ak4pf_eta" ,"",100,-5, 5); + h_ak4pf_btagCSVv2 = fs->make("h_ak4pf_btagCSVv2" ,"",20, 0, 1); + h_ak4pf_area = fs->make("h_ak4pf_area" ,"",100,0, 8); + h_ak4pf_nhf = fs->make("h_ak4pf_nhf" ,"",20, 0, 1); + h_ak4pf_nemf = fs->make("h_ak4pf_nemf" ,"",20, 0, 1); + h_ak4pf_chf = fs->make("h_ak4pf_chf" ,"",20, 0, 1); + h_ak4pf_muf = fs->make("h_ak4pf_muf" ,"",20, 0, 1); + h_ak4pf_cemf = fs->make("h_ak4pf_cemf" ,"",20, 0, 1); + h_ak4pf_numConst = fs->make("h_ak4pf_numConst" ,"",100, 0, 100); + h_ak4pf_numNeuPar = fs->make("h_ak4pf_numNeuPar" ,"",100, 0, 100); + h_ak4pf_chm = fs->make("h_ak4pf_chm" ,"",100, 0, 100); + + h_ak8miniAOD_pt = fs->make("h_ak8miniAOD_pt" ,"",100,0,3000); + h_ak8miniAOD_mass = fs->make("h_ak8miniAOD_mass" ,"",100,0,500); + h_ak8miniAOD_eta = fs->make("h_ak8miniAOD_eta" ,"",100,-5, 5); + h_ak8miniAOD_phi = fs->make("h_ak8miniAOD_phi" ,"",100,-5, 5); + h_ak8miniAOD_CHSPrunedMass = fs->make("h_ak8miniAOD_CHSPrunedMass" ,"",100,0,500); + h_ak8miniAOD_CHSSoftDropMass = fs->make("h_ak8miniAOD_CHSSoftDropMass" ,"",100,0,500); + h_ak8miniAOD_PuppiSoftDropMass = fs->make("h_ak8miniAOD_PuppiSoftDropMass" ,"",100,0,500); + h_ak8miniAOD_PuppiTau1 = fs->make("h_ak8miniAOD_PuppiTau1" ,"",100,0, 1); + h_ak8miniAOD_PuppiTau2 = fs->make("h_ak8miniAOD_PuppiTau2" ,"",100,0, 1); + h_ak8miniAOD_PuppiTau3 = fs->make("h_ak8miniAOD_PuppiTau3" ,"",100,0, 1); + h_ak8miniAOD_PuppiTau4 = fs->make("h_ak8miniAOD_PuppiTau4" ,"",100,0, 1); + h_ak8miniAOD_PuppiTau32 = fs->make("h_ak8miniAOD_PuppiTau32" ,"",100,0, 1); + h_ak8miniAOD_PuppiTau21 = fs->make("h_ak8miniAOD_PuppiTau21" ,"",100,0, 1); + h_ak8miniAOD_CHSTau1 = fs->make("h_ak8miniAOD_CHSTau1" ,"",100,0, 1); + h_ak8miniAOD_CHSTau2 = fs->make("h_ak8miniAOD_CHSTau2" ,"",100,0, 1); + h_ak8miniAOD_CHSTau3 = fs->make("h_ak8miniAOD_CHSTau3" ,"",100,0, 1); + h_ak8miniAOD_CHSTau4 = fs->make("h_ak8miniAOD_CHSTau4" ,"",100,0, 1); + h_ak8miniAOD_CHSTau32 = fs->make("h_ak8miniAOD_CHSTau32" ,"",100,0, 1); + h_ak8miniAOD_CHSTau21 = fs->make("h_ak8miniAOD_CHSTau21" ,"",100,0, 1); + h_ak8miniAOD_PuppiECFnb1N2 = fs->make("h_ak8miniAOD_PuppiECFnb1N2" ,"",100,-1, 1); + h_ak8miniAOD_PuppiECFnb1N3 = fs->make("h_ak8miniAOD_PuppiECFnb1N3" ,"",100,-1, 1); + h_ak8miniAOD_PuppiECFnb2N2 = fs->make("h_ak8miniAOD_PuppiECFnb2N2" ,"",100,-1, 1); + h_ak8miniAOD_PuppiECFnb2N3 = fs->make("h_ak8miniAOD_PuppiECFnb2N3" ,"",100,-1, 1); + h_ak8miniAOD_area = fs->make("h_ak8miniAOD_area" ,"",100,0, 8); + h_ak8miniAOD_ndau = fs->make("h_ak8miniAOD_ndau" ,"",300,0,300); + h_ak8miniAOD_subjetMass = fs->make("h_ak8miniAOD_subjetMass" ,"",100,0,400); + h_ak8miniAOD_subjetPt = fs->make("h_ak8miniAOD_subjetPt" ,"",100,0,3000); + h_ak8miniAOD_subjetEta = fs->make("h_ak8miniAOD_subjetEta" ,"",100,-5, 5); + h_ak8miniAOD_subjetPhi = fs->make("h_ak8miniAOD_subjetPhi" ,"",100,-5, 5); + h_ak8miniAOD_subjetBdisc = fs->make("h_ak8miniAOD_subjetBdisc" ,"",100,0, 1); + + + + h_ak8puppiupdated_pt = fs->make("h_ak8puppiupdated_pt" ,"",100,0,3000); + h_ak8puppiupdated_mass = fs->make("h_ak8puppiupdated_mass" ,"",100,0,500); + h_ak8puppiupdated_eta = fs->make("h_ak8puppiupdated_eta" ,"",100,-5, 5); + h_ak8puppiupdated_phi = fs->make("h_ak8puppiupdated_phi" ,"",100,-5, 5); + h_ak8puppiupdated_CHSPrunedMass = fs->make("h_ak8puppiupdated_CHSPrunedMass" ,"",100,0,500); + h_ak8puppiupdated_CHSSoftDropMass = fs->make("h_ak8puppiupdated_CHSSoftDropMass" ,"",100,0,500); + h_ak8puppiupdated_PuppiSoftDropMass = fs->make("h_ak8puppiupdated_PuppiSoftDropMass" ,"",100,0,500); + h_ak8puppiupdated_PuppiTau1 = fs->make("h_ak8puppiupdated_PuppiTau1" ,"",100,0, 1); + h_ak8puppiupdated_PuppiTau2 = fs->make("h_ak8puppiupdated_PuppiTau2" ,"",100,0, 1); + h_ak8puppiupdated_PuppiTau3 = fs->make("h_ak8puppiupdated_PuppiTau3" ,"",100,0, 1); + h_ak8puppiupdated_PuppiTau4 = fs->make("h_ak8puppiupdated_PuppiTau4" ,"",100,0, 1); + h_ak8puppiupdated_PuppiTau32 = fs->make("h_ak8puppiupdated_PuppiTau32" ,"",100,0, 1); + h_ak8puppiupdated_PuppiTau21 = fs->make("h_ak8puppiupdated_PuppiTau21" ,"",100,0, 1); + h_ak8puppiupdated_CHSTau1 = fs->make("h_ak8puppiupdated_CHSTau1" ,"",100,0, 1); + h_ak8puppiupdated_CHSTau2 = fs->make("h_ak8puppiupdated_CHSTau2" ,"",100,0, 1); + h_ak8puppiupdated_CHSTau3 = fs->make("h_ak8puppiupdated_CHSTau3" ,"",100,0, 1); + h_ak8puppiupdated_CHSTau4 = fs->make("h_ak8puppiupdated_CHSTau4" ,"",100,0, 1); + h_ak8puppiupdated_CHSTau32 = fs->make("h_ak8puppiupdated_CHSTau32" ,"",100,0, 1); + h_ak8puppiupdated_CHSTau21 = fs->make("h_ak8puppiupdated_CHSTau21" ,"",100,0, 1); + h_ak8puppiupdated_PuppiECFnb1N2 = fs->make("h_ak8puppiupdated_PuppiECFnb1N2" ,"",100,-1, 1); + h_ak8puppiupdated_PuppiECFnb1N3 = fs->make("h_ak8puppiupdated_PuppiECFnb1N3" ,"",100,-1, 1); + h_ak8puppiupdated_PuppiECFnb2N2 = fs->make("h_ak8puppiupdated_PuppiECFnb2N2" ,"",100,-1, 1); + h_ak8puppiupdated_PuppiECFnb2N3 = fs->make("h_ak8puppiupdated_PuppiECFnb2N3" ,"",100,-1, 1); + h_ak8puppiupdated_area = fs->make("h_ak8puppiupdated_area" ,"",100,0, 8); + h_ak8puppiupdated_doubleB = fs->make("h_ak8puppiupdated_doubleB" ,"",100,0, 1); + h_ak8puppiupdated_deepDoubleBvLQCD = fs->make("h_ak8puppiupdated_deepDoubleBvLQCD" ,"",100,0, 1); + h_ak8puppiupdated_deepDoubleBvLHbb = fs->make("h_ak8puppiupdated_deepDoubleBvLHbb" ,"",100,0, 1); + h_ak8puppiupdated_deepDoubleCvLQCD = fs->make("h_ak8puppiupdated_deepDoubleCvLQCD" ,"",100,0, 1); + h_ak8puppiupdated_deepDoubleCvLHcc = fs->make("h_ak8puppiupdated_deepDoubleCvLHcc" ,"",100,0, 1); + h_ak8puppiupdated_deepDoubleCvBHbb = fs->make("h_ak8puppiupdated_deepDoubleCvBHbb" ,"",100,0, 1); + h_ak8puppiupdated_deepDoubleCvBHcc = fs->make("h_ak8puppiupdated_deepDoubleCvBHcc" ,"",100,0, 1); + h_ak8puppiupdated_deepBoostedJetbbvsl = fs->make("h_ak8puppiupdated_deepBoostedJetbbvsl" ,"",100,0, 1); + h_ak8puppiupdated_deepBoostedJetccvsl = fs->make("h_ak8puppiupdated_deepBoostedJetccvsl" ,"",100,0, 1); + h_ak8puppiupdated_deepBoostedJetTvsQCD = fs->make("h_ak8puppiupdated_deepBoostedJetTvsQCD" ,"",100,0, 1); + h_ak8puppiupdated_deepBoostedJetZHccvsQCD = fs->make("h_ak8puppiupdated_deepBoostedJetZHccvsQCD" ,"",100,0, 1); + h_ak8puppiupdated_deepBoostedJetWvsQCD = fs->make("h_ak8puppiupdated_deepBoostedJetWvsQCD" ,"",100,0, 1); + h_ak8puppiupdated_deepBoostedJetZHbbvsQCD = fs->make("h_ak8puppiupdated_deepBoostedJetZHbbvsQCD" ,"",100,0, 1); + h_ak8puppiupdated_ndau = fs->make("h_ak8puppiupdated_ndau" ,"",300,0,300); + h_ak8puppiupdated_subjetMass = fs->make("h_ak8puppiupdated_subjetMass" ,"",100,0,400); + h_ak8puppiupdated_subjetPt = fs->make("h_ak8puppiupdated_subjetPt" ,"",100,0,3000); + h_ak8puppiupdated_subjetEta = fs->make("h_ak8puppiupdated_subjetEta" ,"",100,-5, 5); + h_ak8puppiupdated_subjetPhi = fs->make("h_ak8puppiupdated_subjetPhi" ,"",100,-5, 5); + h_ak8puppiupdated_subjetBdisc = fs->make("h_ak8puppiupdated_subjetBdisc" ,"",100,0, 1); h_ak8puppi_pt = fs->make("h_ak8puppi_pt" ,"",100,0,3000); h_ak8puppi_mass = fs->make("h_ak8puppi_mass" ,"",100,0,500); - h_ak8puppi_rapidity = fs->make("h_ak8puppi_rapidity" ,"",100,-5, 5); - h_ak8puppi_prunedMass = fs->make("h_ak8puppi_prunedMass" ,"",100,0,500); - h_ak8puppi_trimmedMass = fs->make("h_ak8puppi_trimmedMass" ,"",100,0,500); - h_ak8puppi_filteredMass = fs->make("h_ak8puppi_filteredMass" ,"",100,0,500); - h_ak8puppi_softDropMass = fs->make("h_ak8puppi_softDropMass" ,"",100,0,500); - h_ak8puppi_tau1 = fs->make("h_ak8puppi_tau1" ,"",100,0, 1); - h_ak8puppi_tau2 = fs->make("h_ak8puppi_tau2" ,"",100,0, 1); - h_ak8puppi_tau3 = fs->make("h_ak8puppi_tau3" ,"",100,0, 1); - h_ak8puppi_tau4 = fs->make("h_ak8puppi_tau4" ,"",100,0, 1); - h_ak8puppi_tau32 = fs->make("h_ak8puppi_tau32" ,"",100,0, 1); - h_ak8puppi_tau21 = fs->make("h_ak8puppi_tau21" ,"",100,0, 1); + h_ak8puppi_eta = fs->make("h_ak8puppi_eta" ,"",100,-5, 5); + h_ak8puppi_phi = fs->make("h_ak8puppi_phi" ,"",100,-5, 5); + h_ak8puppi_PrunedMass = fs->make("h_ak8puppi_PrunedMass" ,"",100,0,500); + h_ak8puppi_SoftDropMass = fs->make("h_ak8puppi_SoftDropMass" ,"",100,0,500); + h_ak8puppi_FilteredMass = fs->make("h_ak8puppi_FilteredMass" ,"",100,0,500); + h_ak8puppi_TrimmedMass = fs->make("h_ak8puppi_TrimmedMass" ,"",100,0,500); + h_ak8puppi_Tau1 = fs->make("h_ak8puppi_Tau1" ,"",100,0, 1); + h_ak8puppi_Tau2 = fs->make("h_ak8puppi_Tau2" ,"",100,0, 1); + h_ak8puppi_Tau3 = fs->make("h_ak8puppi_Tau3" ,"",100,0, 1); + h_ak8puppi_Tau4 = fs->make("h_ak8puppi_Tau4" ,"",100,0, 1); + h_ak8puppi_Tau32 = fs->make("h_ak8puppi_Tau32" ,"",100,0, 1); + h_ak8puppi_Tau21 = fs->make("h_ak8puppi_Tau21" ,"",100,0, 1); + h_ak8puppi_ECFnb1N2 = fs->make("h_ak8puppi_ECFnb1N2" ,"",100,-1, 1); + h_ak8puppi_ECFnb1N3 = fs->make("h_ak8puppi_ECFnb1N3" ,"",100,-1, 1); + h_ak8puppi_area = fs->make("h_ak8puppi_area" ,"",100,0, 8); + h_ak8puppi_doubleB = fs->make("h_ak8puppi_doubleB" ,"",100,0, 1); h_ak8puppi_ndau = fs->make("h_ak8puppi_ndau" ,"",300,0,300); h_ak8puppi_subjetMass = fs->make("h_ak8puppi_subjetMass" ,"",100,0,400); - h_ak8puppi_area = fs->make("h_ak8puppi_area" ,"",100,0, 8); - h_ak8puppi_pt200_mass = fs->make("h_ak8puppi_pt200_mass" ,"",100,0,500); - h_ak8puppi_pt200_prunedMass = fs->make("h_ak8puppi_pt200_prunedMass" ,"",100,0,500); - h_ak8puppi_pt200_trimmedMass = fs->make("h_ak8puppi_pt200_trimmedMass" ,"",100,0,500); - h_ak8puppi_pt200_filteredMass = fs->make("h_ak8puppi_pt200_filteredMass" ,"",100,0,500); - h_ak8puppi_pt200_softDropMass = fs->make("h_ak8puppi_pt200_softDropMass" ,"",100,0,500); - h_ak8puppi_pt200_tau32 = fs->make("h_ak8puppi_pt200_tau32" ,"",100,0, 1); - h_ak8puppi_pt200_tau21 = fs->make("h_ak8puppi_pt200_tau21" ,"",100,0, 1); - h_ak8puppi_pt200_subjetMass = fs->make("h_ak8puppi_pt200_subjetMass" ,"",100,0,400); - h_ak8puppi_pt500_mass = fs->make("h_ak8puppi_pt500_mass" ,"",100,0,500); - h_ak8puppi_pt500_prunedMass = fs->make("h_ak8puppi_pt500_prunedMass" ,"",100,0,500); - h_ak8puppi_pt500_trimmedMass = fs->make("h_ak8puppi_pt500_trimmedMass" ,"",100,0,500); - h_ak8puppi_pt500_filteredMass = fs->make("h_ak8puppi_pt500_filteredMass" ,"",100,0,500); - h_ak8puppi_pt500_softDropMass = fs->make("h_ak8puppi_pt500_softDropMass" ,"",100,0,500); - h_ak8puppi_pt500_tau32 = fs->make("h_ak8puppi_pt500_tau32" ,"",100,0, 1); - h_ak8puppi_pt500_tau21 = fs->make("h_ak8puppi_pt500_tau21" ,"",100,0, 1); - h_ak8puppi_pt500_subjetMass = fs->make("h_ak8puppi_pt500_subjetMass" ,"",100,0,400); + h_ak8puppi_subjetPt = fs->make("h_ak8puppi_subjetPt" ,"",100,0,3000); + h_ak8puppi_subjetEta = fs->make("h_ak8puppi_subjetEta" ,"",100,-5, 5); + h_ak8puppi_subjetPhi = fs->make("h_ak8puppi_subjetPhi" ,"",100,-5, 5); + h_ak8puppi_subjetBdisc = fs->make("h_ak8puppi_subjetBdisc" ,"",100,0, 1); + h_ak8chs_pt = fs->make("h_ak8chs_pt" ,"",100,0,3000); + h_ak8chs_mass = fs->make("h_ak8chs_mass" ,"",100,0,500); + h_ak8chs_eta = fs->make("h_ak8chs_eta" ,"",100,-5, 5); + h_ak8chs_phi = fs->make("h_ak8chs_phi" ,"",100,-5, 5); + h_ak8chs_PrunedMass = fs->make("h_ak8chs_PrunedMass" ,"",100,0,500); + h_ak8chs_SoftDropMass = fs->make("h_ak8chs_SoftDropMass" ,"",100,0,500); + h_ak8chs_FilteredMass = fs->make("h_ak8chs_FilteredMass" ,"",100,0,500); + h_ak8chs_TrimmedMass = fs->make("h_ak8chs_TrimmedMass" ,"",100,0,500); + h_ak8chs_Tau1 = fs->make("h_ak8chs_Tau1" ,"",100,0, 1); + h_ak8chs_Tau2 = fs->make("h_ak8chs_Tau2" ,"",100,0, 1); + h_ak8chs_Tau3 = fs->make("h_ak8chs_Tau3" ,"",100,0, 1); + h_ak8chs_Tau4 = fs->make("h_ak8chs_Tau4" ,"",100,0, 1); + h_ak8chs_Tau32 = fs->make("h_ak8chs_Tau32" ,"",100,0, 1); + h_ak8chs_Tau21 = fs->make("h_ak8chs_Tau21" ,"",100,0, 1); + h_ak8chs_area = fs->make("h_ak8chs_area" ,"",100,0, 8); + h_ak8chs_doubleB = fs->make("h_ak8chs_doubleB" ,"",100,0, 1); + h_ak8chs_ndau = fs->make("h_ak8chs_ndau" ,"",300,0,300); + h_ak8chs_subjetMass = fs->make("h_ak8chs_subjetMass" ,"",100,0,400); + h_ak8chs_subjetPt = fs->make("h_ak8chs_subjetPt" ,"",100,0,3000); + h_ak8chs_subjetEta = fs->make("h_ak8chs_subjetEta" ,"",100,-5, 5); + h_ak8chs_subjetPhi = fs->make("h_ak8chs_subjetPhi" ,"",100,-5, 5); + h_ak8chs_subjetBdisc = fs->make("h_ak8chs_subjetBdisc" ,"",100,0, 1); + + h_ca8chs_pt = fs->make("h_ca8chs_pt" ,"",100,0,3000); + h_ca8chs_mass = fs->make("h_ca8chs_mass" ,"",100,0,500); + h_ca8chs_eta = fs->make("h_ca8chs_eta" ,"",100,-5, 5); + h_ca8chs_phi = fs->make("h_ca8chs_phi" ,"",100,-5, 5); + h_ca8chs_PrunedMass = fs->make("h_ca8chs_PrunedMass" ,"",100,0,500); + h_ca8chs_SoftDropMass = fs->make("h_ca8chs_SoftDropMass" ,"",100,0,500); + h_ca8chs_Tau1 = fs->make("h_ca8chs_Tau1" ,"",100,0, 1); + h_ca8chs_Tau2 = fs->make("h_ca8chs_Tau2" ,"",100,0, 1); + h_ca8chs_Tau3 = fs->make("h_ca8chs_Tau3" ,"",100,0, 1); + h_ca8chs_Tau4 = fs->make("h_ca8chs_Tau4" ,"",100,0, 1); + h_ca8chs_Tau32 = fs->make("h_ca8chs_Tau32" ,"",100,0, 1); + h_ca8chs_Tau21 = fs->make("h_ca8chs_Tau21" ,"",100,0, 1); + h_ca8chs_area = fs->make("h_ca8chs_area" ,"",100,0, 8); + h_ca8chs_doubleB = fs->make("h_ca8chs_doubleB" ,"",100,0, 1); + h_ca8chs_ndau = fs->make("h_ca8chs_ndau" ,"",300,0,300); + h_ca8chs_subjetMass = fs->make("h_ca8chs_subjetMass" ,"",100,0,400); + h_ca8chs_subjetPt = fs->make("h_ca8chs_subjetPt" ,"",100,0,3000); + h_ca8chs_subjetEta = fs->make("h_ca8chs_subjetEta" ,"",100,-5, 5); + h_ca8chs_subjetPhi = fs->make("h_ca8chs_subjetPhi" ,"",100,-5, 5); + h_ca8chs_subjetBdisc = fs->make("h_ca8chs_subjetBdisc" ,"",100,0, 1); h_kt8chs_pt = fs->make("h_kt8chs_pt" ,"",100,0,3000); h_kt8chs_mass = fs->make("h_kt8chs_mass" ,"",100,0,500); - h_kt8chs_rapidity = fs->make("h_kt8chs_rapidity" ,"",100,-5, 5); - h_kt8chs_prunedMass = fs->make("h_kt8chs_prunedMass" ,"",100,0,500); - h_kt8chs_trimmedMass = fs->make("h_kt8chs_trimmedMass" ,"",100,0,500); - h_kt8chs_filteredMass = fs->make("h_kt8chs_filteredMass" ,"",100,0,500); - h_kt8chs_softDropMass = fs->make("h_kt8chs_softDropMass" ,"",100,0,500); - h_kt8chs_tau1 = fs->make("h_kt8chs_tau1" ,"",100,0, 1); - h_kt8chs_tau2 = fs->make("h_kt8chs_tau2" ,"",100,0, 1); - h_kt8chs_tau3 = fs->make("h_kt8chs_tau3" ,"",100,0, 1); - h_kt8chs_tau4 = fs->make("h_kt8chs_tau4" ,"",100,0, 1); - h_kt8chs_tau32 = fs->make("h_kt8chs_tau32" ,"",100,0, 1); - h_kt8chs_tau21 = fs->make("h_kt8chs_tau21" ,"",100,0, 1); + h_kt8chs_eta = fs->make("h_kt8chs_eta" ,"",100,-5, 5); + h_kt8chs_phi = fs->make("h_kt8chs_phi" ,"",100,-5, 5); + h_kt8chs_PrunedMass = fs->make("h_kt8chs_PrunedMass" ,"",100,0,500); + h_kt8chs_SoftDropMass = fs->make("h_kt8chs_SoftDropMass" ,"",100,0,500); + h_kt8chs_Tau1 = fs->make("h_kt8chs_Tau1" ,"",100,0, 1); + h_kt8chs_Tau2 = fs->make("h_kt8chs_Tau2" ,"",100,0, 1); + h_kt8chs_Tau3 = fs->make("h_kt8chs_Tau3" ,"",100,0, 1); + h_kt8chs_Tau4 = fs->make("h_kt8chs_Tau4" ,"",100,0, 1); + h_kt8chs_Tau32 = fs->make("h_kt8chs_Tau32" ,"",100,0, 1); + h_kt8chs_Tau21 = fs->make("h_kt8chs_Tau21" ,"",100,0, 1); + h_kt8chs_area = fs->make("h_kt8chs_area" ,"",100,0, 8); + h_kt8chs_doubleB = fs->make("h_kt8chs_doubleB" ,"",100,0, 1); h_kt8chs_ndau = fs->make("h_kt8chs_ndau" ,"",300,0,300); h_kt8chs_subjetMass = fs->make("h_kt8chs_subjetMass" ,"",100,0,400); - h_kt8chs_area = fs->make("h_kt8chs_area" ,"",100,0, 8); - h_kt8chs_pt200_mass = fs->make("h_kt8chs_pt200_mass" ,"",100,0,500); - h_kt8chs_pt200_prunedMass = fs->make("h_kt8chs_pt200_prunedMass" ,"",100,0,500); - h_kt8chs_pt200_trimmedMass = fs->make("h_kt8chs_pt200_trimmedMass" ,"",100,0,500); - h_kt8chs_pt200_filteredMass = fs->make("h_kt8chs_pt200_filteredMass" ,"",100,0,500); - h_kt8chs_pt200_softDropMass = fs->make("h_kt8chs_pt200_softDropMass" ,"",100,0,500); - h_kt8chs_pt200_tau32 = fs->make("h_kt8chs_pt200_tau32" ,"",100,0, 1); - h_kt8chs_pt200_tau21 = fs->make("h_kt8chs_pt200_tau21" ,"",100,0, 1); - h_kt8chs_pt200_subjetMass = fs->make("h_kt8chs_pt200_subjetMass" ,"",100,0,400); - h_kt8chs_pt500_mass = fs->make("h_kt8chs_pt500_mass" ,"",100,0,500); - h_kt8chs_pt500_prunedMass = fs->make("h_kt8chs_pt500_prunedMass" ,"",100,0,500); - h_kt8chs_pt500_trimmedMass = fs->make("h_kt8chs_pt500_trimmedMass" ,"",100,0,500); - h_kt8chs_pt500_filteredMass = fs->make("h_kt8chs_pt500_filteredMass" ,"",100,0,500); - h_kt8chs_pt500_softDropMass = fs->make("h_kt8chs_pt500_softDropMass" ,"",100,0,500); - h_kt8chs_pt500_tau32 = fs->make("h_kt8chs_pt500_tau32" ,"",100,0, 1); - h_kt8chs_pt500_tau21 = fs->make("h_kt8chs_pt500_tau21" ,"",100,0, 1); - h_kt8chs_pt500_subjetMass = fs->make("h_kt8chs_pt500_subjetMass" ,"",100,0,400); + h_kt8chs_subjetPt = fs->make("h_kt8chs_subjetPt" ,"",100,0,3000); + h_kt8chs_subjetEta = fs->make("h_kt8chs_subjetEta" ,"",100,-5, 5); + h_kt8chs_subjetPhi = fs->make("h_kt8chs_subjetPhi" ,"",100,-5, 5); + h_kt8chs_subjetBdisc = fs->make("h_kt8chs_subjetBdisc" ,"",100,0, 1); + + h_ak8puppimodsd_pt = fs->make("h_ak8puppimodsd_pt" ,"",100,0,3000); + h_ak8puppimodsd_mass = fs->make("h_ak8puppimodsd_mass" ,"",100,0,500); + h_ak8puppimodsd_eta = fs->make("h_ak8puppimodsd_eta" ,"",100,-5, 5); + h_ak8puppimodsd_phi = fs->make("h_ak8puppimodsd_phi" ,"",100,-5, 5); + h_ak8puppimodsd_SoftDropMass = fs->make("h_ak8puppimodsd_SoftDropMass" ,"",100,0,500); + + h_ak8sk_pt = fs->make("h_ak8sk_pt" ,"",100,0,3000); + h_ak8sk_mass = fs->make("h_ak8sk_mass" ,"",100,0,500); + h_ak8sk_eta = fs->make("h_ak8sk_eta" ,"",100,-5, 5); + h_ak8sk_phi = fs->make("h_ak8sk_phi" ,"",100,-5, 5); + h_ak8sk_SoftDropMass = fs->make("h_ak8sk_SoftDropMass" ,"",100,0,500); + + + + + + + - h_ca8chs_pt = fs->make("h_ca8chs_pt" ,"",100,0,3000); - h_ca8chs_mass = fs->make("h_ca8chs_mass" ,"",100,0,500); - h_ca8chs_rapidity = fs->make("h_ca8chs_rapidity" ,"",100,-5, 5); - h_ca8chs_prunedMass = fs->make("h_ca8chs_prunedMass" ,"",100,0,500); - h_ca8chs_trimmedMass = fs->make("h_ca8chs_trimmedMass" ,"",100,0,500); - h_ca8chs_filteredMass = fs->make("h_ca8chs_filteredMass" ,"",100,0,500); - h_ca8chs_softDropMass = fs->make("h_ca8chs_softDropMass" ,"",100,0,500); - h_ca8chs_tau1 = fs->make("h_ca8chs_tau1" ,"",100,0, 1); - h_ca8chs_tau2 = fs->make("h_ca8chs_tau2" ,"",100,0, 1); - h_ca8chs_tau3 = fs->make("h_ca8chs_tau3" ,"",100,0, 1); - h_ca8chs_tau4 = fs->make("h_ca8chs_tau4" ,"",100,0, 1); - h_ca8chs_tau32 = fs->make("h_ca8chs_tau32" ,"",100,0, 1); - h_ca8chs_tau21 = fs->make("h_ca8chs_tau21" ,"",100,0, 1); - h_ca8chs_ndau = fs->make("h_ca8chs_ndau" ,"",300,0,300); - h_ca8chs_subjetMass = fs->make("h_ca8chs_subjetMass" ,"",100,0,400); - h_ca8chs_area = fs->make("h_ca8chs_area" ,"",100,0, 8); - h_ca8chs_pt200_mass = fs->make("h_ca8chs_pt200_mass" ,"",100,0,500); - h_ca8chs_pt200_prunedMass = fs->make("h_ca8chs_pt200_prunedMass" ,"",100,0,500); - h_ca8chs_pt200_trimmedMass = fs->make("h_ca8chs_pt200_trimmedMass" ,"",100,0,500); - h_ca8chs_pt200_filteredMass = fs->make("h_ca8chs_pt200_filteredMass" ,"",100,0,500); - h_ca8chs_pt200_softDropMass = fs->make("h_ca8chs_pt200_softDropMass" ,"",100,0,500); - h_ca8chs_pt200_tau32 = fs->make("h_ca8chs_pt200_tau32" ,"",100,0, 1); - h_ca8chs_pt200_tau21 = fs->make("h_ca8chs_pt200_tau21" ,"",100,0, 1); - h_ca8chs_pt200_subjetMass = fs->make("h_ca8chs_pt200_subjetMass" ,"",100,0,400); - h_ca8chs_pt500_mass = fs->make("h_ca8chs_pt500_mass" ,"",100,0,500); - h_ca8chs_pt500_prunedMass = fs->make("h_ca8chs_pt500_prunedMass" ,"",100,0,500); - h_ca8chs_pt500_trimmedMass = fs->make("h_ca8chs_pt500_trimmedMass" ,"",100,0,500); - h_ca8chs_pt500_filteredMass = fs->make("h_ca8chs_pt500_filteredMass" ,"",100,0,500); - h_ca8chs_pt500_softDropMass = fs->make("h_ca8chs_pt500_softDropMass" ,"",100,0,500); - h_ca8chs_pt500_tau32 = fs->make("h_ca8chs_pt500_tau32" ,"",100,0, 1); - h_ca8chs_pt500_tau21 = fs->make("h_ca8chs_pt500_tau21" ,"",100,0, 1); - h_ca8chs_pt500_subjetMass = fs->make("h_ca8chs_pt500_subjetMass" ,"",100,0,400); - - - - h_ak12chs_pt = fs->make("h_ak12chs_pt" ,"",100,0,3000); - h_ak12chs_mass = fs->make("h_ak12chs_mass" ,"",100,0,500); - h_ak12chs_rapidity = fs->make("h_ak12chs_rapidity" ,"",100,-5, 5); - h_ak12chs_prunedMass = fs->make("h_ak12chs_prunedMass" ,"",100,0,500); - h_ak12chs_trimmedMass = fs->make("h_ak12chs_trimmedMass" ,"",100,0,500); - h_ak12chs_filteredMass = fs->make("h_ak12chs_filteredMass" ,"",100,0,500); - h_ak12chs_softDropMass = fs->make("h_ak12chs_softDropMass" ,"",100,0,500); - h_ak12chs_tau1 = fs->make("h_ak12chs_tau1" ,"",100,0, 1); - h_ak12chs_tau2 = fs->make("h_ak12chs_tau2" ,"",100,0, 1); - h_ak12chs_tau3 = fs->make("h_ak12chs_tau3" ,"",100,0, 1); - h_ak12chs_tau4 = fs->make("h_ak12chs_tau4" ,"",100,0, 1); - h_ak12chs_tau32 = fs->make("h_ak12chs_tau32" ,"",100,0, 1); - h_ak12chs_tau21 = fs->make("h_ak12chs_tau21" ,"",100,0, 1); - h_ak12chs_ndau = fs->make("h_ak12chs_ndau" ,"",300,0,300); - h_ak12chs_subjetMass = fs->make("h_ak12chs_subjetMass" ,"",100,0,400); - h_ak12chs_area = fs->make("h_ak12chs_area" ,"",100,0, 8); - h_ak12chs_pt200_mass = fs->make("h_ak12chs_pt200_mass" ,"",100,0,500); - h_ak12chs_pt200_prunedMass = fs->make("h_ak12chs_pt200_prunedMass" ,"",100,0,500); - h_ak12chs_pt200_trimmedMass = fs->make("h_ak12chs_pt200_trimmedMass" ,"",100,0,500); - h_ak12chs_pt200_filteredMass = fs->make("h_ak12chs_pt200_filteredMass" ,"",100,0,500); - h_ak12chs_pt200_softDropMass = fs->make("h_ak12chs_pt200_softDropMass" ,"",100,0,500); - h_ak12chs_pt200_tau32 = fs->make("h_ak12chs_pt200_tau32" ,"",100,0, 1); - h_ak12chs_pt200_tau21 = fs->make("h_ak12chs_pt200_tau21" ,"",100,0, 1); - h_ak12chs_pt200_subjetMass = fs->make("h_ak12chs_pt200_subjetMass" ,"",100,0,400); - h_ak12chs_pt500_mass = fs->make("h_ak12chs_pt500_mass" ,"",100,0,500); - h_ak12chs_pt500_prunedMass = fs->make("h_ak12chs_pt500_prunedMass" ,"",100,0,500); - h_ak12chs_pt500_trimmedMass = fs->make("h_ak12chs_pt500_trimmedMass" ,"",100,0,500); - h_ak12chs_pt500_filteredMass = fs->make("h_ak12chs_pt500_filteredMass" ,"",100,0,500); - h_ak12chs_pt500_softDropMass = fs->make("h_ak12chs_pt500_softDropMass" ,"",100,0,500); - h_ak12chs_pt500_tau32 = fs->make("h_ak12chs_pt500_tau32" ,"",100,0, 1); - h_ak12chs_pt500_tau21 = fs->make("h_ak12chs_pt500_tau21" ,"",100,0, 1); - h_ak12chs_pt500_subjetMass = fs->make("h_ak12chs_pt500_subjetMass" ,"",100,0,400); h_ak15chs_pt = fs->make("h_ak15chs_pt" ,"",100,0,3000); h_ak15chs_mass = fs->make("h_ak15chs_mass" ,"",100,0,500); - h_ak15chs_rapidity = fs->make("h_ak15chs_rapidity" ,"",100,-5, 5); + h_ak15chs_eta = fs->make("h_ak15chs_eta" ,"",100,-5, 5); h_ak15chs_prunedMass = fs->make("h_ak15chs_prunedMass" ,"",100,0,500); h_ak15chs_trimmedMass = fs->make("h_ak15chs_trimmedMass" ,"",100,0,500); h_ak15chs_filteredMass = fs->make("h_ak15chs_filteredMass" ,"",100,0,500); @@ -692,413 +822,435 @@ JetTester::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) using namespace pat; bool verbose = false; + //-------------------------------------------------------------------------------------------- + // AK R=0.4 CHS jets - from miniAOD + + edm::Handle AK4CHSminiAOD; + iEvent.getByToken(ak4PFCHSminiAODjetToken_, AK4CHSminiAOD); + + int count_AK4CHSminiAOD = 0; + for (const pat::Jet &ijet : *AK4CHSminiAOD) { + count_AK4CHSminiAOD++; + if (count_AK4CHSminiAOD>=2) break; + + h_ak4chsminiAOD_pt ->Fill( ijet.pt() ); + h_ak4chsminiAOD_uncpt ->Fill( ijet.pt()*ijet.jecFactor("Uncorrected") ); + h_ak4chsminiAOD_eta ->Fill( ijet.eta() ); + h_ak4chsminiAOD_btagCSVv2 ->Fill( ijet.bDiscriminator("pfCombinedInclusiveSecondaryVertexV2BJetTags") ); + h_ak4chsminiAOD_area ->Fill( ijet.jetArea() ); + h_ak4chsminiAOD_nhf ->Fill( ijet.neutralHadronEnergyFraction() ); + h_ak4chsminiAOD_nemf ->Fill( ijet.neutralEmEnergyFraction() ); + h_ak4chsminiAOD_chf ->Fill( ijet.chargedHadronEnergyFraction() ); + h_ak4chsminiAOD_muf ->Fill( ijet.muonEnergyFraction() ); + h_ak4chsminiAOD_cemf ->Fill( ijet.chargedEmEnergyFraction() ); + h_ak4chsminiAOD_numConst ->Fill( ijet.chargedMultiplicity()+ijet.neutralMultiplicity() ); + h_ak4chsminiAOD_numNeuPar ->Fill( ijet.neutralMultiplicity() ); + h_ak4chsminiAOD_chm ->Fill( ijet.chargedMultiplicity() ); + + } + + + + //-------------------------------------------------------------------------------------------- + // AK R=0.4 Puppi jets - from miniAOD + + edm::Handle AK4PuppiminiAOD; + iEvent.getByToken(ak4PFPuppiminiAODjetToken_, AK4PuppiminiAOD); + + int count_AK4PuppiminiAOD = 0; + for (const pat::Jet &ijet : *AK4PuppiminiAOD) { + count_AK4PuppiminiAOD++; + if (count_AK4PuppiminiAOD>=2) break; + + h_ak4puppiminiAOD_pt ->Fill( ijet.pt() ); + h_ak4puppiminiAOD_uncpt ->Fill( ijet.pt()*ijet.jecFactor("Uncorrected") ); + h_ak4puppiminiAOD_eta ->Fill( ijet.eta() ); + h_ak4puppiminiAOD_btagCSVv2 ->Fill( ijet.bDiscriminator("pfCombinedInclusiveSecondaryVertexV2BJetTags") ); + h_ak4puppiminiAOD_area ->Fill( ijet.jetArea() ); + h_ak4puppiminiAOD_nhf ->Fill( ijet.neutralHadronEnergyFraction() ); + h_ak4puppiminiAOD_nemf ->Fill( ijet.neutralEmEnergyFraction() ); + h_ak4puppiminiAOD_chf ->Fill( ijet.chargedHadronEnergyFraction() ); + h_ak4puppiminiAOD_muf ->Fill( ijet.muonEnergyFraction() ); + h_ak4puppiminiAOD_cemf ->Fill( ijet.chargedEmEnergyFraction() ); + h_ak4puppiminiAOD_numConst ->Fill( ijet.chargedMultiplicity()+ijet.neutralMultiplicity() ); + h_ak4puppiminiAOD_numNeuPar ->Fill( ijet.neutralMultiplicity() ); + h_ak4puppiminiAOD_chm ->Fill( ijet.chargedMultiplicity() ); + + } + + //-------------------------------------------------------------------------------------------- + // AK R=0.4 CHS jets - update slimmedJets from toolbox + + edm::Handle AK4CHSUpdated; + iEvent.getByToken(ak4PFCHSUpdatedjetToken_, AK4CHSUpdated); + + int count_AK4CHSUpdated = 0; + for (const pat::Jet &ijet : *AK4CHSUpdated) { + count_AK4CHSUpdated++; + if (count_AK4CHSUpdated>=2) break; + + h_ak4chsupdated_pt ->Fill( ijet.pt() ); + h_ak4chsupdated_uncpt ->Fill( ijet.pt()*ijet.jecFactor("Uncorrected") ); + h_ak4chsupdated_eta ->Fill( ijet.eta() ); + h_ak4chsupdated_btagCSVv2 ->Fill( ijet.bDiscriminator("pfCombinedInclusiveSecondaryVertexV2BJetTags") ); + h_ak4chsupdated_btagCvsL ->Fill( ijet.bDiscriminator("pfCombinedCvsLJetTags") ); + h_ak4chsupdated_btagCvsB ->Fill( ijet.bDiscriminator("pfCombinedCvsBJetTags") ); + h_ak4chsupdated_btagDeepCSVb ->Fill( ijet.bDiscriminator("pfDeepCSVJetTags:probb") ); + h_ak4chsupdated_btagDeepCSVbb->Fill( ijet.bDiscriminator("pfDeepCSVJetTags:probbb") ); + h_ak4chsupdated_btagDeepCSVc ->Fill( ijet.bDiscriminator("pfDeepCSVJetTags:probc") ); + h_ak4chsupdated_btagDeepCSVl ->Fill( ijet.bDiscriminator("pfDeepCSVJetTags:probudsg") ); + h_ak4chsupdated_btagDeepFlavourb ->Fill( ijet.bDiscriminator("pfDeepFlavourJetTags:probb") ); + h_ak4chsupdated_btagDeepFlavourbb->Fill( ijet.bDiscriminator("pfDeepFlavourJetTags:probbb") ); + h_ak4chsupdated_btagDeepFlavourc ->Fill( ijet.bDiscriminator("pfDeepFlavourJetTags:probc") ); + h_ak4chsupdated_btagDeepFlavourl ->Fill( ijet.bDiscriminator("pfDeepFlavourJetTags:probuds") ); + h_ak4chsupdated_btagDeepFlavourg ->Fill( ijet.bDiscriminator("pfDeepFlavourJetTags:probg") ); + h_ak4chsupdated_btagDeepFlavourlepb->Fill( ijet.bDiscriminator("pfDeepFlavourJetTags:problepb") ); + h_ak4chsupdated_area ->Fill( ijet.jetArea() ); +// h_ak4chsupdated_pileupJetId ->Fill( ijet.userFloat("pileupJetId:fullDiscriminant") ); + h_ak4chsupdated_nhf ->Fill( ijet.neutralHadronEnergyFraction() ); + h_ak4chsupdated_nemf ->Fill( ijet.neutralEmEnergyFraction() ); + h_ak4chsupdated_chf ->Fill( ijet.chargedHadronEnergyFraction() ); + h_ak4chsupdated_muf ->Fill( ijet.muonEnergyFraction() ); + h_ak4chsupdated_cemf ->Fill( ijet.chargedEmEnergyFraction() ); + h_ak4chsupdated_numConst ->Fill( ijet.chargedMultiplicity()+ijet.neutralMultiplicity() ); + h_ak4chsupdated_numNeuPar ->Fill( ijet.neutralMultiplicity() ); + h_ak4chsupdated_chm ->Fill( ijet.chargedMultiplicity() ); + + } + + //-------------------------------------------------------------------------------------------- - // AK R=0.4 jets - from toolbox + // AK R=0.4 CHS jets - from toolbox edm::Handle AK4CHS; iEvent.getByToken(ak4PFCHSjetToken_, AK4CHS); - edm::Handle AK4CHSsub; - iEvent.getByToken(ak4PFCHSSoftDropSubjetsToken_, AK4CHSsub); - int count_AK4CHS = 0; for (const pat::Jet &ijet : *AK4CHS) { count_AK4CHS++; if (count_AK4CHS>=2) break; - double pt = ijet.pt(); - double mass = ijet.mass(); - double rapidity = ijet.rapidity(); - double prunedMass = ijet.userFloat("ak4PFJetsCHSPrunedMass"); - double trimmedMass = ijet.userFloat("ak4PFJetsCHSTrimmedMass"); - double filteredMass = ijet.userFloat("ak4PFJetsCHSFilteredMass"); - double softDropMass = ijet.userFloat("ak4PFJetsCHSSoftDropMass"); - double tau1 = ijet.userFloat("NjettinessAK4CHS:tau1"); - double tau2 = ijet.userFloat("NjettinessAK4CHS:tau2"); - double tau3 = ijet.userFloat("NjettinessAK4CHS:tau3"); - double tau4 = ijet.userFloat("NjettinessAK4CHS:tau4"); - double ndau = ijet.numberOfDaughters(); - double tau21 = 99; - double tau32 = 99; - if (tau1!=0) tau21 = tau2/tau1; - if (tau2!=0) tau32 = tau3/tau2; - - double mostMassiveSDsubjetMass = 0; - for (const pat::Jet &isub : *AK4CHSsub) { - double subjetEta = isub.eta(); - double subjetPhi = isub.phi(); - double subjetMass = isub.mass(); - double deltaRsubjetJet = deltaR(ijet.eta(), ijet.phi(), subjetEta, subjetPhi); - if (deltaRsubjetJet<0.4){ - if (verbose) cout<<"matched subjet with mass "<< subjetMass< mostMassiveSDsubjetMass) mostMassiveSDsubjetMass = subjetMass; - } - } - h_ak4chs_pt ->Fill( pt ); - h_ak4chs_mass ->Fill( mass ); - h_ak4chs_rapidity ->Fill( rapidity ); - h_ak4chs_prunedMass ->Fill( prunedMass ); - h_ak4chs_trimmedMass ->Fill( trimmedMass ); - h_ak4chs_filteredMass ->Fill( filteredMass ); - h_ak4chs_softDropMass ->Fill( softDropMass ); - h_ak4chs_tau1 ->Fill( tau1 ); - h_ak4chs_tau2 ->Fill( tau2 ); - h_ak4chs_tau3 ->Fill( tau3 ); - h_ak4chs_tau4 ->Fill( tau4 ); - h_ak4chs_tau32 ->Fill( tau32 ); - h_ak4chs_tau21 ->Fill( tau21 ); - h_ak4chs_ndau ->Fill( ndau ); - h_ak4chs_subjetMass ->Fill( mostMassiveSDsubjetMass ); + h_ak4chs_pt ->Fill( ijet.pt() ); + h_ak4chs_uncpt ->Fill( ijet.pt()*ijet.jecFactor("Uncorrected") ); + h_ak4chs_eta ->Fill( ijet.eta() ); + h_ak4chs_btagCSVv2 ->Fill( ijet.bDiscriminator("pfCombinedInclusiveSecondaryVertexV2BJetTags") ); h_ak4chs_area ->Fill( ijet.jetArea() ); + h_ak4chs_pileupJetId ->Fill( ijet.userFloat("AK4PFCHSpileupJetIdEvaluator:fullDiscriminant") ); + h_ak4chs_qglikelihood ->Fill( ijet.userFloat("QGTaggerAK4PFCHS:qgLikelihood") ); + h_ak4chs_nhf ->Fill( ijet.neutralHadronEnergyFraction() ); + h_ak4chs_nemf ->Fill( ijet.neutralEmEnergyFraction() ); + h_ak4chs_chf ->Fill( ijet.chargedHadronEnergyFraction() ); + h_ak4chs_muf ->Fill( ijet.muonEnergyFraction() ); + h_ak4chs_cemf ->Fill( ijet.chargedEmEnergyFraction() ); + h_ak4chs_numConst ->Fill( ijet.chargedMultiplicity()+ijet.neutralMultiplicity() ); + h_ak4chs_numNeuPar ->Fill( ijet.neutralMultiplicity() ); + h_ak4chs_chm ->Fill( ijet.chargedMultiplicity() ); - if (pt>200){ - h_ak4chs_pt200_mass ->Fill( mass ); - h_ak4chs_pt200_prunedMass ->Fill( prunedMass ); - h_ak4chs_pt200_trimmedMass ->Fill( trimmedMass ); - h_ak4chs_pt200_filteredMass ->Fill( filteredMass ); - h_ak4chs_pt200_softDropMass ->Fill( softDropMass ); - h_ak4chs_pt200_tau32 ->Fill( tau32 ); - h_ak4chs_pt200_tau21 ->Fill( tau21 ); - h_ak4chs_pt200_subjetMass ->Fill( mostMassiveSDsubjetMass ); - } - if (pt>500){ - h_ak4chs_pt500_mass ->Fill( mass ); - h_ak4chs_pt500_prunedMass ->Fill( prunedMass ); - h_ak4chs_pt500_trimmedMass ->Fill( trimmedMass ); - h_ak4chs_pt500_filteredMass ->Fill( filteredMass ); - h_ak4chs_pt500_softDropMass ->Fill( softDropMass ); - h_ak4chs_pt500_tau32 ->Fill( tau32 ); - h_ak4chs_pt500_tau21 ->Fill( tau21 ); - h_ak4chs_pt500_subjetMass ->Fill( mostMassiveSDsubjetMass ); - } } //-------------------------------------------------------------------------------------------- - // AK R=0.8 PF jets - from toolbox - - edm::Handle AK8PF; - iEvent.getByToken(ak8PFCHSjetToken_, AK8PF); + // AK R=0.4 Puppi jets - from toolbox + + edm::Handle AK4Puppi; + iEvent.getByToken(ak4PFPuppijetToken_, AK4Puppi); + + int count_AK4Puppi = 0; + for (const pat::Jet &ijet : *AK4Puppi) { + count_AK4Puppi++; + if (count_AK4Puppi>=2) break; + + h_ak4puppi_pt ->Fill( ijet.pt() ); + h_ak4puppi_uncpt ->Fill( ijet.pt()*ijet.jecFactor("Uncorrected") ); + h_ak4puppi_eta ->Fill( ijet.eta() ); + h_ak4puppi_btagCSVv2 ->Fill( ijet.bDiscriminator("pfCombinedInclusiveSecondaryVertexV2BJetTags") ); + h_ak4puppi_area ->Fill( ijet.jetArea() ); + h_ak4puppi_nhf ->Fill( ijet.neutralHadronEnergyFraction() ); + h_ak4puppi_nemf ->Fill( ijet.neutralEmEnergyFraction() ); + h_ak4puppi_chf ->Fill( ijet.chargedHadronEnergyFraction() ); + h_ak4puppi_muf ->Fill( ijet.muonEnergyFraction() ); + h_ak4puppi_cemf ->Fill( ijet.chargedEmEnergyFraction() ); + h_ak4puppi_numConst ->Fill( ijet.chargedMultiplicity()+ijet.neutralMultiplicity() ); + h_ak4puppi_numNeuPar ->Fill( ijet.neutralMultiplicity() ); + h_ak4puppi_chm ->Fill( ijet.chargedMultiplicity() ); - edm::Handle AK8PFsub; - iEvent.getByToken(ak8PFCHSSoftDropSubjetsToken_, AK8PFsub); + } - int count_AK8PF = 0; - for (const pat::Jet &ijet : *AK8PF) { - count_AK8PF++; - if (count_AK8PF>=2) break; - double pt = ijet.pt(); - double mass = ijet.mass(); - double rapidity = ijet.rapidity(); - double prunedMass = ijet.userFloat("ak8PFJetsCHSPrunedMass"); - double trimmedMass = ijet.userFloat("ak8PFJetsCHSTrimmedMass"); - double filteredMass = ijet.userFloat("ak8PFJetsCHSFilteredMass"); - double softDropMass = ijet.userFloat("ak8PFJetsCHSSoftDropMass"); - double tau1 = ijet.userFloat("NjettinessAK8CHS:tau1"); - double tau2 = ijet.userFloat("NjettinessAK8CHS:tau2"); - double tau3 = ijet.userFloat("NjettinessAK8CHS:tau3"); - double tau4 = ijet.userFloat("NjettinessAK8CHS:tau4"); - double ndau = ijet.numberOfDaughters(); - double tau21 = 99; - double tau32 = 99; - if (tau1!=0) tau21 = tau2/tau1; - if (tau2!=0) tau32 = tau3/tau2; - - double mostMassiveSDsubjetMass = 0; - for (const pat::Jet &isub : *AK8PFsub) { - double subjetEta = isub.eta(); - double subjetPhi = isub.phi(); - double subjetMass = isub.mass(); - double deltaRsubjetJet = deltaR(ijet.eta(), ijet.phi(), subjetEta, subjetPhi); - if (deltaRsubjetJet<0.8){ - if (verbose) cout<<"matched subjet with mass "<< subjetMass< mostMassiveSDsubjetMass) mostMassiveSDsubjetMass = subjetMass; - } - } - h_ak8pf_pt ->Fill( pt ); - h_ak8pf_mass ->Fill( mass ); - h_ak8pf_rapidity ->Fill( rapidity ); - h_ak8pf_prunedMass ->Fill( prunedMass ); - h_ak8pf_trimmedMass ->Fill( trimmedMass ); - h_ak8pf_filteredMass ->Fill( filteredMass ); - h_ak8pf_softDropMass ->Fill( softDropMass ); - h_ak8pf_tau1 ->Fill( tau1 ); - h_ak8pf_tau2 ->Fill( tau2 ); - h_ak8pf_tau3 ->Fill( tau3 ); - h_ak8pf_tau4 ->Fill( tau4 ); - h_ak8pf_tau32 ->Fill( tau32 ); - h_ak8pf_tau21 ->Fill( tau21 ); - h_ak8pf_ndau ->Fill( ndau ); - h_ak8pf_subjetMass ->Fill( mostMassiveSDsubjetMass ); - h_ak8pf_area ->Fill( ijet.jetArea() ); + //-------------------------------------------------------------------------------------------- + // AK R=0.4 PF jets - from toolbox + + edm::Handle AK4PF; + iEvent.getByToken(ak4PFjetToken_, AK4PF); + + int count_AK4PF = 0; + for (const pat::Jet &ijet : *AK4PF) { + count_AK4PF++; + if (count_AK4PF>=2) break; + + h_ak4pf_pt ->Fill( ijet.pt() ); + h_ak4pf_uncpt ->Fill( ijet.pt()*ijet.jecFactor("Uncorrected") ); + h_ak4pf_eta ->Fill( ijet.eta() ); + h_ak4pf_btagCSVv2 ->Fill( ijet.bDiscriminator("pfCombinedInclusiveSecondaryVertexV2BJetTags") ); + h_ak4pf_area ->Fill( ijet.jetArea() ); + h_ak4pf_nhf ->Fill( ijet.neutralHadronEnergyFraction() ); + h_ak4pf_nemf ->Fill( ijet.neutralEmEnergyFraction() ); + h_ak4pf_chf ->Fill( ijet.chargedHadronEnergyFraction() ); + h_ak4pf_muf ->Fill( ijet.muonEnergyFraction() ); + h_ak4pf_cemf ->Fill( ijet.chargedEmEnergyFraction() ); + h_ak4pf_numConst ->Fill( ijet.chargedMultiplicity()+ijet.neutralMultiplicity() ); + h_ak4pf_numNeuPar ->Fill( ijet.neutralMultiplicity() ); + h_ak4pf_chm ->Fill( ijet.chargedMultiplicity() ); - if (pt>200){ - h_ak8pf_pt200_mass ->Fill( mass ); - h_ak8pf_pt200_prunedMass ->Fill( prunedMass ); - h_ak8pf_pt200_trimmedMass ->Fill( trimmedMass ); - h_ak8pf_pt200_filteredMass ->Fill( filteredMass ); - h_ak8pf_pt200_softDropMass ->Fill( softDropMass ); - h_ak8pf_pt200_tau32 ->Fill( tau32 ); - h_ak8pf_pt200_tau21 ->Fill( tau21 ); - h_ak8pf_pt200_subjetMass ->Fill( mostMassiveSDsubjetMass ); - } - if (pt>500){ - h_ak8pf_pt500_mass ->Fill( mass ); - h_ak8pf_pt500_prunedMass ->Fill( prunedMass ); - h_ak8pf_pt500_trimmedMass ->Fill( trimmedMass ); - h_ak8pf_pt500_filteredMass ->Fill( filteredMass ); - h_ak8pf_pt500_softDropMass ->Fill( softDropMass ); - h_ak8pf_pt500_tau32 ->Fill( tau32 ); - h_ak8pf_pt500_tau21 ->Fill( tau21 ); - h_ak8pf_pt500_subjetMass ->Fill( mostMassiveSDsubjetMass ); - } } - //-------------------------------------------------------------------------------------------- - // AK R=0.8 CHS jets - from toolbox + // AK R=0.8 Puppi jets - default miniAOD - edm::Handle AK8CHS; - iEvent.getByToken(ak8PFCHSjetToken_, AK8CHS); + edm::Handle AK8MINI; + iEvent.getByToken(ak8PFPuppiminiAODjetToken_, AK8MINI); - edm::Handle AK8CHSsub; - iEvent.getByToken(ak8PFCHSSoftDropSubjetsToken_, AK8CHSsub); + //edm::Handle AK8GENJET; + //iEvent.getByToken(ak8genjetToken_, AK8GENJET); - int count_AK8CHS = 0; - for (const pat::Jet &ijet : *AK8CHS) { - count_AK8CHS++; - if (count_AK8CHS>=2) break; - double pt = ijet.pt(); - double mass = ijet.mass(); - double rapidity = ijet.rapidity(); - double prunedMass = ijet.userFloat("ak8PFJetsCHSPrunedMass"); - double trimmedMass = ijet.userFloat("ak8PFJetsCHSTrimmedMass"); - double filteredMass = ijet.userFloat("ak8PFJetsCHSFilteredMass"); - double softDropMass = ijet.userFloat("ak8PFJetsCHSSoftDropMass"); - double tau1 = ijet.userFloat("NjettinessAK8CHS:tau1"); - double tau2 = ijet.userFloat("NjettinessAK8CHS:tau2"); - double tau3 = ijet.userFloat("NjettinessAK8CHS:tau3"); - double tau4 = ijet.userFloat("NjettinessAK8CHS:tau4"); - double ndau = ijet.numberOfDaughters(); - double tau21 = 99; - double tau32 = 99; - if (tau1!=0) tau21 = tau2/tau1; - if (tau2!=0) tau32 = tau3/tau2; - - double mostMassiveSDsubjetMass = 0; - for (const pat::Jet &isub : *AK8CHSsub) { - double subjetEta = isub.eta(); - double subjetPhi = isub.phi(); - double subjetMass = isub.mass(); - double deltaRsubjetJet = deltaR(ijet.eta(), ijet.phi(), subjetEta, subjetPhi); - if (deltaRsubjetJet<0.8){ - if (verbose) cout<<"matched subjet with mass "<< subjetMass< mostMassiveSDsubjetMass) mostMassiveSDsubjetMass = subjetMass; - } + for (const pat::Jet &ijet : *AK8MINI) { + //if (pt<400) continue; + h_ak8miniAOD_pt ->Fill( ijet.pt() ); + h_ak8miniAOD_eta ->Fill( ijet.eta() ); + h_ak8miniAOD_phi ->Fill( ijet.phi() ); + h_ak8miniAOD_mass ->Fill( ijet.mass() ); + h_ak8miniAOD_CHSPrunedMass ->Fill( ijet.userFloat("ak8PFJetsCHSValueMap:ak8PFJetsCHSPrunedMass") ); + h_ak8miniAOD_CHSSoftDropMass ->Fill( ijet.userFloat("ak8PFJetsCHSValueMap:ak8PFJetsCHSSoftDropMass") ); + h_ak8miniAOD_PuppiSoftDropMass ->Fill( ijet.userFloat("ak8PFJetsPuppiSoftDropMass") ); + + double ak8miniAOD_PuppiTau1 = ijet.userFloat("NjettinessAK8Puppi:tau1"); + double ak8miniAOD_PuppiTau2 = ijet.userFloat("NjettinessAK8Puppi:tau2"); + double ak8miniAOD_PuppiTau3 = ijet.userFloat("NjettinessAK8Puppi:tau3"); + //double ak8miniAOD_PuppiTau4 = ijet.userFloat("NjettinessAK8Puppi:tau4"); + h_ak8miniAOD_PuppiTau1 ->Fill( ak8miniAOD_PuppiTau1 ); + h_ak8miniAOD_PuppiTau2 ->Fill( ak8miniAOD_PuppiTau2 ); + h_ak8miniAOD_PuppiTau3 ->Fill( ak8miniAOD_PuppiTau3 ); + //h_ak8miniAOD_PuppiTau4 ->Fill( ak8miniAOD_PuppiTau4 ); + h_ak8miniAOD_PuppiTau21 ->Fill( (ak8miniAOD_PuppiTau1!=0) ? ak8miniAOD_PuppiTau2/ak8miniAOD_PuppiTau1 : -999 ) ; + h_ak8miniAOD_PuppiTau32 ->Fill( (ak8miniAOD_PuppiTau2!=0) ? ak8miniAOD_PuppiTau3/ak8miniAOD_PuppiTau2 : -999 ) ; + + double ak8miniAOD_CHSTau1 = ijet.userFloat("ak8PFJetsCHSValueMap:NjettinessAK8CHSTau1"); + double ak8miniAOD_CHSTau2 = ijet.userFloat("ak8PFJetsCHSValueMap:NjettinessAK8CHSTau2"); + double ak8miniAOD_CHSTau3 = ijet.userFloat("ak8PFJetsCHSValueMap:NjettinessAK8CHSTau3"); + //double ak8miniAOD_CHSTau4 = ijet.userFloat("ak8PFJetsCHSValueMap:NjettinessAK8CHSTau4"); + h_ak8miniAOD_CHSTau1 ->Fill( ak8miniAOD_CHSTau1 ); + h_ak8miniAOD_CHSTau2 ->Fill( ak8miniAOD_CHSTau2 ); + h_ak8miniAOD_CHSTau3 ->Fill( ak8miniAOD_CHSTau3 ); + //h_ak8miniAOD_CHSTau4 ->Fill( ak8miniAOD_CHSTau4 ); + h_ak8miniAOD_CHSTau21 ->Fill( (ak8miniAOD_CHSTau1!=0) ? ak8miniAOD_CHSTau2/ak8miniAOD_CHSTau1 : -999 ) ; + h_ak8miniAOD_CHSTau32 ->Fill( (ak8miniAOD_CHSTau2!=0) ? ak8miniAOD_CHSTau3/ak8miniAOD_CHSTau2 : -999 ) ; + + /*h_ak8miniAOD_PuppiECFnb1N2 ->Fill( ijet.userFloat("ak8PFJetsPuppiSoftDropValueMap:nb1AK8PuppiSoftDropN2") ); + h_ak8miniAOD_PuppiECFnb1N3 ->Fill( ijet.userFloat("ak8PFJetsPuppiSoftDropValueMap:nb1AK8PuppiSoftDropN3") ); + h_ak8miniAOD_PuppiECFnb2N2 ->Fill( ijet.userFloat("ak8PFJetsPuppiSoftDropValueMap:nb2AK8PuppiSoftDropN2") ); + h_ak8miniAOD_PuppiECFnb2N3 ->Fill( ijet.userFloat("ak8PFJetsPuppiSoftDropValueMap:nb2AK8PuppiSoftDropN3") ); + */ + + h_ak8miniAOD_ndau ->Fill( ijet.numberOfDaughters() ); + h_ak8miniAOD_area ->Fill( ijet.jetArea() ); + + // Get Soft drop subjets for subjet b-tagging + auto const & sdSubjets = ijet.subjets("SoftDropPuppi"); + for ( auto const & it : sdSubjets ) { + h_ak8miniAOD_subjetMass ->Fill( it->mass() ); + h_ak8miniAOD_subjetPt ->Fill( it->pt() ); + h_ak8miniAOD_subjetPhi ->Fill( it->phi() ); + h_ak8miniAOD_subjetEta ->Fill( it->eta() ); + h_ak8miniAOD_subjetBdisc ->Fill( it->bDiscriminator("pfCombinedInclusiveSecondaryVertexV2BJetTags") ); } - h_ak8chs_pt ->Fill( pt ); - h_ak8chs_mass ->Fill( mass ); - h_ak8chs_rapidity ->Fill( rapidity ); - h_ak8chs_prunedMass ->Fill( prunedMass ); - h_ak8chs_trimmedMass ->Fill( trimmedMass ); - h_ak8chs_filteredMass ->Fill( filteredMass ); - h_ak8chs_softDropMass ->Fill( softDropMass ); - h_ak8chs_tau1 ->Fill( tau1 ); - h_ak8chs_tau2 ->Fill( tau2 ); - h_ak8chs_tau3 ->Fill( tau3 ); - h_ak8chs_tau4 ->Fill( tau4 ); - h_ak8chs_tau32 ->Fill( tau32 ); - h_ak8chs_tau21 ->Fill( tau21 ); - h_ak8chs_ndau ->Fill( ndau ); - h_ak8chs_subjetMass ->Fill( mostMassiveSDsubjetMass ); - h_ak8chs_area ->Fill( ijet.jetArea() ); + } - if (pt>200){ - h_ak8chs_pt200_mass ->Fill( mass ); - h_ak8chs_pt200_prunedMass ->Fill( prunedMass ); - h_ak8chs_pt200_trimmedMass ->Fill( trimmedMass ); - h_ak8chs_pt200_filteredMass ->Fill( filteredMass ); - h_ak8chs_pt200_softDropMass ->Fill( softDropMass ); - h_ak8chs_pt200_tau32 ->Fill( tau32 ); - h_ak8chs_pt200_tau21 ->Fill( tau21 ); - h_ak8chs_pt200_subjetMass ->Fill( mostMassiveSDsubjetMass ); - } - if (pt>500){ - h_ak8chs_pt500_mass ->Fill( mass ); - h_ak8chs_pt500_prunedMass ->Fill( prunedMass ); - h_ak8chs_pt500_trimmedMass ->Fill( trimmedMass ); - h_ak8chs_pt500_filteredMass ->Fill( filteredMass ); - h_ak8chs_pt500_softDropMass ->Fill( softDropMass ); - h_ak8chs_pt500_tau32 ->Fill( tau32 ); - h_ak8chs_pt500_tau21 ->Fill( tau21 ); - h_ak8chs_pt500_subjetMass ->Fill( mostMassiveSDsubjetMass ); + //-------------------------------------------------------------------------------------------- + // AK R=0.8 Puppi jets - update slimmedJetsAK8 using jetToolbox + + edm::Handle AK8Updated; + iEvent.getByToken(ak8PFPuppiUpdatedjetToken_, AK8Updated); + + //edm::Handle AK8GENJET; + //iEvent.getByToken(ak8genjetToken_, AK8GENJET); + + for (const pat::Jet &ijet : *AK8Updated) { + //if (pt<400) continue; + h_ak8puppiupdated_pt ->Fill( ijet.pt() ); + h_ak8puppiupdated_eta ->Fill( ijet.eta() ); + h_ak8puppiupdated_phi ->Fill( ijet.phi() ); + h_ak8puppiupdated_mass ->Fill( ijet.mass() ); + h_ak8puppiupdated_CHSPrunedMass ->Fill( ijet.userFloat("ak8PFJetsCHSValueMap:ak8PFJetsCHSPrunedMass") ); + h_ak8puppiupdated_CHSSoftDropMass ->Fill( ijet.userFloat("ak8PFJetsCHSValueMap:ak8PFJetsCHSSoftDropMass") ); + h_ak8puppiupdated_PuppiSoftDropMass ->Fill( ijet.userFloat("ak8PFJetsPuppiSoftDropMass") ); + + double ak8puppiupdated_PuppiTau1 = ijet.userFloat("NjettinessAK8Puppi:tau1"); + double ak8puppiupdated_PuppiTau2 = ijet.userFloat("NjettinessAK8Puppi:tau2"); + double ak8puppiupdated_PuppiTau3 = ijet.userFloat("NjettinessAK8Puppi:tau3"); + //double ak8puppiupdated_PuppiTau4 = ijet.userFloat("NjettinessAK8Puppi:tau4"); + h_ak8puppiupdated_PuppiTau1 ->Fill( ak8puppiupdated_PuppiTau1 ); + h_ak8puppiupdated_PuppiTau2 ->Fill( ak8puppiupdated_PuppiTau2 ); + h_ak8puppiupdated_PuppiTau3 ->Fill( ak8puppiupdated_PuppiTau3 ); + //h_ak8puppiupdated_PuppiTau4 ->Fill( ak8puppiupdated_PuppiTau4 ); + h_ak8puppiupdated_PuppiTau21 ->Fill( (ak8puppiupdated_PuppiTau1!=0) ? ak8puppiupdated_PuppiTau2/ak8puppiupdated_PuppiTau1 : -999 ) ; + h_ak8puppiupdated_PuppiTau32 ->Fill( (ak8puppiupdated_PuppiTau2!=0) ? ak8puppiupdated_PuppiTau3/ak8puppiupdated_PuppiTau2 : -999 ) ; + + double ak8puppiupdated_CHSTau1 = ijet.userFloat("ak8PFJetsCHSValueMap:NjettinessAK8CHSTau1"); + double ak8puppiupdated_CHSTau2 = ijet.userFloat("ak8PFJetsCHSValueMap:NjettinessAK8CHSTau2"); + double ak8puppiupdated_CHSTau3 = ijet.userFloat("ak8PFJetsCHSValueMap:NjettinessAK8CHSTau3"); + //double ak8puppiupdated_CHSTau4 = ijet.userFloat("ak8PFJetsCHSValueMap:NjettinessAK8CHSTau4"); + h_ak8puppiupdated_CHSTau1 ->Fill( ak8puppiupdated_CHSTau1 ); + h_ak8puppiupdated_CHSTau2 ->Fill( ak8puppiupdated_CHSTau2 ); + h_ak8puppiupdated_CHSTau3 ->Fill( ak8puppiupdated_CHSTau3 ); + //h_ak8puppiupdated_CHSTau4 ->Fill( ak8puppiupdated_CHSTau4 ); + h_ak8puppiupdated_CHSTau21 ->Fill( (ak8puppiupdated_CHSTau1!=0) ? ak8puppiupdated_CHSTau2/ak8puppiupdated_CHSTau1 : -999 ) ; + h_ak8puppiupdated_CHSTau32 ->Fill( (ak8puppiupdated_CHSTau2!=0) ? ak8puppiupdated_CHSTau3/ak8puppiupdated_CHSTau2 : -999 ) ; + + /*h_ak8puppiupdated_PuppiECFnb1N2 ->Fill( ijet.userFloat("ak8PFJetsPuppiSoftDropValueMap:nb1AK8PuppiSoftDropN2") ); + h_ak8puppiupdated_PuppiECFnb1N3 ->Fill( ijet.userFloat("ak8PFJetsPuppiSoftDropValueMap:nb1AK8PuppiSoftDropN3") ); + h_ak8puppiupdated_PuppiECFnb2N2 ->Fill( ijet.userFloat("ak8PFJetsPuppiSoftDropValueMap:nb2AK8PuppiSoftDropN2") ); + h_ak8puppiupdated_PuppiECFnb2N3 ->Fill( ijet.userFloat("ak8PFJetsPuppiSoftDropValueMap:nb2AK8PuppiSoftDropN3") ); + */ + + h_ak8puppiupdated_ndau ->Fill( ijet.numberOfDaughters() ); + h_ak8puppiupdated_area ->Fill( ijet.jetArea() ); + h_ak8puppiupdated_doubleB ->Fill( ijet.bDiscriminator("pfBoostedDoubleSecondaryVertexAK8BJetTags") ); + h_ak8puppiupdated_deepDoubleBvLQCD ->Fill( ijet.bDiscriminator("pfMassIndependentDeepDoubleBvLJetTags:probQCD") ); + h_ak8puppiupdated_deepDoubleBvLHbb ->Fill( ijet.bDiscriminator("pfMassIndependentDeepDoubleBvLJetTags:probHbb") ); + h_ak8puppiupdated_deepDoubleCvLQCD ->Fill( ijet.bDiscriminator("pfMassIndependentDeepDoubleCvLJetTags:probQCD") ); + h_ak8puppiupdated_deepDoubleCvLHcc ->Fill( ijet.bDiscriminator("pfMassIndependentDeepDoubleCvLJetTags:probHcc") ); + h_ak8puppiupdated_deepDoubleCvBHbb ->Fill( ijet.bDiscriminator("pfMassIndependentDeepDoubleCvBJetTags:probHbb") ); + h_ak8puppiupdated_deepDoubleCvBHcc ->Fill( ijet.bDiscriminator("pfMassIndependentDeepDoubleCvBJetTags:probHcc") ); + + // Get Soft drop subjets for subjet b-tagging + auto const & sdSubjets = ijet.subjets("SoftDropPuppi"); + for ( auto const & it : sdSubjets ) { + h_ak8puppiupdated_subjetMass ->Fill( it->mass() ); + h_ak8puppiupdated_subjetPt ->Fill( it->pt() ); + h_ak8puppiupdated_subjetPhi ->Fill( it->phi() ); + h_ak8puppiupdated_subjetEta ->Fill( it->eta() ); + h_ak8puppiupdated_subjetBdisc ->Fill( it->bDiscriminator("pfCombinedInclusiveSecondaryVertexV2BJetTags") ); } + } - //-------------------------------------------------------------------------------------------- // AK R=0.8 PUPPI jets - from toolbox - edm::Handle AK8PUPPI; - iEvent.getByToken(ak8PFPUPPIjetToken_, AK8PUPPI); - - edm::Handle AK8PUPPIsub; - iEvent.getByToken(ak8PFPUPPISoftDropSubjetsToken_, AK8PUPPIsub); + edm::Handle > AK8Puppi; + iEvent.getByToken( ak8PFPuppijetToken_, AK8Puppi ); + + for (const pat::Jet &ijet : *AK8Puppi) { + //if (pt<400) continue; + h_ak8puppi_pt ->Fill( ijet.pt() ); + h_ak8puppi_eta ->Fill( ijet.eta() ); + h_ak8puppi_phi ->Fill( ijet.phi() ); + h_ak8puppi_mass ->Fill( ijet.mass() ); + h_ak8puppi_PrunedMass ->Fill( ijet.userFloat("ak8PFJetsPuppiPrunedMass") ); + h_ak8puppi_SoftDropMass ->Fill( ijet.userFloat("ak8PFJetsPuppiSoftDropMass") ); + h_ak8puppi_FilteredMass ->Fill( ijet.userFloat("ak8PFJetsPuppiFilteredMass") ); + h_ak8puppi_TrimmedMass ->Fill( ijet.userFloat("ak8PFJetsPuppiTrimmedMass") ); + + double ak8puppiTau1 = ijet.userFloat("NjettinessAK8Puppi:tau1"); + double ak8puppiTau2 = ijet.userFloat("NjettinessAK8Puppi:tau2"); + double ak8puppiTau3 = ijet.userFloat("NjettinessAK8Puppi:tau3"); + double ak8puppiTau4 = ijet.userFloat("NjettinessAK8Puppi:tau4"); + h_ak8puppi_Tau1 ->Fill( ak8puppiTau1 ); + h_ak8puppi_Tau2 ->Fill( ak8puppiTau2 ); + h_ak8puppi_Tau3 ->Fill( ak8puppiTau3 ); + h_ak8puppi_Tau4 ->Fill( ak8puppiTau4 ); + h_ak8puppi_Tau21 ->Fill( (ak8puppiTau1!=0) ? ak8puppiTau2/ak8puppiTau1 : -999 ) ; + h_ak8puppi_Tau32 ->Fill( (ak8puppiTau2!=0) ? ak8puppiTau3/ak8puppiTau2 : -999 ) ; + + + h_ak8puppi_ECFnb1N2 ->Fill( ijet.userFloat("ak8PFJetsPuppiSoftDropValueMap:nb1AK8PuppiSoftDropN2") ); + h_ak8puppi_ECFnb1N3 ->Fill( ijet.userFloat("ak8PFJetsPuppiSoftDropValueMap:nb1AK8PuppiSoftDropN3") ); + + h_ak8puppi_ndau ->Fill( ijet.numberOfDaughters() ); + h_ak8puppi_area ->Fill( ijet.jetArea() ); + h_ak8puppi_doubleB ->Fill( ijet.bDiscriminator("pfBoostedDoubleSecondaryVertexAK8BJetTags") ); - int count_AK8PUPPI = 0; - for (const pat::Jet &ijet : *AK8PUPPI) { - count_AK8PUPPI++; - if (count_AK8PUPPI>=2) break; - double pt = ijet.pt(); - double mass = ijet.mass(); - double rapidity = ijet.rapidity(); - double prunedMass = ijet.userFloat("ak8PFJetsPuppiPrunedMass"); - double trimmedMass = ijet.userFloat("ak8PFJetsPuppiTrimmedMass"); - double filteredMass = ijet.userFloat("ak8PFJetsPuppiFilteredMass"); - double softDropMass = ijet.userFloat("ak8PFJetsPuppiSoftDropMass"); - double tau1 = ijet.userFloat("NjettinessAK8Puppi:tau1"); - double tau2 = ijet.userFloat("NjettinessAK8Puppi:tau2"); - double tau3 = ijet.userFloat("NjettinessAK8Puppi:tau3"); - double tau4 = ijet.userFloat("NjettinessAK8Puppi:tau4"); - double ndau = ijet.numberOfDaughters(); - double tau21 = 99; - double tau32 = 99; - if (tau1!=0) tau21 = tau2/tau1; - if (tau2!=0) tau32 = tau3/tau2; - - double mostMassiveSDsubjetMass = 0; - for (const pat::Jet &isub : *AK8PUPPIsub) { - double subjetEta = isub.eta(); - double subjetPhi = isub.phi(); - double subjetMass = isub.mass(); - double deltaRsubjetJet = deltaR(ijet.eta(), ijet.phi(), subjetEta, subjetPhi); - if (deltaRsubjetJet<0.8){ - if (verbose) cout<<"matched subjet with mass "<< subjetMass< mostMassiveSDsubjetMass) mostMassiveSDsubjetMass = subjetMass; - } + // Get Soft drop subjets for subjet b-tagging + auto const & sdSubjets = ijet.subjets("SoftDrop"); + for ( auto const & it : sdSubjets ) { + h_ak8puppi_subjetMass ->Fill( it->mass() ); + h_ak8puppi_subjetPt ->Fill( it->pt() ); + h_ak8puppi_subjetPhi ->Fill( it->phi() ); + h_ak8puppi_subjetEta ->Fill( it->eta() ); + h_ak8puppi_subjetBdisc ->Fill( it->bDiscriminator("pfCombinedInclusiveSecondaryVertexV2BJetTags") ); } + } - h_ak8puppi_pt ->Fill( pt ); - h_ak8puppi_mass ->Fill( mass ); - h_ak8puppi_rapidity ->Fill( rapidity ); - h_ak8puppi_prunedMass ->Fill( prunedMass ); - h_ak8puppi_trimmedMass ->Fill( trimmedMass ); - h_ak8puppi_filteredMass ->Fill( filteredMass ); - h_ak8puppi_softDropMass ->Fill( softDropMass ); - h_ak8puppi_tau1 ->Fill( tau1 ); - h_ak8puppi_tau2 ->Fill( tau2 ); - h_ak8puppi_tau3 ->Fill( tau3 ); - h_ak8puppi_tau4 ->Fill( tau4 ); - h_ak8puppi_tau32 ->Fill( tau32 ); - h_ak8puppi_tau21 ->Fill( tau21 ); - h_ak8puppi_ndau ->Fill( ndau ); - h_ak8puppi_subjetMass ->Fill( mostMassiveSDsubjetMass ); - h_ak8puppi_area ->Fill( ijet.jetArea() ); - if (pt>200){ - h_ak8puppi_pt200_mass ->Fill( mass ); - h_ak8puppi_pt200_prunedMass ->Fill( prunedMass ); - h_ak8puppi_pt200_trimmedMass ->Fill( trimmedMass ); - h_ak8puppi_pt200_filteredMass ->Fill( filteredMass ); - h_ak8puppi_pt200_softDropMass ->Fill( softDropMass ); - h_ak8puppi_pt200_tau32 ->Fill( tau32 ); - h_ak8puppi_pt200_tau21 ->Fill( tau21 ); - h_ak8puppi_pt200_subjetMass ->Fill( mostMassiveSDsubjetMass ); - } - if (pt>500){ - h_ak8puppi_pt500_mass ->Fill( mass ); - h_ak8puppi_pt500_prunedMass ->Fill( prunedMass ); - h_ak8puppi_pt500_trimmedMass ->Fill( trimmedMass ); - h_ak8puppi_pt500_filteredMass ->Fill( filteredMass ); - h_ak8puppi_pt500_softDropMass ->Fill( softDropMass ); - h_ak8puppi_pt500_tau32 ->Fill( tau32 ); - h_ak8puppi_pt500_tau21 ->Fill( tau21 ); - h_ak8puppi_pt500_subjetMass ->Fill( mostMassiveSDsubjetMass ); + //-------------------------------------------------------------------------------------------- + // AK R=0.8 CHS jets - from toolbox + + edm::Handle > AK8CHS; + iEvent.getByToken( ak8PFCHSjetToken_, AK8CHS ); + + for (const pat::Jet &ijet : *AK8CHS) { + //if (pt<400) continue; + h_ak8chs_pt ->Fill( ijet.pt() ); + h_ak8chs_eta ->Fill( ijet.eta() ); + h_ak8chs_phi ->Fill( ijet.phi() ); + h_ak8chs_mass ->Fill( ijet.mass() ); + h_ak8chs_PrunedMass ->Fill( ijet.userFloat("ak8PFJetsCHSPrunedMass") ); + h_ak8chs_SoftDropMass ->Fill( ijet.userFloat("ak8PFJetsCHSSoftDropMass") ); + h_ak8chs_FilteredMass ->Fill( ijet.userFloat("ak8PFJetsCHSFilteredMass") ); + h_ak8chs_TrimmedMass ->Fill( ijet.userFloat("ak8PFJetsCHSTrimmedMass") ); + + double ak8chsTau1 = ijet.userFloat("NjettinessAK8CHS:tau1"); + double ak8chsTau2 = ijet.userFloat("NjettinessAK8CHS:tau2"); + double ak8chsTau3 = ijet.userFloat("NjettinessAK8CHS:tau3"); + double ak8chsTau4 = ijet.userFloat("NjettinessAK8CHS:tau4"); + h_ak8chs_Tau1 ->Fill( ak8chsTau1 ); + h_ak8chs_Tau2 ->Fill( ak8chsTau2 ); + h_ak8chs_Tau3 ->Fill( ak8chsTau3 ); + h_ak8chs_Tau4 ->Fill( ak8chsTau4 ); + h_ak8chs_Tau21 ->Fill( (ak8chsTau1!=0) ? ak8chsTau2/ak8chsTau1 : -999 ) ; + h_ak8chs_Tau32 ->Fill( (ak8chsTau2!=0) ? ak8chsTau3/ak8chsTau2 : -999 ) ; + + + //h_ak8chs_ECFnb1N2 ->Fill( ijet.userFloat("ak8PFJetsCHSSoftDropValueMap:nb1AK8CHSSoftDropN2") ); + //h_ak8chs_ECFnb1N3 ->Fill( ijet.userFloat("ak8PFJetschsSoftDropValueMap:nb1AK8chsSoftDropN3") ); + + h_ak8chs_ndau ->Fill( ijet.numberOfDaughters() ); + h_ak8chs_area ->Fill( ijet.jetArea() ); + h_ak8chs_doubleB ->Fill( ijet.bDiscriminator("pfBoostedDoubleSecondaryVertexAK8BJetTags") ); + + // Get Soft drop subjets for subjet b-tagging + auto const & sdSubjets = ijet.subjets("SoftDrop"); + for ( auto const & it : sdSubjets ) { + h_ak8chs_subjetMass ->Fill( it->mass() ); + h_ak8chs_subjetPt ->Fill( it->pt() ); + h_ak8chs_subjetPhi ->Fill( it->phi() ); + h_ak8chs_subjetEta ->Fill( it->eta() ); + h_ak8chs_subjetBdisc ->Fill( it->bDiscriminator("pfCombinedInclusiveSecondaryVertexV2BJetTags") ); } } + //-------------------------------------------------------------------------------------------- // CA R=0.8 jets - from toolbox edm::Handle CA8CHS; iEvent.getByToken(ca8PFCHSjetToken_, CA8CHS); - - edm::Handle CA8CHSsub; - iEvent.getByToken(ca8PFCHSSoftDropSubjetsToken_, CA8CHSsub); - - int count_CA8CHS = 0; + for (const pat::Jet &ijet : *CA8CHS) { - count_CA8CHS++; - if (count_CA8CHS>=2) break; - double pt = ijet.pt(); - double mass = ijet.mass(); - double rapidity = ijet.rapidity(); - double prunedMass = ijet.userFloat("ca8PFJetsCHSPrunedMass"); - double trimmedMass = ijet.userFloat("ca8PFJetsCHSTrimmedMass"); - double filteredMass = ijet.userFloat("ca8PFJetsCHSFilteredMass"); - double softDropMass = ijet.userFloat("ca8PFJetsCHSSoftDropMass"); - double tau1 = ijet.userFloat("NjettinessCA8CHS:tau1"); - double tau2 = ijet.userFloat("NjettinessCA8CHS:tau2"); - double tau3 = ijet.userFloat("NjettinessCA8CHS:tau3"); - double tau4 = ijet.userFloat("NjettinessCA8CHS:tau4"); - double ndau = ijet.numberOfDaughters(); - double tau21 = 99; - double tau32 = 99; - if (tau1!=0) tau21 = tau2/tau1; - if (tau2!=0) tau32 = tau3/tau2; - - double mostMassiveSDsubjetMass = 0; - for (const pat::Jet &isub : *CA8CHSsub) { - double subjetEta = isub.eta(); - double subjetPhi = isub.phi(); - double subjetMass = isub.mass(); - double deltaRsubjetJet = deltaR(ijet.eta(), ijet.phi(), subjetEta, subjetPhi); - if (deltaRsubjetJet<0.8){ - if (verbose) cout<<"matched subjet with mass "<< subjetMass< mostMassiveSDsubjetMass) mostMassiveSDsubjetMass = subjetMass; - } - } + //if (pt<400) continue; + h_ca8chs_pt ->Fill( ijet.pt() ); + h_ca8chs_eta ->Fill( ijet.eta() ); + h_ca8chs_phi ->Fill( ijet.phi() ); + h_ca8chs_mass ->Fill( ijet.mass() ); + h_ca8chs_PrunedMass ->Fill( ijet.userFloat("ca8PFJetsCHSPrunedMass") ); + h_ca8chs_SoftDropMass ->Fill( ijet.userFloat("ca8PFJetsCHSSoftDropMass") ); + + h_ca8chs_ndau ->Fill( ijet.numberOfDaughters() ); + h_ca8chs_area ->Fill( ijet.jetArea() ); + h_ca8chs_doubleB ->Fill( ijet.bDiscriminator("pfBoostedDoubleSecondaryVertexca8BJetTags") ); - h_ca8chs_pt ->Fill( pt ); - h_ca8chs_mass ->Fill( mass ); - h_ca8chs_rapidity ->Fill( rapidity ); - h_ca8chs_prunedMass ->Fill( prunedMass ); - h_ca8chs_trimmedMass ->Fill( trimmedMass ); - h_ca8chs_filteredMass ->Fill( filteredMass ); - h_ca8chs_softDropMass ->Fill( softDropMass ); - h_ca8chs_tau1 ->Fill( tau1 ); - h_ca8chs_tau2 ->Fill( tau2 ); - h_ca8chs_tau3 ->Fill( tau3 ); - h_ca8chs_tau4 ->Fill( tau4 ); - h_ca8chs_tau32 ->Fill( tau32 ); - h_ca8chs_tau21 ->Fill( tau21 ); - h_ca8chs_ndau ->Fill( ndau ); - h_ca8chs_subjetMass ->Fill( mostMassiveSDsubjetMass ); - h_ca8chs_area ->Fill( ijet.jetArea() ); - - if (pt>200){ - h_ca8chs_pt200_mass ->Fill( mass ); - h_ca8chs_pt200_prunedMass ->Fill( prunedMass ); - h_ca8chs_pt200_trimmedMass ->Fill( trimmedMass ); - h_ca8chs_pt200_filteredMass ->Fill( filteredMass ); - h_ca8chs_pt200_softDropMass ->Fill( softDropMass ); - h_ca8chs_pt200_tau32 ->Fill( tau32 ); - h_ca8chs_pt200_tau21 ->Fill( tau21 ); - h_ca8chs_pt200_subjetMass ->Fill( mostMassiveSDsubjetMass ); - } - if (pt>500){ - h_ca8chs_pt500_mass ->Fill( mass ); - h_ca8chs_pt500_prunedMass ->Fill( prunedMass ); - h_ca8chs_pt500_trimmedMass ->Fill( trimmedMass ); - h_ca8chs_pt500_filteredMass ->Fill( filteredMass ); - h_ca8chs_pt500_softDropMass ->Fill( softDropMass ); - h_ca8chs_pt500_tau32 ->Fill( tau32 ); - h_ca8chs_pt500_tau21 ->Fill( tau21 ); - h_ca8chs_pt500_subjetMass ->Fill( mostMassiveSDsubjetMass ); - } } @@ -1108,167 +1260,85 @@ JetTester::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) edm::Handle KT8CHS; iEvent.getByToken(kt8PFCHSjetToken_, KT8CHS); - edm::Handle KT8CHSsub; - iEvent.getByToken(kt8PFCHSSoftDropSubjetsToken_, KT8CHSsub); - - int count_KT8CHS = 0; for (const pat::Jet &ijet : *KT8CHS) { - count_KT8CHS++; - if (count_KT8CHS>=2) break; - double pt = ijet.pt(); - double mass = ijet.mass(); - double rapidity = ijet.rapidity(); - double prunedMass = ijet.userFloat("kt8PFJetsCHSPrunedMass"); - double trimmedMass = ijet.userFloat("kt8PFJetsCHSTrimmedMass"); - double filteredMass = ijet.userFloat("kt8PFJetsCHSFilteredMass"); - double softDropMass = ijet.userFloat("kt8PFJetsCHSSoftDropMass"); - double tau1 = ijet.userFloat("NjettinessKT8CHS:tau1"); - double tau2 = ijet.userFloat("NjettinessKT8CHS:tau2"); - double tau3 = ijet.userFloat("NjettinessKT8CHS:tau3"); - double tau4 = ijet.userFloat("NjettinessKT8CHS:tau4"); - double ndau = ijet.numberOfDaughters(); - double tau21 = 99; - double tau32 = 99; - if (tau1!=0) tau21 = tau2/tau1; - if (tau2!=0) tau32 = tau3/tau2; - - double mostMassiveSDsubjetMass = 0; - for (const pat::Jet &isub : *KT8CHSsub) { - double subjetEta = isub.eta(); - double subjetPhi = isub.phi(); - double subjetMass = isub.mass(); - double deltaRsubjetJet = deltaR(ijet.eta(), ijet.phi(), subjetEta, subjetPhi); - if (deltaRsubjetJet<0.8){ - if (verbose) cout<<"matched subjet with mass "<< subjetMass< mostMassiveSDsubjetMass) mostMassiveSDsubjetMass = subjetMass; - } - } - - h_kt8chs_pt ->Fill( pt ); - h_kt8chs_mass ->Fill( mass ); - h_kt8chs_rapidity ->Fill( rapidity ); - h_kt8chs_prunedMass ->Fill( prunedMass ); - h_kt8chs_trimmedMass ->Fill( trimmedMass ); - h_kt8chs_filteredMass ->Fill( filteredMass ); - h_kt8chs_softDropMass ->Fill( softDropMass ); - h_kt8chs_tau1 ->Fill( tau1 ); - h_kt8chs_tau2 ->Fill( tau2 ); - h_kt8chs_tau3 ->Fill( tau3 ); - h_kt8chs_tau4 ->Fill( tau4 ); - h_kt8chs_tau32 ->Fill( tau32 ); - h_kt8chs_tau21 ->Fill( tau21 ); - h_kt8chs_ndau ->Fill( ndau ); - h_kt8chs_subjetMass ->Fill( mostMassiveSDsubjetMass ); - h_kt8chs_area ->Fill( ijet.jetArea() ); + //if (pt<400) continue; + h_kt8chs_pt ->Fill( ijet.pt() ); + h_kt8chs_eta ->Fill( ijet.eta() ); + h_kt8chs_phi ->Fill( ijet.phi() ); + h_kt8chs_mass ->Fill( ijet.mass() ); + h_kt8chs_PrunedMass ->Fill( ijet.userFloat("kt8PFJetsCHSPrunedMass") ); + h_kt8chs_SoftDropMass ->Fill( ijet.userFloat("kt8PFJetsCHSSoftDropMass") ); + + h_kt8chs_ndau ->Fill( ijet.numberOfDaughters() ); + h_kt8chs_area ->Fill( ijet.jetArea() ); + h_kt8chs_doubleB ->Fill( ijet.bDiscriminator("pfBoostedDoubleSecondaryVertexkt8BJetTags") ); - if (pt>200){ - h_kt8chs_pt200_mass ->Fill( mass ); - h_kt8chs_pt200_prunedMass ->Fill( prunedMass ); - h_kt8chs_pt200_trimmedMass ->Fill( trimmedMass ); - h_kt8chs_pt200_filteredMass ->Fill( filteredMass ); - h_kt8chs_pt200_softDropMass ->Fill( softDropMass ); - h_kt8chs_pt200_tau32 ->Fill( tau32 ); - h_kt8chs_pt200_tau21 ->Fill( tau21 ); - h_kt8chs_pt200_subjetMass ->Fill( mostMassiveSDsubjetMass ); - } - if (pt>500){ - h_kt8chs_pt500_mass ->Fill( mass ); - h_kt8chs_pt500_prunedMass ->Fill( prunedMass ); - h_kt8chs_pt500_trimmedMass ->Fill( trimmedMass ); - h_kt8chs_pt500_filteredMass ->Fill( filteredMass ); - h_kt8chs_pt500_softDropMass ->Fill( softDropMass ); - h_kt8chs_pt500_tau32 ->Fill( tau32 ); - h_kt8chs_pt500_tau21 ->Fill( tau21 ); - h_kt8chs_pt500_subjetMass ->Fill( mostMassiveSDsubjetMass ); - } } + //-------------------------------------------------------------------------------------------- + // AK R=0.8 jets - from toolbox + + edm::Handle AK8PuppimodSD; + iEvent.getByToken(ak8PFPuppimodSDjetToken_, AK8PuppimodSD); + for (const pat::Jet &ijet : *AK8PuppimodSD) { + h_ak8puppimodsd_pt ->Fill( ijet.pt() ); + h_ak8puppimodsd_eta ->Fill( ijet.eta() ); + h_ak8puppimodsd_phi ->Fill( ijet.phi() ); + h_ak8puppimodsd_mass ->Fill( ijet.mass() ); + h_ak8puppimodsd_SoftDropMass ->Fill( ijet.userFloat("ak8PFJetsPuppimodSDSoftDropMass") ); + + } + + //-------------------------------------------------------------------------------------------- - // AK R=1.2 jets - from toolbox + // AK R=0.8 jets - SoftKiller from toolbox - edm::Handle AK12CHS; - iEvent.getByToken(ak12PFCHSjetToken_, AK12CHS); + edm::Handle AK8SK; + iEvent.getByToken(ak8PFSKjetToken_, AK8SK); - edm::Handle AK12CHSsub; - iEvent.getByToken(ak12PFCHSSoftDropSubjetsToken_, AK12CHSsub); + for (const pat::Jet &ijet : *AK8SK) { + h_ak8sk_pt ->Fill( ijet.pt() ); + h_ak8sk_eta ->Fill( ijet.eta() ); + h_ak8sk_phi ->Fill( ijet.phi() ); + h_ak8sk_mass ->Fill( ijet.mass() ); + h_ak8sk_SoftDropMass ->Fill( ijet.userFloat("ak8PFJetsSKSoftDropMass") ); - int count_AK12CHS = 0; - for (const pat::Jet &ijet : *AK12CHS) { - count_AK12CHS++; - if (count_AK12CHS>=2) break; - double pt = ijet.pt(); - double mass = ijet.mass(); - double rapidity = ijet.rapidity(); - double prunedMass = ijet.userFloat("ak12PFJetsCHSPrunedMass"); - double trimmedMass = ijet.userFloat("ak12PFJetsCHSTrimmedMass"); - double filteredMass = ijet.userFloat("ak12PFJetsCHSFilteredMass"); - double softDropMass = ijet.userFloat("ak12PFJetsCHSSoftDropMass"); - double tau1 = ijet.userFloat("NjettinessAK12CHS:tau1"); - double tau2 = ijet.userFloat("NjettinessAK12CHS:tau2"); - double tau3 = ijet.userFloat("NjettinessAK12CHS:tau3"); - double tau4 = ijet.userFloat("NjettinessAK12CHS:tau4"); - double ndau = ijet.numberOfDaughters(); - double tau21 = 99; - double tau32 = 99; - if (tau1!=0) tau21 = tau2/tau1; - if (tau2!=0) tau32 = tau3/tau2; - - double mostMassiveSDsubjetMass = 0; - for (const pat::Jet &isub : *AK12CHSsub) { - double subjetEta = isub.eta(); - double subjetPhi = isub.phi(); - double subjetMass = isub.mass(); - double deltaRsubjetJet = deltaR(ijet.eta(), ijet.phi(), subjetEta, subjetPhi); - if (deltaRsubjetJet<1.2){ - if (verbose) cout<<"matched subjet with mass "<< subjetMass< mostMassiveSDsubjetMass) mostMassiveSDsubjetMass = subjetMass; - } - } + } - h_ak12chs_pt ->Fill( pt ); - h_ak12chs_mass ->Fill( mass ); - h_ak12chs_rapidity ->Fill( rapidity ); - h_ak12chs_prunedMass ->Fill( prunedMass ); - h_ak12chs_trimmedMass ->Fill( trimmedMass ); - h_ak12chs_filteredMass ->Fill( filteredMass ); - h_ak12chs_softDropMass ->Fill( softDropMass ); - h_ak12chs_tau1 ->Fill( tau1 ); - h_ak12chs_tau2 ->Fill( tau2 ); - h_ak12chs_tau3 ->Fill( tau3 ); - h_ak12chs_tau4 ->Fill( tau4 ); - h_ak12chs_tau32 ->Fill( tau32 ); - h_ak12chs_tau21 ->Fill( tau21 ); - h_ak12chs_ndau ->Fill( ndau ); - h_ak12chs_subjetMass ->Fill( mostMassiveSDsubjetMass ); - h_ak12chs_area ->Fill( ijet.jetArea() ); + /*/-------------------------------------------------------------------------------------------- + // AK R=0.8 jets - Constituent Substraction from toolbox - if (pt>200){ - h_ak12chs_pt200_mass ->Fill( mass ); - h_ak12chs_pt200_prunedMass ->Fill( prunedMass ); - h_ak12chs_pt200_trimmedMass ->Fill( trimmedMass ); - h_ak12chs_pt200_filteredMass ->Fill( filteredMass ); - h_ak12chs_pt200_softDropMass ->Fill( softDropMass ); - h_ak12chs_pt200_tau32 ->Fill( tau32 ); - h_ak12chs_pt200_tau21 ->Fill( tau21 ); - h_ak12chs_pt200_subjetMass ->Fill( mostMassiveSDsubjetMass ); - } - if (pt>500){ - h_ak12chs_pt500_mass ->Fill( mass ); - h_ak12chs_pt500_prunedMass ->Fill( prunedMass ); - h_ak12chs_pt500_trimmedMass ->Fill( trimmedMass ); - h_ak12chs_pt500_filteredMass ->Fill( filteredMass ); - h_ak12chs_pt500_softDropMass ->Fill( softDropMass ); - h_ak12chs_pt500_tau32 ->Fill( tau32 ); - h_ak12chs_pt500_tau21 ->Fill( tau21 ); - h_ak12chs_pt500_subjetMass ->Fill( mostMassiveSDsubjetMass ); - } + edm::Handle AK8CS; + iEvent.getByToken(ak8PFCSjetToken_, AK8CS); + + for (const pat::Jet &ijet : *AK8CS) { + h_ak8cs_pt ->Fill( ijet.pt() ); + h_ak8cs_eta ->Fill( ijet.eta() ); + h_ak8cs_phi ->Fill( ijet.phi() ); + h_ak8cs_mass ->Fill( ijet.mass() ); + h_ak8cs_SoftDropMass ->Fill( ijet.userFloat("ak8PFJetsCSSoftDropMass") ); + + }*/ + + //-------------------------------------------------------------------------------------------- + // CA R=1.2 jets - from toolbox + + edm::Handle CA12CHS; + iEvent.getByToken(ca12PFCHSjetToken_, CA12CHS); + + for (const pat::Jet &ijet : *CA12CHS) { + //cout << ijet.tagInfoLabels() << endl; + cout << ijet.tagInfo("hepTopTagPFJetsCHS") << endl; + /*for ( auto st : ijet.tagInfoLabels() ) { + cout << st << endl; //ijet.tagInfo("CATop") << endl; + }*/ } - //-------------------------------------------------------------------------------------------- + /*/-------------------------------------------------------------------------------------------- // AK R=1.5 jets - from toolbox edm::Handle AK15CHS; @@ -1283,7 +1353,7 @@ JetTester::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) if (count_AK15CHS>=2) break; double pt = ijet.pt(); double mass = ijet.mass(); - double rapidity = ijet.rapidity(); + double eta = ijet.eta(); double prunedMass = ijet.userFloat("ak15PFJetsCHSPrunedMass"); double trimmedMass = ijet.userFloat("ak15PFJetsCHSTrimmedMass"); double filteredMass = ijet.userFloat("ak15PFJetsCHSFilteredMass"); @@ -1312,7 +1382,7 @@ JetTester::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) h_ak15chs_pt ->Fill( pt ); h_ak15chs_mass ->Fill( mass ); - h_ak15chs_rapidity ->Fill( rapidity ); + h_ak15chs_eta ->Fill( eta ); h_ak15chs_prunedMass ->Fill( prunedMass ); h_ak15chs_trimmedMass ->Fill( trimmedMass ); h_ak15chs_filteredMass ->Fill( filteredMass ); @@ -1347,364 +1417,11 @@ JetTester::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) h_ak15chs_pt500_tau21 ->Fill( tau21 ); h_ak15chs_pt500_subjetMass ->Fill( mostMassiveSDsubjetMass ); } - } + }*/ - //-------------------------------------------------------------------------------------------- - // AK R=0.8 jets - default miniAOD - - edm::Handle AK8MINI; - iEvent.getByToken(ak8jetMiniToken_, AK8MINI); - - edm::Handle AK8GENJET; - iEvent.getByToken(ak8genjetToken_, AK8GENJET); - - for (const pat::Jet &ijet : *AK8MINI) { - double pt = ijet.pt(); - if (pt<400) continue; - double mass = ijet.mass(); - double rapidity = ijet.rapidity(); - double ndau = ijet.numberOfDaughters(); - double prunedMass = ijet.userFloat("ak8PFJetsCHSValueMap:ak8PFJetsCHSPrunedMass"); - double softDropMass = ijet.userFloat("ak8PFJetsCHSValueMap:ak8PFJetsCHSSoftDropMass"); - double tau1 = ijet.userFloat("NjettinessAK8Puppi:tau1"); - double tau2 = ijet.userFloat("NjettinessAK8Puppi:tau2"); - double tau3 = ijet.userFloat("NjettinessAK8Puppi:tau3"); - double tau21 = 99; - double tau32 = 99; - - double puppi_pt = ijet.pt();//userFloat("ak8PFJetsPuppiValueMap:pt"); - double puppi_mass = ijet.mass();//userFloat("ak8PFJetsPuppiValueMap:mass"); - double puppi_eta = ijet.eta();//userFloat("ak8PFJetsPuppiValueMap:eta"); - double puppi_phi = ijet.phi();//userFloat("ak8PFJetsPuppiValueMap:phi"); - double puppi_tau1 = ijet.userFloat("NjettinessAK8Puppi:tau1"); - double puppi_tau2 = ijet.userFloat("NjettinessAK8Puppi:tau2"); - double puppi_tau3 = ijet.userFloat("NjettinessAK8Puppi:tau3"); - double puppi_tau21 = 99; - double puppi_tau32 = 99; - - if (tau1!=0) tau21 = tau2/tau1; - if (tau2!=0) tau32 = tau3/tau2; - - if (puppi_tau1!=0) puppi_tau21 = puppi_tau2/puppi_tau1; - if (puppi_tau2!=0) puppi_tau32 = puppi_tau3/puppi_tau2; - - if (verbose) cout<<"\nJet with pT "<140 && tau32 <0.65) SoftDropTau32Tagged = true; - - // Get Soft drop subjets for subjet b-tagging - double mostMassiveSDsubjetMass = 0; - auto const & sdSubjets = ijet.subjets("SoftDropPuppi"); - for ( auto const & it : sdSubjets ) { - double subjetPt = it->pt(); - double subjetPtUncorr = it->pt(); - double subjetEta = it->eta(); - double subjetPhi = it->phi(); - double subjetMass = it->mass(); - double subjetBdisc = it->bDiscriminator("pfCombinedInclusiveSecondaryVertexV2BJetTags"); - double deltaRsubjetJet = deltaR(ijet.eta(), ijet.phi(), subjetEta, subjetPhi); - if (verbose) cout<<" SD Subjet pt "<Fill( subjetMass ); - if (subjetMass > mostMassiveSDsubjetMass) mostMassiveSDsubjetMass = subjetMass; - } - - // Get Soft drop PUPPI subjets - TLorentzVector pup0; - TLorentzVector pup1; - double mostMassiveSDPUPPIsubjetMass = 0; - auto const & sdSubjetsPuppi = ijet.subjets("SoftDropPuppi"); - int count_pup=0; - for ( auto const & it : sdSubjetsPuppi ) { - double subjetPt = it->pt(); - double subjetPtUncorr = it->pt(); - double subjetEta = it->eta(); - double subjetPhi = it->phi(); - double subjetMass = it->mass(); - double subjetBdisc = it->bDiscriminator("pfCombinedInclusiveSecondaryVertexV2BJetTags"); - double deltaRsubjetJet = deltaR(ijet.eta(), ijet.phi(), subjetEta, subjetPhi); - if (verbose) cout<<" SD Subjet pt "<Fill( subjetMass ); - if (count_pup==0) pup0.SetPtEtaPhiM( subjetPt, subjetEta, subjetPhi, subjetMass); - if (count_pup==1) pup1.SetPtEtaPhiM( subjetPt, subjetEta, subjetPhi, subjetMass); - if (subjetMass > mostMassiveSDPUPPIsubjetMass) mostMassiveSDPUPPIsubjetMass = subjetMass; - count_pup++; - } - - TLorentzVector puppiSD; - if (count_pup>1) - { - puppiSD = pup0 + pup1; - if (verbose) cout<SoftDropTau32Tagged"< > AK8MINI; - // iEvent.getByLabel( "slimmedJetsAK8", AK8MINI ); - // edm::Handle > AK8MINI_SD_Subjets; - // iEvent.getByLabel( "slimmedJetsAK8PFCHSSoftDropPacked", "SubJets", AK8MINI_SD_Subjets ); - // edm::Handle > AK8MINI_CMSTopTag_Subjets; - // iEvent.getByLabel( "slimmedJetsCMSTopTagCHSPacked", "SubJets", AK8MINI_CMSTopTag_Subjets ); - - - // for ( std::vector::const_iterator jetBegin = AK8MINI_SD_Subjets->begin(), jetEnd = AK8MINI_SD_Subjets->end(), ijet = jetBegin; ijet != jetEnd; ++ijet ) - // { - // double pt = ijet->pt(); - // double bdisc = ijet->bDiscriminator("pfCombinedInclusiveSecondaryVertexV2BJetTags"); - // cout<<"SD subjet pt "<::const_iterator jetBegin = AK8MINI_CMSTopTag_Subjets->begin(), jetEnd = AK8MINI_CMSTopTag_Subjets->end(), ijet = jetBegin; ijet != jetEnd; ++ijet ) - // { - // double pt = ijet->pt(); - // double bdisc = ijet->bDiscriminator("pfCombinedInclusiveSecondaryVertexV2BJetTags"); - // cout<<"CMSTT subjet pt "<::const_iterator jetBegin = AK8MINI->begin(), jetEnd = AK8MINI->end(), ijet = jetBegin; ijet != jetEnd; ++ijet ) - // { - // double pt = ijet->pt(); - // if (pt<150) continue; - // double mass = ijet->mass(); - // double rapidity = ijet->rapidity(); - // double prunedMass = ijet->userFloat("ak8PFJetsCHSPrunedMass"); - // double trimmedMass = ijet->userFloat("ak8PFJetsCHSTrimmedMass"); - // double filteredMass = ijet->userFloat("ak8PFJetsCHSFilteredMass"); - // double softDropMass = ijet->userFloat("ak8PFJetsCHSSoftDropMass"); - // double tau1 = ijet->userFloat("NjettinessAK8:tau1"); - // double tau2 = ijet->userFloat("NjettinessAK8:tau2"); - // double tau3 = ijet->userFloat("NjettinessAK8:tau3"); - // double ndau = ijet->numberOfDaughters(); - - // double tau21 = 99; - // double tau32 = 99; - // if (tau1!=2) tau21 = tau2/tau1; - // if (tau2!=2) tau32 = tau3/tau2; - - // cout<<"\nJet with pT "<140 && tau32 <0.65) SoftDropTau32Tagged = true; - - // //CMS Top Tagger - // reco::CATopJetTagInfo const * tagInfo = dynamic_cast( ijet->tagInfo("caTop")); - // bool Run1CMStopTagged = false; - // int nSubJetsCATop = 0; - // if ( tagInfo != 0 ) { - // double minMass = tagInfo->properties().minMass; - // double topMass = tagInfo->properties().topMass; - // nSubJetsCATop = tagInfo->properties().nSubJets; - // if ( nSubJetsCATop > 2 && minMass > 50.0 && topMass > 140.0 && topMass < 250.0 ) Run1CMStopTagged = true; - // } - - // // Get Soft drop subjets for subjet b-tagging - // auto const & sdSubjets = ijet->subjets("SoftDrop"); - // cout<<"sdSubjets size "<pt(); - // double subjetPtUncorr = it->pt(); - // double subjetEta = it->eta(); - // double subjetPhi = it->phi(); - // double subjetMass = it->mass(); - // double subjetBdisc = it->bDiscriminator("pfCombinedInclusiveSecondaryVertexV2BJetTags"); - // double deltaRsubjetJet = deltaR(ijet->eta(), ijet->phi(), subjetEta, subjetPhi); - // cout<<" SD Subjet pt "<subjets("CMSTopTag"); - // cout<<"topSubjets size "<pt(); - // double subjetPtUncorr = it->pt(); - // double subjetEta = it->eta(); - // double subjetPhi = it->phi(); - // double subjetMass = it->mass(); - // double subjetBdisc = it->bDiscriminator("pfCombinedInclusiveSecondaryVertexV2BJetTags"); - // double deltaRsubjetJet = deltaR(ijet->eta(), ijet->phi(), subjetEta, subjetPhi); - // cout<<" CMSTT Subjet pt "<SoftDropTau32Tagged"<Run1CMStopTagged"<Fill( pt ); - // h_ak8chs_mass ->Fill( mass ); - // h_ak8chs_rapidity ->Fill( rapidity ); - // h_ak8chs_prunedMass ->Fill( prunedMass ); - // h_ak8chs_trimmedMass ->Fill( trimmedMass ); - // h_ak8chs_filteredMass ->Fill( filteredMass ); - // h_ak8chs_softDropMass ->Fill( softDropMass ); - // h_ak8chs_tau1 ->Fill( tau1 ); - // h_ak8chs_tau2 ->Fill( tau2 ); - // h_ak8chs_tau3 ->Fill( tau3 ); - // h_ak8chs_tau32 ->Fill( tau32 ); - // h_ak8chs_tau21 ->Fill( tau21 ); - // h_ak8chs_ndau ->Fill( ndau ); - // } -/* - //-------------------------------------------------------------------------------------------- - // AK R=0.8 PUPPI jets - from toolbox - - edm::Handle > AK8Puppi; - iEvent.getByLabel( "selectedPatJetsAK8PFPuppi", AK8Puppi ); - for ( std::vector::const_iterator jetBegin = AK8Puppi->begin(), jetEnd = AK8Puppi->end(), ijet = jetBegin; ijet != jetEnd; ++ijet ) - { - double pt = ijet->pt(); - if (pt<150) continue; - double mass = ijet->mass(); - double rapidity = ijet->rapidity(); - double prunedMass = ijet->userFloat("ak8PFJetsPuppiPrunedMass"); - double trimmedMass = ijet->userFloat("ak8PFJetsPuppiTrimmedMass"); - double filteredMass = ijet->userFloat("ak8PFJetsPuppiFilteredMass"); - double softDropMass = ijet->userFloat("ak8PFJetsPuppiSoftDropMass"); - double ndau = ijet->numberOfDaughters(); - - h_ak8puppi_pt ->Fill( pt ); - h_ak8puppi_mass ->Fill( mass ); - h_ak8puppi_rapidity ->Fill( rapidity ); - h_ak8puppi_prunedMass ->Fill( prunedMass ); - h_ak8puppi_trimmedMass ->Fill( trimmedMass ); - h_ak8puppi_filteredMass ->Fill( filteredMass ); - h_ak8puppi_softDropMass ->Fill( softDropMass ); - h_ak8puppi_ndau ->Fill( ndau ); - } - - //-------------------------------------------------------------------------------------------- - // AK R=0.8 PF jets - from toolbox - - edm::Handle > AK8PF; - iEvent.getByLabel( "selectedPatJetsAK8PF", AK8PF ); - for ( std::vector::const_iterator jetBegin = AK8PF->begin(), jetEnd = AK8PF->end(), ijet = jetBegin; ijet != jetEnd; ++ijet ) - { - double pt = ijet->pt(); - if (pt<150) continue; - double mass = ijet->mass(); - double rapidity = ijet->rapidity(); - double prunedMass = ijet->userFloat("ak8PFJetsPrunedMass"); - double trimmedMass = ijet->userFloat("ak8PFJetsTrimmedMass"); - double filteredMass = ijet->userFloat("ak8PFJetsFilteredMass"); - double softDropMass = ijet->userFloat("ak8PFJetsSoftDropMass"); - double ndau = ijet->numberOfDaughters(); - - h_ak8pf_pt ->Fill( pt ); - h_ak8pf_mass ->Fill( mass ); - h_ak8pf_rapidity ->Fill( rapidity ); - h_ak8pf_prunedMass ->Fill( prunedMass ); - h_ak8pf_trimmedMass ->Fill( trimmedMass ); - h_ak8pf_filteredMass ->Fill( filteredMass ); - h_ak8pf_softDropMass ->Fill( softDropMass ); - h_ak8pf_ndau ->Fill( ndau ); - } - - - //-------------------------------------------------------------------------------------------- - // AK R=0.8 CHS jets with modified grooming parameters - from toolbox - - edm::Handle > AK8CHS; - iEvent.getByLabel( "selectedPatJetsAK8PFCHS", AK8CHS ); - for ( std::vector::const_iterator jetBegin = AK8CHS->begin(), jetEnd = AK8CHS->end(), ijet = jetBegin; ijet != jetEnd; ++ijet ) - { - double pt = ijet->pt(); - if (pt<150) continue; - double mass = ijet->mass(); - double rapidity = ijet->rapidity(); - double prunedMass = ijet->userFloat("ak8CHSJetsCHSPrunedMass"); - double trimmedMass = ijet->userFloat("ak8CHSJetsCHSTrimmedMass"); - double filteredMass = ijet->userFloat("ak8CHSJetsCHSFilteredMass"); - double softDropMass = ijet->userFloat("ak8CHSJetsCHSSoftDropMass"); - double ndau = ijet->numberOfDaughters(); - - h_ak8chsmod_pt ->Fill( pt ); - h_ak8chsmod_mass ->Fill( mass ); - h_ak8chsmod_rapidity ->Fill( rapidity ); - h_ak8chsmod_prunedMass ->Fill( prunedMass ); - h_ak8chsmod_trimmedMass ->Fill( trimmedMass ); - h_ak8chsmod_filteredMass ->Fill( filteredMass ); - h_ak8chsmod_softDropMass ->Fill( softDropMass ); - h_ak8chsmod_ndau ->Fill( ndau ); - } -*/ -// [jdolen@cmslpc24 python]$ edmdump jettoolbox.root -// Type Module Label Process -// -------------------------------------------------------------------------------------- -// edm::ValueMap "ak12PFJetsCHSFilteredMass" "" "Ana" -// edm::ValueMap "ak12PFJetsCHSPrunedMass" "" "Ana" -// edm::ValueMap "ak12PFJetsCHSSoftDropMass" "" "Ana" -// edm::ValueMap "ak12PFJetsCHSTrimmedMass" "" "Ana" -// edm::ValueMap "ak8PFJetsCHSFilteredMass" "" "Ana" -// edm::ValueMap "ak8PFJetsCHSSoftDropMass" "" "Ana" -// edm::ValueMap "ak8PFJetsCHSTrimmedMass" "" "Ana" -// edm::ValueMap "ak8PFJetsFilteredMass" "" "Ana" -// edm::ValueMap "ak8PFJetsPuppiFilteredMass" "" "Ana" -// edm::ValueMap "ak8PFJetsPuppiSoftDropMass" "" "Ana" -// edm::ValueMap "ak8PFJetsPuppiTrimmedMass" "" "Ana" -// edm::ValueMap "ak8PFJetsSoftDropMass" "" "Ana" -// edm::ValueMap "ak8PFJetsTrimmedMass" "" "Ana" -// edm::ValueMap "NjettinessAK12CHS" "tau1" "Ana" -// edm::ValueMap "NjettinessAK12CHS" "tau2" "Ana" -// edm::ValueMap "NjettinessAK12CHS" "tau3" "Ana" -// edm::ValueMap "NjettinessAK12CHS" "tau4" "Ana" -// vector "selectedPatJetsAK12PFCHS" "" "Ana" -// vector "selectedPatJetsAK8PF" "" "Ana" -// vector "selectedPatJetsAK8PFCHS" "" "Ana" -// vector "selectedPatJetsAK8PFPuppi" "" "Ana" -// vector "selectedPatJetsAK12PFCHS" "genJets" "Ana" -// vector "selectedPatJetsAK8PF" "genJets" "Ana" -// vector "selectedPatJetsAK8PFCHS" "genJets" "Ana" -// vector "selectedPatJetsAK8PFPuppi" "genJets" "Ana" -// vector "selectedPatJetsAK12PFCHS" "pfCandidates" "Ana" -// vector "selectedPatJetsAK8PF" "pfCandidates" "Ana" -// vector "selectedPatJetsAK8PFCHS" "pfCandidates" "Ana" -// vector "selectedPatJetsAK8PFPuppi" "pfCandidates" "Ana" } diff --git a/python/jetToolbox_cff.py b/python/jetToolbox_cff.py index 3088b31b7e6..83347b9e9c1 100644 --- a/python/jetToolbox_cff.py +++ b/python/jetToolbox_cff.py @@ -182,7 +182,7 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, ####### Recluster jets from scratch if not updateCollection: - mod["GenJetsNoNu"] = jetalgo+'GenJetsNoNu' + mod["GenJetsNoNu"] = jetalgo+'GenJetsNoNu' ####### Setting labels and running GenJets if miniAOD: @@ -275,7 +275,7 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, jetSeq += getattr(proc, 'softKiller' ) srcForPFJets = 'softKiller' - from RecoJets.JetProducers.ak4PFJetsSK_cfi import ak4PFJetsSK + from RecoJets.JetProducers.ak4PFJets_cfi import ak4PFJetsSK mod["PFJets"] = jetalgo+'PFJetsSK'+postFix _addProcessAndTask( proc, mod["PFJets"], ak4PFJetsSK.clone( src = cms.InputTag( srcForPFJets ), @@ -288,10 +288,10 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, elif 'CS' in PUMethod: - from RecoJets.JetProducers.ak4PFJetsCHSCS_cfi import ak4PFJetsCHSCS + from RecoJets.JetProducers.ak4PFJets_cfi import ak4PFJetsCS mod["PFJets"] = jetalgo+'PFJetsCS'+postFix _addProcessAndTask( proc, mod["PFJets"], - ak4PFJetsCHSCS.clone( doAreaFastjet = True, + ak4PFJetsCS.clone( doAreaFastjet = True, src = cms.InputTag( pfCand ), #srcForPFJets ), csRParam = cms.double(jetSize), jetAlgorithm = algorithm ) ) @@ -367,7 +367,7 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, JEC = ( JETCorrPayload.replace('CS','chs').replace('SK','chs') , JETCorrLevels, 'None' ) if verbosity>=2: print('|---- jetToolBox: Applying these corrections: '+str(JEC)) - if addPrunedSubjets or addSoftDropSubjets or addCMSTopTagger: + if addPrunedSubjets or addSoftDropSubjets or addCMSTopTagger or addHEPTopTagger: if 'None' in subJETCorrPayload: subJEC = None else: subJEC = ( subJETCorrPayload.replace('CS','chs').replace('SK','chs') , subJETCorrLevels, 'None' ) ######################################################################### @@ -520,8 +520,9 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, if addSoftDropSubjets: #### Creating softdrop genjets and gensubjets + mod["GenJetsNoNuSoftDrop"] = mod["GenJetsNoNu"]+'SoftDrop' + if runOnMC: - mod["GenJetsNoNuSoftDrop"] = mod["GenJetsNoNu"]+'SoftDrop' _addProcessAndTask( proc, mod["GenJetsNoNuSoftDrop"], ak4GenJets.clone( SubJetParameters, @@ -657,9 +658,9 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, #### For subjets if addPrunedSubjets: + mod["GenJetsNoNuPruned"] = mod["GenJetsNoNu"]+'Pruned' #### Creating pruning genjets and gensubjets if runOnMC: - mod["GenJetsNoNuPruned"] = mod["GenJetsNoNu"]+'Pruned' _addProcessAndTask( proc, mod["GenJetsNoNuPruned"], ak4GenJets.clone( SubJetParameters, @@ -932,8 +933,11 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, rParam = jetSize, src = cms.InputTag( mod["PFJetsConstituentsColonOrUpdate"] ), ) ) - _addProcessAndTask( proc, mod["MassDropFilteredMass"], ak8PFJetsCHSPrunedMass.clone( src = cms.InputTag( mod["PFJets"]), - matched = cms.InputTag(mod["PFJetsMassDrop"]), distMax = cms.double( jetSize ) ) ) + _addProcessAndTask( proc, mod["MassDropFilteredMass"], + ak8PFJetsCHSPrunedMass.clone( + src = cms.InputTag( mod["PFJets"]), + matched = cms.InputTag(mod["PFJetsMassDrop"]), + distMax = cms.double( jetSize ) ) ) elemToKeep += [ 'keep *_'+mod["MassDropFilteredMass"]+'_*_*' ] getattr( proc, mod["PATJets"]).userData.userFloats.src += [ mod["MassDropFilteredMass"] ] jetSeq += getattr(proc, mod["PFJetsMassDrop"]) @@ -965,17 +969,90 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, massRatioWidth = cms.double(100.), minM23Cut = cms.double(0.), minM13Cut = cms.double(0.), - maxM13Cut = cms.double(2.) + maxM13Cut = cms.double(2.), + jetCollInstanceName=cms.string('SubJets'), )) - elemToKeep += [ 'keep *_'+mod["PFJetsHEPTopTag"]+'_*_*' ] + elemToKeep += [ 'keep *_'+mod["PFJetsHEPTopTag"]+'__*' ] + elemToKeep += [ 'keep *_'+mod["PFJetsHEPTopTag"]+'_SubJets_*' ] jetSeq += getattr(proc, mod["PFJetsHEPTopTag"]) toolsUsed.append( mod["PFJetsHEPTopTag"] ) - _addProcessAndTask( proc, mod["PFJetsHEPTopTagMass"], ak8PFJetsCHSPrunedMass.clone( src = cms.InputTag(mod["PFJets"]), - matched = cms.InputTag(mod["PFJetsHEPTopTag"]), distMax = cms.double( jetSize ) ) ) + _addProcessAndTask( proc, mod["PFJetsHEPTopTagMass"], + ak8PFJetsCHSPrunedMass.clone( + src = cms.InputTag(mod["PFJets"]), + matched = cms.InputTag(mod["PFJetsHEPTopTag"]), + distMax = cms.double( jetSize ), + #values = cms.vstring([ "mass", "tagInfo().properties().fRec()"] ), + #valueLabels = cms.vstring(["mass","fRec"]) + ) ) elemToKeep += [ 'keep *_'+mod["PFJetsHEPTopTagMass"]+'_*_*' ] - getattr( proc, mod["PATJets"]).userData.userFloats.src += [ mod["PFJetsHEPTopTagMass"] ] + getattr( proc, mod["PATJets"] ).userData.userFloats.src += [ mod["PFJetsHEPTopTagMass"] ] + #getattr( proc, mod["PATJets"] ).userData.userFloats.src += [ "fRec" ] jetSeq += getattr(proc, mod["PFJetsHEPTopTagMass"]) toolsUsed.append( mod["PFJetsHEPTopTagMass"] ) + + + mod["PATJetsHEPTopTagLabel"] = 'HEPTopTag'+PUMethod+postFix + addJetCollection( + proc, + labelName = mod["PATJetsHEPTopTagLabel"], + jetSource = cms.InputTag(mod["PFJetsHEPTopTag"]), + jetCorrections = JEC if JEC is not None else None, + pfCandidates = cms.InputTag( pfCand ), + pvSource = cms.InputTag( pvLabel), + svSource = cms.InputTag( svLabel ), + muSource = cms.InputTag( muLabel ), + elSource = cms.InputTag( elLabel ), + btagDiscriminators = bTagDiscriminators, + btagInfos = bTagInfos, + genJetCollection = cms.InputTag(mod["GenJetsNoNu"]), + getJetMCFlavour = False, # jet flavor should always be disabled for groomed jets + genParticles = cms.InputTag(genParticlesLabel) + ) + mod["PATJetsHEPTopTag"] = patJets+mod["PATJetsHEPTopTagLabel"] + mod["selPATJetsHEPTopTag"] = selPatJets+mod["PATJetsHEPTopTagLabel"] + getattr(proc,mod["PATJetsHEPTopTag"]).addTagInfos = True + getattr(proc,mod["PATJetsHEPTopTag"]).tagInfoSources = cms.VInputTag( cms.InputTag(mod["PFJetsHEPTopTag"])) + _addProcessAndTask( proc, mod["selPATJetsHEPTopTag"], + selectedPatJets.clone( src = mod["PATJetsHEPTopTag"], cut = Cut ) ) + jetSeq += getattr(proc, mod["selPATJetsHEPTopTag"]) + elemToKeep += [ 'keep *_'+mod["selPATJetsHEPTopTag"]+'_*_*' ] + + mod["PATSubjetsHEPTopTagLabel"] = mod["PATJetsHEPTopTagLabel"]+'Subjets' + addJetCollection( + proc, + labelName = mod["PATSubjetsHEPTopTagLabel"], + jetSource = cms.InputTag(mod["PFJetsHEPTopTag"], 'SubJets'), + algo = jetalgo, # needed for subjet b tagging + rParam = jetSize, # needed for subjet b tagging + jetCorrections = subJEC if subJEC is not None else None, + pfCandidates = cms.InputTag( pfCand ), + pvSource = cms.InputTag( pvLabel), + svSource = cms.InputTag( svLabel ), + muSource = cms.InputTag( muLabel ), + elSource = cms.InputTag( elLabel ), + btagDiscriminators = bTagDiscriminators, + btagInfos = bTagInfos, + genJetCollection = cms.InputTag( mod["GenJetsNoNu"]), + getJetMCFlavour = GetSubjetMCFlavour, + explicitJTA = True, # needed for subjet b tagging + svClustering = True, # needed for subjet b tagging + fatJets=cms.InputTag(mod["PFJets"]), # needed for subjet flavor clustering + groomedFatJets=cms.InputTag(mod["PATJetsHEPTopTag"]), # needed for subjet flavor clustering + genParticles = cms.InputTag(genParticlesLabel) + ) + mod["PATSubjetsHEPTopTag"] = patJets+mod["PATSubjetsHEPTopTagLabel"] + mod["selPATSubjetsHEPTopTag"] = selPatJets+mod["PATSubjetsHEPTopTagLabel"] + + _addProcessAndTask( proc, mod["selPATSubjetsHEPTopTag"], selectedPatJets.clone( src = mod["PATSubjetsHEPTopTag"], cut = Cut ) ) + mod["PATJetsHEPTopTagPacked"] = mod["PATJetsHEPTopTag"]+'Packed' + _addProcessAndTask( proc, mod["PATJetsHEPTopTagPacked"], + cms.EDProducer("BoostedJetMerger", + jetSrc=cms.InputTag(mod["PATJetsHEPTopTag"]), + subjetSrc=cms.InputTag(mod["PATSubjetsHEPTopTag"]) + )) + jetSeq += getattr(proc, mod["PATJetsHEPTopTagPacked"]) + elemToKeep += [ 'keep *_'+mod["PATJetsHEPTopTagPacked"]+'_*_*' ] + toolsUsed.append( mod["PATJetsHEPTopTagPacked"] ) ################################################################################# diff --git a/test/jettoolbox_cfg.py b/test/jettoolbox_cfg.py index 6f55940b8c1..21e4675589f 100644 --- a/test/jettoolbox_cfg.py +++ b/test/jettoolbox_cfg.py @@ -148,22 +148,38 @@ #jetToolbox( process, 'ca8', 'ca8JetSubs', 'out', addCMSTopTagger=True, addMassDrop=True, addSoftDrop=True, miniAOD=False ) #jetToolbox( process, 'ca12', 'ca12JetSubs', 'out', PUMethod='Puppi', addHEPTopTagger=True, addSoftDrop=True, miniAOD=False ) #jetToolbox( process, 'ca12', 'ca12JetSubs', 'out', PUMethod='SK', addHEPTopTagger=True, addSoftDrop=True, miniAOD=False ) -#jetToolbox( process, 'ca12', 'ca12JetSubs', 'out', addHEPTopTagger=True, addSoftDrop=True, miniAOD=False ) - -jetToolbox( process, 'ak4', 'jetSequence', 'out', PUMethod='Puppi', miniAOD=True, - #Cut='pt > 200 && abs(eta) < 2.5', # Tight - #nameNewPFCollection='hltScoutingPFPacker', - #nameNewPFCollection='pippo', - #addPruning = True, - addSoftDrop = True, - #addFiltering=True, - #addNsub = True, - #addPrunedSubjets=True, addSoftDropSubjets=True, - #addNsubSubjets =True - addSoftDropSubjets = True, - addEnergyCorrFunc = True, ecfN3 = True, - ) +#jetToolbox( process, 'ca12', 'ca12JetSubs', 'out', addHEPTopTagger=True, addSoftDrop=True, miniAOD=True) + +#jetToolbox( process, 'ak4', 'jetSequence', 'out', PUMethod='Puppi', miniAOD=True, +# #Cut='pt > 200 && abs(eta) < 2.5', # Tight +# #nameNewPFCollection='hltScoutingPFPacker', +# #nameNewPFCollection='pippo', +# #addPruning = True, +# addSoftDrop = True, +# #addFiltering=True, +# #addNsub = True, +# #addPrunedSubjets=True, addSoftDropSubjets=True, +# #addNsubSubjets =True +# addSoftDropSubjets = True, +# addEnergyCorrFunc = True, ecfN3 = True, +# ) +# +jetToolbox( process, 'ak15', 'ak15JetSubs', 'noOutput', + PUMethod='Puppi', + addPruning=True, addSoftDrop=True , # add basic grooming + addTrimming=True, addFiltering=True, + addSoftDropSubjets=True, + addPrunedSubjets=True, + addNsub=True, maxTau=4, # add Nsubjettiness tau1, tau2, tau3, tau4 + JETCorrPayload = 'AK8PFPuppi', #JETCorrLevels = ['L2Relative', 'L3Absolute'], + runOnMC=False, + miniAOD=True, + Cut='pt > 100 && abs(eta) < 2.5', + GetJetMCFlavour=False, + #GetSubJetMCFlavour=True, + addHEPTopTagger=True + ) process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(10) ) From 17b243af96918f69ff8d928175e61e04b852691b Mon Sep 17 00:00:00 2001 From: Alejandro Date: Wed, 19 Jun 2019 12:48:18 +0200 Subject: [PATCH 2/9] updating README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 095a2af9654..3ebc846e2ef 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ Python framework for configuration of jet tools via the jet toolbox. Check the branch for the correspondent release. This branch is for *CMSSW_10_2_X* and higher. Then for example: ``` -cmsrel CMSSW_10_2_9/ -cd CMSSW_10_2_9/src/ +cmsrel CMSSW_10_2_15/ +cd CMSSW_10_2_15/src/ git cms-init git clone git@github.com:cms-jet/JetToolbox.git JMEAnalysis/JetToolbox -b jetToolbox_102X_v1 scram b -j 18 From dc53a3917d68a802017618c3151deceb2027e173 Mon Sep 17 00:00:00 2001 From: Alejandro Date: Fri, 21 Jun 2019 11:46:09 +0200 Subject: [PATCH 3/9] updating reamde --- README.md | 23 ++++++++++++++- plugins/JetTester.cc | 2 +- python/nanoAOD_jetToolbox_cff.py | 48 ++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 python/nanoAOD_jetToolbox_cff.py diff --git a/README.md b/README.md index 3ebc846e2ef..ed962f75863 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,15 @@ Python framework for configuration of jet tools via the jet toolbox. ## Instructions +### Notice that the parameter `miniAOD=True` has changed to `dataTier=miniAOD` + Check the branch for the correspondent release. This branch is for *CMSSW_10_2_X* and higher. Then for example: ``` cmsrel CMSSW_10_2_15/ cd CMSSW_10_2_15/src/ git cms-init -git clone git@github.com:cms-jet/JetToolbox.git JMEAnalysis/JetToolbox -b jetToolbox_102X_v1 +git clone git@github.com:cms-jet/JetToolbox.git JMEAnalysis/JetToolbox -b jetToolbox_102X_v2 scram b -j 18 ``` @@ -23,6 +25,25 @@ cmsRun JMEAnalysis/JetToolbox/test/ClusterWithToolboxAndMakeHistos.py ~~~ In this python file you also can see a basic example on how to use the toolbox. +## Instruction to run jetToolbox in nanoAOD (beta version) + +This is a beta version on how to modify nanoAOD production to incorporate different jet collections in nanoAOD format. + +The only file that needs to be modified is [JMEAnalysis/JetToolbox/python/nanoAOD_jetToolbox_cff.py](python/nanoAOD_jetToolbox_cff.py), using the same setting as in the miniAOD case. +*The main change is the dataTier parameter, in case of nanoAOD:* `dataTier="nanoAOD"`. +After modify the `setupCustomizedJetToolbox` function in that file, one can run a cmsDriver command. For instance (for nanoAOD v5 2018): + +~~~ +cmsDriver.py nanoAOD_jetToolbox_cff -s NANO --mc --eventcontent NANOAODSIM --datatier NANOAODSIM --no_exec --conditions 102X_upgrade2018_realistic_v19 --era Run2_2018,run2_nanoAOD_102Xv1 --customise_commands="process.add_(cms.Service('InitRootHandlers', EnableIMT = cms.untracked.bool(False)))" --customise JMEAnalysis/JetToolbox/nanoAOD_jetToolbox_cff.nanoJTB_customizeMC --filein /store/mc/RunIIAutumn18MiniAOD/TTJets_TuneCP5_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/102X_upgrade2018_realistic_v15_ext1-v2/20000/7E65457A-87E5-C146-8321-9A48B4F56ED1.root --fileout file:jetToolbox_nano_mc.root +~~~ + +Notice that the `--customise` option points to the file [JMEAnalysis/JetToolbox/python/nanoAOD_jetToolbox_cff.py](python/nanoAOD_jetToolbox_cff). + + +A working example, after running the cmsDriver command shown above, is located here: [JMEAnalysis/JetToolbox/test/jetToolbox_nanoAODv05_cfg.py](test/jetToolbox_nanoAODv05_cfg.py). + +All the variables created by the jetToolbox start with `selectedJet`. + ## More Information diff --git a/plugins/JetTester.cc b/plugins/JetTester.cc index b38b1029c62..c9433cbe6f9 100644 --- a/plugins/JetTester.cc +++ b/plugins/JetTester.cc @@ -820,7 +820,7 @@ JetTester::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) using namespace std; using namespace reco; using namespace pat; - bool verbose = false; + //bool verbose = false; //-------------------------------------------------------------------------------------------- // AK R=0.4 CHS jets - from miniAOD diff --git a/python/nanoAOD_jetToolbox_cff.py b/python/nanoAOD_jetToolbox_cff.py new file mode 100644 index 00000000000..81ebfeca7cf --- /dev/null +++ b/python/nanoAOD_jetToolbox_cff.py @@ -0,0 +1,48 @@ +import FWCore.ParameterSet.Config as cms +from PhysicsTools.NanoAOD.common_cff import * +### NanoAOD v5 (for 2016,2017,2018), for different recipe please modify accordingly +from Configuration.Eras.Modifier_run2_nanoAOD_94X2016_cff import run2_nanoAOD_94X2016 +from Configuration.Eras.Modifier_run2_nanoAOD_94XMiniAODv2_cff import run2_nanoAOD_94XMiniAODv2 +from Configuration.Eras.Modifier_run2_nanoAOD_102Xv1_cff import run2_nanoAOD_102Xv1 + +# --------------------------------------------------------- +# This is the part the user should modify +def setupCustomizedJetToolbox(process): + + # recluster Puppi jets, add N-Subjettiness and ECF + bTagDiscriminators = [ + #'pfCombinedInclusiveSecondaryVertexV2BJetTags', + #'pfBoostedDoubleSecondaryVertexAK8BJetTags', + 'pfMassIndependentDeepDoubleBvLJetTags:probQCD', + 'pfMassIndependentDeepDoubleBvLJetTags:probHbb', + #'pfDeepCSVJetTags:probb', + #'pfDeepCSVJetTags:probbb', + ] + subjetBTagDiscriminators = [ + 'pfCombinedInclusiveSecondaryVertexV2BJetTags', + 'pfDeepCSVJetTags:probb', + 'pfDeepCSVJetTags:probbb', + ] + JETCorrLevels = ['L2Relative', 'L3Absolute', 'L2L3Residual'] + + from JMEAnalysis.JetToolbox.jetToolbox_cff_withNanoAOD import jetToolbox + jetToolbox(process, 'ak8', 'dummyseq', 'noOutput', + dataTier='nanoAOD', + PUMethod='Puppi', JETCorrPayload='AK4PFPuppi', JETCorrLevels=JETCorrLevels, + #addQGTagger=True, + Cut='pt > 170.0 && abs(rapidity()) < 2.4', + runOnMC=True, + addNsub=True, maxTau=3, addEnergyCorrFunc=True, + addSoftDrop=True, addSoftDropSubjets=True, subJETCorrPayload='AK4PFPuppi', subJETCorrLevels=JETCorrLevels, + #bTagDiscriminators=bTagDiscriminators, + #subjetBTagDiscriminators=subjetBTagDiscriminators + ) + +# --------------------------------------------------------- + +def nanoJTB_customizeMC(process): + run2_nanoAOD_94X2016.toModify(process, setupCustomizedJetToolbox) + run2_nanoAOD_94XMiniAODv2.toModify(process, setupCustomizedJetToolbox) + run2_nanoAOD_102Xv1.toModify(process, setupCustomizedJetToolbox) + process.NANOAODSIMoutput.fakeNameForCrab = cms.untracked.bool(True) # needed for crab publication + return process From f6e6ce881d06da178627f731fd44aab9fec5014f Mon Sep 17 00:00:00 2001 From: Alejandro Gomez Espinosa Date: Fri, 21 Jun 2019 16:20:50 +0200 Subject: [PATCH 4/9] update README and first complete version with nanoAOD --- README.md | 8 +- python/jetToolbox_cff.py | 385 ++++++++++++++++++++----------- python/nanoAOD_jetToolbox_cff.py | 2 +- test/jetToolbox_nanoAODv5_cfg.py | 99 ++++++++ 4 files changed, 360 insertions(+), 134 deletions(-) create mode 100644 test/jetToolbox_nanoAODv5_cfg.py diff --git a/README.md b/README.md index ed962f75863..26998ad94a5 100644 --- a/README.md +++ b/README.md @@ -25,9 +25,9 @@ cmsRun JMEAnalysis/JetToolbox/test/ClusterWithToolboxAndMakeHistos.py ~~~ In this python file you also can see a basic example on how to use the toolbox. -## Instruction to run jetToolbox in nanoAOD (beta version) +## Instruction to produce modified nanoAOD with the jetToolbox (beta version) -This is a beta version on how to modify nanoAOD production to incorporate different jet collections in nanoAOD format. +This is a beta version on how to modify nanoAOD production to incorporate different jet collections in nanoAOD format. This will create the standard nanoAOD variables plus new variables run by the jetToolbox. The only file that needs to be modified is [JMEAnalysis/JetToolbox/python/nanoAOD_jetToolbox_cff.py](python/nanoAOD_jetToolbox_cff.py), using the same setting as in the miniAOD case. *The main change is the dataTier parameter, in case of nanoAOD:* `dataTier="nanoAOD"`. @@ -37,12 +37,12 @@ After modify the `setupCustomizedJetToolbox` function in that file, one can run cmsDriver.py nanoAOD_jetToolbox_cff -s NANO --mc --eventcontent NANOAODSIM --datatier NANOAODSIM --no_exec --conditions 102X_upgrade2018_realistic_v19 --era Run2_2018,run2_nanoAOD_102Xv1 --customise_commands="process.add_(cms.Service('InitRootHandlers', EnableIMT = cms.untracked.bool(False)))" --customise JMEAnalysis/JetToolbox/nanoAOD_jetToolbox_cff.nanoJTB_customizeMC --filein /store/mc/RunIIAutumn18MiniAOD/TTJets_TuneCP5_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/102X_upgrade2018_realistic_v15_ext1-v2/20000/7E65457A-87E5-C146-8321-9A48B4F56ED1.root --fileout file:jetToolbox_nano_mc.root ~~~ -Notice that the `--customise` option points to the file [JMEAnalysis/JetToolbox/python/nanoAOD_jetToolbox_cff.py](python/nanoAOD_jetToolbox_cff). +Notice that the `--customise` option points to the file [JMEAnalysis/JetToolbox/python/nanoAOD_jetToolbox_cff.py](python/nanoAOD_jetToolbox_cff.py). A working example, after running the cmsDriver command shown above, is located here: [JMEAnalysis/JetToolbox/test/jetToolbox_nanoAODv05_cfg.py](test/jetToolbox_nanoAODv05_cfg.py). -All the variables created by the jetToolbox start with `selectedJet`. +All the variables created by the jetToolbox start with `selectedPatJets**`. ## More Information diff --git a/python/jetToolbox_cff.py b/python/jetToolbox_cff.py index 83347b9e9c1..173de844dca 100644 --- a/python/jetToolbox_cff.py +++ b/python/jetToolbox_cff.py @@ -22,13 +22,14 @@ from PhysicsTools.PatAlgos.selectionLayer1.jetSelector_cfi import selectedPatJets from PhysicsTools.PatAlgos.tools.jetTools import addJetCollection, updateJetCollection, switchJetCollection from PhysicsTools.PatAlgos.tools.helpers import getPatAlgosToolsTask, addToProcessAndTask +from PhysicsTools.NanoAOD.common_cff import * from collections import OrderedDict def jetToolbox( proc, jetType, jetSequence, outputFile, updateCollection='', updateCollectionSubjets='', newPFCollection=False, nameNewPFCollection = '', PUMethod='CHS', - miniAOD=True, + dataTier='miniAOD', runOnMC=True, JETCorrPayload='', JETCorrLevels = [ 'None' ], GetJetMCFlavour=True, Cut = '', @@ -65,10 +66,14 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, tvLabel = '' toolsUsed = [] mod = OrderedDict() + jetVariables = OrderedDict() + subjetVariables = OrderedDict() runOnData = not runOnMC if runOnData: GetJetMCFlavour = False GetSubjetMCFlavour = False + if dataTier.startswith(('miniAOD', 'nanoAOD')): miniAOD = True + else: miniAOD = False ############################################################################### ############################################################################### @@ -139,12 +144,12 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, defaultBoostedBTagDiscriminators = [ 'pfBoostedDoubleSecondaryVertexAK8BJetTags', - #'pfMassIndependentDeepDoubleBvLJetTags:probQCD', - #'pfMassIndependentDeepDoubleBvLJetTags:probHbb', - #'pfMassIndependentDeepDoubleCvLJetTags:probQCD', - #'pfMassIndependentDeepDoubleCvLJetTags:probHcc', - #'pfMassIndependentDeepDoubleCvBJetTags:probHbb', - #'pfMassIndependentDeepDoubleCvBJetTags:probHcc', + 'pfMassIndependentDeepDoubleBvLJetTags:probQCD', + 'pfMassIndependentDeepDoubleBvLJetTags:probHbb', + 'pfMassIndependentDeepDoubleCvLJetTags:probQCD', + 'pfMassIndependentDeepDoubleCvLJetTags:probHcc', + 'pfMassIndependentDeepDoubleCvBJetTags:probHbb', + 'pfMassIndependentDeepDoubleCvBJetTags:probHcc', ] if updateCollection and (jetALGO=='AK8'): @@ -182,7 +187,7 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, ####### Recluster jets from scratch if not updateCollection: - mod["GenJetsNoNu"] = jetalgo+'GenJetsNoNu' + mod["GenJetsNoNu"] = jetalgo+'GenJetsNoNu' ####### Setting labels and running GenJets if miniAOD: @@ -477,6 +482,8 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, ######################################################################### mod["PFJetsOrUpdate"] = mod["PFJets"] if not updateCollection else updateCollection + for bD in bTagDiscriminators: jetVariables[bD] = Var("bDiscriminator('"+bD+"')", float, doc='bDiscriminator '+bD, precision=10) + for bD in subjetBTagDiscriminators: subjetVariables[bD] = Var("bDiscriminator('"+bD+"')", float, doc='subjet bDiscriminator '+bD, precision=10) ################################################################################# ################################################################################# @@ -513,6 +520,7 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, #### Adding softdrop mass as userFloat getattr( proc, mod["PATJets"]).userData.userFloats.src += [ mod["SoftDropMass"] ] + jetVariables['softdropMass'] = Var("userFloat('"+mod["SoftDropMass"]+"')", float, doc='Softdrop mass', precision=10) toolsUsed.append( mod["SoftDropMass"] ) ######################################################################### @@ -521,7 +529,6 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, #### Creating softdrop genjets and gensubjets mod["GenJetsNoNuSoftDrop"] = mod["GenJetsNoNu"]+'SoftDrop' - if runOnMC: _addProcessAndTask( proc, mod["GenJetsNoNuSoftDrop"], ak4GenJets.clone( @@ -651,6 +658,7 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, #### Adding softdrop mass as userFloat getattr( proc, mod["PATJets"]).userData.userFloats.src += [ mod["PrunedMass"] ] + jetVariables['prunedMass'] = Var("userFloat('"+mod["PrunedMass"]+"')", float, doc='Pruned mass', precision=10) elemToKeep += [ 'keep *_'+mod["PrunedMass"]+'_*_*'] toolsUsed.append( mod["PrunedMass"] ) ######################################################################### @@ -658,8 +666,8 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, #### For subjets if addPrunedSubjets: - mod["GenJetsNoNuPruned"] = mod["GenJetsNoNu"]+'Pruned' #### Creating pruning genjets and gensubjets + mod["GenJetsNoNuPruned"] = mod["GenJetsNoNu"]+'Pruned' if runOnMC: _addProcessAndTask( proc, mod["GenJetsNoNuPruned"], ak4GenJets.clone( @@ -776,6 +784,7 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, jetSeq += getattr(proc, mod["PFJetsTrimmed"]) jetSeq += getattr(proc, mod["TrimmedMass"]) getattr( proc, mod["PATJets"]).userData.userFloats.src += [mod["TrimmedMass"]] + jetVariables['trimmedMass'] = Var("userFloat('"+mod["TrimmedMass"]+"')", float, doc='Trimmed mass', precision=10) toolsUsed.append( mod["TrimmedMass"] ) ################################################################################# @@ -802,122 +811,123 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, jetSeq += getattr(proc, mod["PFJetsFiltered"]) jetSeq += getattr(proc, mod["FilteredMass"]) getattr( proc, patJets+jetALGO+'PF'+PUMethod+postFix).userData.userFloats.src += [mod["FilteredMass"]] + jetVariables['filteredMass'] = Var("userFloat('"+mod["FilteredMass"]+"')", float, doc='Filtered mass', precision=10) toolsUsed.append( mod["FilteredMass"] ) ################################################################################# ################################################################################# - ####### Adding CMSTopTagger -# if addCMSTopTagger : -# -# if 'CA' in jetALGO : -# -# mod["PFJetsCMSTopTag"] = mod["PFJets"].replace(jetalgo,"cmsTopTag") -# _addProcessAndTask( proc, mod["PFJetsCMSTopTag"], -# cms.EDProducer("CATopJetProducer", -# PFJetParameters.clone( -# src = cms.InputTag( mod["PFJetsConstituentsColonOrUpdate"] ), -# doAreaFastjet = cms.bool(True), -# doRhoFastjet = cms.bool(False), -# jetPtMin = cms.double(100.0) -# ), -# AnomalousCellParameters, -# CATopJetParameters.clone( jetCollInstanceName = cms.string("SubJets"), -# verbose = cms.bool(False), -# algorithm = cms.int32(1), # 0 = KT, 1 = CA, 2 = anti-KT -# tagAlgo = cms.int32(0), #0=legacy top -# useAdjacency = cms.int32(2), # modified adjacency -# centralEtaCut = cms.double(2.5), # eta for defining "central" jets -# sumEtBins = cms.vdouble(0,1600,2600), # sumEt bins over which cuts vary. vector={bin 0 lower bound, bin 1 lower bound, ...} -# rBins = cms.vdouble(0.8,0.8,0.8), # Jet distance paramter R. R values depend on sumEt bins. -# ptFracBins = cms.vdouble(0.05,0.05,0.05), # minimum fraction of central jet pt for subjets (deltap) -# deltarBins = cms.vdouble(0.19,0.19,0.19), # Applicable only if useAdjacency=1. deltar adjacency values for each sumEtBin -# nCellBins = cms.vdouble(1.9,1.9,1.9), -# ), -# jetAlgorithm = cms.string("CambridgeAachen"), -# rParam = cms.double(jetSize), -# writeCompound = cms.bool(True) -# ) -# ) -# -# mod["CATopTagInfos"] = "CATopTagInfos"+postFix -# _addProcessAndTask( proc, mod["CATopTagInfos"], -# cms.EDProducer("CATopJetTagger", -# src = cms.InputTag(mod["PFJetsCMSTopTag"]), -# TopMass = cms.double(171), -# TopMassMin = cms.double(0.), -# TopMassMax = cms.double(250.), -# WMass = cms.double(80.4), -# WMassMin = cms.double(0.0), -# WMassMax = cms.double(200.0), -# MinMassMin = cms.double(0.0), -# MinMassMax = cms.double(200.0), -# verbose = cms.bool(False) -# ) -# ) -# mod["PATJetsCMSTopTagLabel"] = 'CMSTopTag'+PUMethod+postFix -# addJetCollection( -# proc, -# labelName = mod["PATJetsCMSTopTagLabel"], -# jetSource = cms.InputTag(mod["PFJetsCMSTopTag"]), -# jetCorrections = JEC if JEC is not None else None, -# pfCandidates = cms.InputTag( pfCand ), -# pvSource = cms.InputTag( pvLabel), -# svSource = cms.InputTag( svLabel ), -# muSource = cms.InputTag( muLabel ), -# elSource = cms.InputTag( elLabel ), -# btagDiscriminators = bTagDiscriminators, -# btagInfos = bTagInfos, -# genJetCollection = cms.InputTag(mod["GenJetsNoNu"]), -# getJetMCFlavour = False, # jet flavor should always be disabled for groomed jets -# genParticles = cms.InputTag(genParticlesLabel) -# ) -# mod["PATJetsCMSTopTag"] = patJets+mod["PATJetsCMSTopTagLabel"] -# mod["selPATJetsCMSTopTag"] = selPatJets+mod["PATJetsCMSTopTagLabel"] -# getattr(proc,mod["PATJetsCMSTopTag"]).addTagInfos = True -# getattr(proc,mod["PATJetsCMSTopTag"]).tagInfoSources = cms.VInputTag( cms.InputTag(mod["CATopTagInfos"])) -# _addProcessAndTask( proc, mod["selPATJetsCMSTopTag"], selectedPatJets.clone( src = mod["PATJetsCMSTopTag"], cut = Cut ) ) -# -# mod["PATSubjetsCMSTopTagLabel"] = mod["PATJetsCMSTopTagLabel"]+'Subjets' -# addJetCollection( -# proc, -# labelName = mod["PATSubjetsCMSTopTagLabel"], -# jetSource = cms.InputTag(mod["PFJetsCMSTopTag"], 'SubJets'), -# algo = jetalgo, # needed for subjet b tagging -# rParam = jetSize, # needed for subjet b tagging -# jetCorrections = subJEC if subJEC is not None else None, -# pfCandidates = cms.InputTag( pfCand ), -# pvSource = cms.InputTag( pvLabel), -# svSource = cms.InputTag( svLabel ), -# muSource = cms.InputTag( muLabel ), -# elSource = cms.InputTag( elLabel ), -# btagDiscriminators = bTagDiscriminators, -# btagInfos = bTagInfos, -# genJetCollection = cms.InputTag( mod["GenJetsNoNu"]), -# getJetMCFlavour = GetSubjetMCFlavour, -# explicitJTA = True, # needed for subjet b tagging -# svClustering = True, # needed for subjet b tagging -# fatJets=cms.InputTag(mod["PFJets"]), # needed for subjet flavor clustering -# groomedFatJets=cms.InputTag(mod["PATJetsCMSTopTag"]), # needed for subjet flavor clustering -# genParticles = cms.InputTag(genParticlesLabel) -# ) -# mod["PATSubjetsCMSTopTag"] = patJets+mod["PATSubjetsCMSTopTagLabel"] -# mod["selPATSubjetsCMSTopTag"] = selPatJets+mod["PATSubjetsCMSTopTagLabel"] -# -# _addProcessAndTask( proc, mod["selPATSubjetsCMSTopTag"], selectedPatJets.clone( src = mod["PATSubjetsCMSTopTag"], cut = Cut ) ) -# -# mod["PATJetsCMSTopTagPacked"] = mod["PATJetsCMSTopTag"]+'Packed' -# _addProcessAndTask( proc, mod["PATJetsCMSTopTagPacked"], -# cms.EDProducer("BoostedJetMerger", -# jetSrc=cms.InputTag(mod["PATJetsCMSTopTag"]), -# subjetSrc=cms.InputTag(mod["PATSubjetsCMSTopTag"]) -# )) -# jetSeq += getattr(proc, mod["PATJetsCMSTopTagPacked"]) -# elemToKeep += [ 'keep *_'+mod["PATJetsCMSTopTagPacked"]+'_*_*' ] -# toolsUsed.append( mod["PATJetsCMSTopTagPacked"] ) -# -# else: -# raise ValueError('|---- jetToolBox: CMS recommends CambridgeAachen for CMS Top Tagger, you are using '+algorithm+'. JetToolbox will not run CMS Top Tagger.') + ####### Adding CMSTopTagger (NOTE: it has not been validated or test since 2017) + if addCMSTopTagger : + + if 'CA' in jetALGO : + + mod["PFJetsCMSTopTag"] = mod["PFJets"].replace(jetalgo,"cmsTopTag") + _addProcessAndTask( proc, mod["PFJetsCMSTopTag"], + cms.EDProducer("CATopJetProducer", + PFJetParameters.clone( + src = cms.InputTag( mod["PFJetsConstituentsColonOrUpdate"] ), + doAreaFastjet = cms.bool(True), + doRhoFastjet = cms.bool(False), + jetPtMin = cms.double(100.0) + ), + AnomalousCellParameters, + CATopJetParameters.clone( jetCollInstanceName = cms.string("SubJets"), + verbose = cms.bool(False), + algorithm = cms.int32(1), # 0 = KT, 1 = CA, 2 = anti-KT + tagAlgo = cms.int32(0), #0=legacy top + useAdjacency = cms.int32(2), # modified adjacency + centralEtaCut = cms.double(2.5), # eta for defining "central" jets + sumEtBins = cms.vdouble(0,1600,2600), # sumEt bins over which cuts vary. vector={bin 0 lower bound, bin 1 lower bound, ...} + rBins = cms.vdouble(0.8,0.8,0.8), # Jet distance paramter R. R values depend on sumEt bins. + ptFracBins = cms.vdouble(0.05,0.05,0.05), # minimum fraction of central jet pt for subjets (deltap) + deltarBins = cms.vdouble(0.19,0.19,0.19), # Applicable only if useAdjacency=1. deltar adjacency values for each sumEtBin + nCellBins = cms.vdouble(1.9,1.9,1.9), + ), + jetAlgorithm = cms.string("CambridgeAachen"), + rParam = cms.double(jetSize), + writeCompound = cms.bool(True) + ) + ) + + mod["CATopTagInfos"] = "CATopTagInfos"+postFix + _addProcessAndTask( proc, mod["CATopTagInfos"], + cms.EDProducer("CATopJetTagger", + src = cms.InputTag(mod["PFJetsCMSTopTag"]), + TopMass = cms.double(171), + TopMassMin = cms.double(0.), + TopMassMax = cms.double(250.), + WMass = cms.double(80.4), + WMassMin = cms.double(0.0), + WMassMax = cms.double(200.0), + MinMassMin = cms.double(0.0), + MinMassMax = cms.double(200.0), + verbose = cms.bool(False) + ) + ) + mod["PATJetsCMSTopTagLabel"] = 'CMSTopTag'+PUMethod+postFix + addJetCollection( + proc, + labelName = mod["PATJetsCMSTopTagLabel"], + jetSource = cms.InputTag(mod["PFJetsCMSTopTag"]), + jetCorrections = JEC if JEC is not None else None, + pfCandidates = cms.InputTag( pfCand ), + pvSource = cms.InputTag( pvLabel), + svSource = cms.InputTag( svLabel ), + muSource = cms.InputTag( muLabel ), + elSource = cms.InputTag( elLabel ), + btagDiscriminators = bTagDiscriminators, + btagInfos = bTagInfos, + genJetCollection = cms.InputTag(mod["GenJetsNoNu"]), + getJetMCFlavour = False, # jet flavor should always be disabled for groomed jets + genParticles = cms.InputTag(genParticlesLabel) + ) + mod["PATJetsCMSTopTag"] = patJets+mod["PATJetsCMSTopTagLabel"] + mod["selPATJetsCMSTopTag"] = selPatJets+mod["PATJetsCMSTopTagLabel"] + getattr(proc,mod["PATJetsCMSTopTag"]).addTagInfos = True + getattr(proc,mod["PATJetsCMSTopTag"]).tagInfoSources = cms.VInputTag( cms.InputTag(mod["CATopTagInfos"])) + _addProcessAndTask( proc, mod["selPATJetsCMSTopTag"], selectedPatJets.clone( src = mod["PATJetsCMSTopTag"], cut = Cut ) ) + + mod["PATSubjetsCMSTopTagLabel"] = mod["PATJetsCMSTopTagLabel"]+'Subjets' + addJetCollection( + proc, + labelName = mod["PATSubjetsCMSTopTagLabel"], + jetSource = cms.InputTag(mod["PFJetsCMSTopTag"], 'SubJets'), + algo = jetalgo, # needed for subjet b tagging + rParam = jetSize, # needed for subjet b tagging + jetCorrections = subJEC if subJEC is not None else None, + pfCandidates = cms.InputTag( pfCand ), + pvSource = cms.InputTag( pvLabel), + svSource = cms.InputTag( svLabel ), + muSource = cms.InputTag( muLabel ), + elSource = cms.InputTag( elLabel ), + btagDiscriminators = bTagDiscriminators, + btagInfos = bTagInfos, + genJetCollection = cms.InputTag( mod["GenJetsNoNu"]), + getJetMCFlavour = GetSubjetMCFlavour, + explicitJTA = True, # needed for subjet b tagging + svClustering = True, # needed for subjet b tagging + fatJets=cms.InputTag(mod["PFJets"]), # needed for subjet flavor clustering + groomedFatJets=cms.InputTag(mod["PATJetsCMSTopTag"]), # needed for subjet flavor clustering + genParticles = cms.InputTag(genParticlesLabel) + ) + mod["PATSubjetsCMSTopTag"] = patJets+mod["PATSubjetsCMSTopTagLabel"] + mod["selPATSubjetsCMSTopTag"] = selPatJets+mod["PATSubjetsCMSTopTagLabel"] + + _addProcessAndTask( proc, mod["selPATSubjetsCMSTopTag"], selectedPatJets.clone( src = mod["PATSubjetsCMSTopTag"], cut = Cut ) ) + + mod["PATJetsCMSTopTagPacked"] = mod["PATJetsCMSTopTag"]+'Packed' + _addProcessAndTask( proc, mod["PATJetsCMSTopTagPacked"], + cms.EDProducer("BoostedJetMerger", + jetSrc=cms.InputTag(mod["PATJetsCMSTopTag"]), + subjetSrc=cms.InputTag(mod["PATSubjetsCMSTopTag"]) + )) + jetSeq += getattr(proc, mod["PATJetsCMSTopTagPacked"]) + elemToKeep += [ 'keep *_'+mod["PATJetsCMSTopTagPacked"]+'_*_*' ] + toolsUsed.append( mod["PATJetsCMSTopTagPacked"] ) + + else: + raise ValueError('|---- jetToolBox: CMS recommends CambridgeAachen for CMS Top Tagger, you are using '+algorithm+'. JetToolbox will not run CMS Top Tagger.') ################################################################################# @@ -933,13 +943,11 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, rParam = jetSize, src = cms.InputTag( mod["PFJetsConstituentsColonOrUpdate"] ), ) ) - _addProcessAndTask( proc, mod["MassDropFilteredMass"], - ak8PFJetsCHSPrunedMass.clone( - src = cms.InputTag( mod["PFJets"]), - matched = cms.InputTag(mod["PFJetsMassDrop"]), - distMax = cms.double( jetSize ) ) ) + _addProcessAndTask( proc, mod["MassDropFilteredMass"], ak8PFJetsCHSPrunedMass.clone( src = cms.InputTag( mod["PFJets"]), + matched = cms.InputTag(mod["PFJetsMassDrop"]), distMax = cms.double( jetSize ) ) ) elemToKeep += [ 'keep *_'+mod["MassDropFilteredMass"]+'_*_*' ] getattr( proc, mod["PATJets"]).userData.userFloats.src += [ mod["MassDropFilteredMass"] ] + jetVariables['massDropFilteredMass'] = Var("userFloat('"+mod["MassDropFilteredMass"]+"')", float, doc='MassDropFiltered mass', precision=10) jetSeq += getattr(proc, mod["PFJetsMassDrop"]) jetSeq += getattr(proc, mod["MassDropFilteredMass"]) toolsUsed.append( mod["MassDropFilteredMass"] ) @@ -987,6 +995,7 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, elemToKeep += [ 'keep *_'+mod["PFJetsHEPTopTagMass"]+'_*_*' ] getattr( proc, mod["PATJets"] ).userData.userFloats.src += [ mod["PFJetsHEPTopTagMass"] ] #getattr( proc, mod["PATJets"] ).userData.userFloats.src += [ "fRec" ] + jetVariables['HEPTopTagMass'] = Var("userFloat('"+mod["PFJetsHEPTopTagMass"]+"')", float, doc='HEPTopTagMass', precision=10) jetSeq += getattr(proc, mod["PFJetsHEPTopTagMass"]) toolsUsed.append( mod["PFJetsHEPTopTagMass"] ) @@ -1077,7 +1086,9 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, akAxesR0 = cms.double(-999.0) ) ) # not used by default elemToKeep += [ 'keep *_'+mod["Njettiness"]+'_*_*' ] - for tau in rangeTau: getattr( proc, mod["PATJets"]).userData.userFloats.src += [mod["Njettiness"]+':tau'+str(tau) ] + for tau in rangeTau: + getattr( proc, mod["PATJets"]).userData.userFloats.src += [mod["Njettiness"]+':tau'+str(tau) ] + jetVariables[mod["Njettiness"]+':tau'+str(tau)] = Var("userFloat('"+mod["Njettiness"]+':tau'+str(tau)+"')", float, doc='Nsubjetiness tau'+str(tau), precision=10) jetSeq += getattr(proc, mod["Njettiness"]) toolsUsed.append( mod["Njettiness"] ) ################################################################################# @@ -1121,7 +1132,9 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, akAxesR0 = cms.double(-999.0) ) ) # not used by default elemToKeep += [ 'keep *_'+mod["Nsubjettiness"]+'_*_*' ] - for tau in rangeTau: getattr( proc, ( mod["NsubPATSubjets"] if not updateCollectionSubjets else patSubJets ) ).userData.userFloats.src += [mod["Nsubjettiness"]+':tau'+str(tau) ] + for tau in rangeTau: + getattr( proc, ( mod["NsubPATSubjets"] if not updateCollectionSubjets else patSubJets ) ).userData.userFloats.src += [mod["Nsubjettiness"]+':tau'+str(tau) ] + subjetVariables[mod["Nsubjettiness"]+':tau'+str(tau)] = Var("userFloat('"+mod["Nsubjettiness"]+':tau'+str(tau)+"')", float, doc='Nsubjetiness tau'+str(tau), precision=10) jetSeq += getattr(proc, mod["Nsubjettiness"]) toolsUsed.append( mod["Nsubjettiness"] ) ################################################################################# @@ -1142,6 +1155,13 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, ) elemToKeep += [ 'keep *_'+mod["QGTagger"]+'_*_*' ] getattr( proc, mod["PATJets"]).userData.userFloats.src += [mod["QGTagger"]+':qgLikelihood'] + #getattr( proc, mod["PATJets"]).userData.userFloats.src += [ mod["QGTagger"]+':axis2'] + #getattr( proc, mod["PATJets"]).userData.userFloats.src += [ mod["QGTagger"]+':mult'] + #getattr( proc, mod["PATJets"]).userData.userFloats.src += [ mod["QGTagger"]+':ptD'] + jetVariables[mod["QGTagger"]+':qgLikelihood'] = Var("userFloat('"+mod["QGTagger"]+':qgLikelihood'+"')", float, doc='Quark/Gluon likelihood', precision=10) + #jetVariables[mod["QGTagger"]+':axis2'] = Var("userFloat('"+mod["QGTagger"]+':axis2'+"')", float, doc='QGL variable: minor axis of jet ellipse', precision=10) + #jetVariables[mod["QGTagger"]+':mult'] = Var("userFloat('"+mod["QGTagger"]+':mult'+"')", float, doc='QGL variable: jet constituent multiplicity', precision=10) + #jetVariables[mod["QGTagger"]+':ptD'] = Var("userFloat('"+mod["QGTagger"]+':ptD'+"')", float, doc='QGL variable: ptD', precision=10) jetSeq += getattr(proc, mod["QGTagger"]) toolsUsed.append( mod["QGTagger"] ) @@ -1178,7 +1198,10 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, ) getattr( proc, mod["PATJets"]).userData.userFloats.src += [mod["PUJetIDEval"]+':fullDiscriminant'] + jetVariables[mod["PUJetIDEval"]+':fullDiscriminant'] = Var("userFloat('"+mod["PUJetIDEval"]+':fullDiscriminant'+"')", float, doc='PUJetID fulldiscriminant', precision=10) getattr( proc, mod["PATJets"]).userData.userInts.src += [mod["PUJetIDEval"]+':cutbasedId',mod["PUJetIDEval"]+':fullId'] + jetVariables[mod["PUJetIDEval"]+':cutbasedId'] = Var("userInt('"+mod["PUJetIDEval"]+':cutbasedId'+"')", int, doc='PUJetID cutbased Id', precision=10) + jetVariables[mod["PUJetIDEval"]+':fullId'] = Var("userInt('"+mod["PUJetIDEval"]+':fullId'+"')", int, doc='PUJetID full Id', precision=10) elemToKeep += ['keep *_'+mod["PUJetIDEval"]+'_*_*'] toolsUsed.append( mod["PUJetIDEval"] ) else: @@ -1227,6 +1250,8 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, getattr(proc, mod["PATJets"]).userData.userFloats.src += [ mod["PFJetsSoftDropValueMap"]+':'+mod["ECF"+ecfVar]+ecfType+'2', mod["PFJetsSoftDropValueMap"]+':'+mod["ECF"+ecfVar]+ecfType+'3' ] + jetVariables[mod["PFJetsSoftDropValueMap"]+':'+mod["ECF"+ecfVar]+ecfType+'2'] = Var("userFloat('"+mod["PFJetsSoftDropValueMap"]+':'+mod["ECF"+ecfVar]+ecfType+'2'+"')", float, doc='ECF '+ecfType+'2', precision=10) + jetVariables[mod["PFJetsSoftDropValueMap"]+':'+mod["ECF"+ecfVar]+ecfType+'3'] = Var("userFloat('"+mod["PFJetsSoftDropValueMap"]+':'+mod["ECF"+ecfVar]+ecfType+'3'+"')", float, doc='ECF '+ecfType+'3', precision=10) ################################################################################# @@ -1254,6 +1279,32 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, mod["ECF"+ecfSubjetVar]+':ecf'+ecfSubjetType+'2', mod["ECF"+ecfSubjetVar]+':ecf'+ecfSubjetType+'3' ] + subjetVariables[mod["ECF"+ecfSubjetVar]+':ecf'+ecfSubjetType+'2'] = Var("userFloat('"+mod["ECF"+ecfSubjetVar]+':ecf'+ecfSubjetType+'2'+"')", float, doc='ECF '+ecfType+'2', precision=10) + subjetVariables[mod["ECF"+ecfSubjetVar]+':ecf'+ecfSubjetType+'3'] = Var("userFloat('"+mod["ECF"+ecfSubjetVar]+':ecf'+ecfSubjetType+'3'+"')", float, doc='ECF '+ecfType+'3', precision=10) + ################################################################################# + + ################################################################################# + ###### Computing jetID + from PhysicsTools.NanoAOD.jets_cff import looseJetId, tightJetId, tightJetIdLepVeto + + mod["looseJetId"] = mod["PATJets"]+"looseJetId" + _addProcessAndTask( proc, mod["looseJetId"], looseJetId.clone(src = cms.InputTag(mod["PATJets"]) )) + mod["tightJetId"] = mod["PATJets"]+"tightJetId" + _addProcessAndTask( proc, mod["tightJetId"], tightJetId.clone(src = cms.InputTag(mod["PATJets"]) )) + mod["tightJetIdLepVeto"] = mod["PATJets"]+"tightJetIdLepVeto" + _addProcessAndTask( proc, mod["tightJetIdLepVeto"], tightJetIdLepVeto.clone(src = cms.InputTag(mod["PATJets"]) )) + + _addProcessAndTask( proc, "PATJetswithUserData", + cms.EDProducer("PATJetUserDataEmbedder", + src = cms.InputTag(mod["PATJets"]), + userFloats = cms.PSet(), + userInts= cms.PSet( + looseId = cms.InputTag(mod["looseJetId"]), + tightId = cms.InputTag(mod["tightJetId"]), + tightIdLepVeto = cms.InputTag(mod["tightJetIdLepVeto"]), + )) + ) + jetSeq += getattr(proc, "PATJetswithUserData") ################################################################################# @@ -1261,7 +1312,8 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, ###### Saving jet collections if hasattr(proc, 'patJetPartons'): proc.patJetPartons.particles = genParticlesLabel - _addProcessAndTask( proc, mod["selPATJets"], selectedPatJets.clone( src = mod["PATJets"], cut = Cut ) ) + #_addProcessAndTask( proc, mod["selPATJets"], selectedPatJets.clone( src = mod["PATJets"], cut = Cut ) ) + _addProcessAndTask( proc, mod["selPATJets"], cms.EDFilter("PATJetRefSelector", src = cms.InputTag("PATJetswithUserData"), cut = cms.string( Cut ) ) ) elemToKeep += [ 'keep *_'+mod["selPATJets"]+'_*_*' ] elemToKeep += [ 'drop *_'+mod["selPATJets"]+'_calo*_*' ] elemToKeep += [ 'drop *_'+mod["selPATJets"]+'_tagInfos_*' ] @@ -1276,6 +1328,80 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, if len(toolsUsed) > 0 and verbosity>=2: print('|---- jetToolBox: Running '+', '.join(toolsUsed)+'.') if verbosity>=2: print('|---- jetToolBox: Creating '+mod["selPATJets"]+' collection.') if updateCollectionSubjets and verbosity>=2: print('|---- jetToolBox: Creating '+mod["selPATSubjets"]+' collection.') + ################################################################################# + + ################################################################################# + ###### adding variables as nanoAOD variables + if dataTier.startswith('nanoAOD'): + print('\033[1m'+'|---- jetToolBox: RUNNING FROM MINIAOD BUT STORING VARIABLES IN NANOAOD FORMAT.'+'\033[0m') + + #### Adding genJets info + if runOnMC: + from PhysicsTools.NanoAOD.jets_cff import genJetTable, genSubJetAK8Table + _addProcessAndTask( proc, 'jetToolboxGenJetTable', genJetTable.clone( + src = cms.InputTag(mod["GenJetsNoNu"]), + name = cms.string(mod["GenJetsNoNu"]), + doc=cms.string("customized jetToolbox variables for genjets"), + cut = cms.string(("pt > 100." if jetSize>.7 else 'pt>10' )), + )) + if addPrunedSubjets or addSoftDropSubjets: + _addProcessAndTask( proc, 'jetToolboxGenSubJetTable', genJetTable.clone( + src = cms.InputTag(mod["GenJetsNoNu"+("SoftDrop" if addSoftDropSubjets else "Pruned")]), + name = cms.string(mod["GenJetsNoNu"+("SoftDrop" if addSoftDropSubjets else "Pruned")]), + doc=cms.string("customized jetToolbox variables for gensubjets"), + )) + + + #### Adding Jets info + _addProcessAndTask( proc, 'jetToolboxJetTable', cms.EDProducer("SimpleCandidateFlatTableProducer", + src=cms.InputTag(mod["selPATJets"]), + name=cms.string(mod["selPATJets"]), + cut=cms.string(""), + doc=cms.string("customized jetToolbox variables for jets: "+mod["selPATJets"]), + singleton=cms.bool(False), # the number of entries is variable + extension=cms.bool(False), # this is the main table for the jets + variables=cms.PSet(P4Vars, + area=Var("jetArea()", float, doc="jet catchment area, for JECs", precision=10), + nMuons = Var("?hasOverlaps('muons')?overlaps('muons').size():0", int, doc="number of muons in the jet"), + muonIdx1 = Var("?overlaps('muons').size()>0?overlaps('muons')[0].key():-1", int, doc="index of first matching muon"), + muonIdx2 = Var("?overlaps('muons').size()>1?overlaps('muons')[1].key():-1", int, doc="index of second matching muon"), + electronIdx1 = Var("?overlaps('electrons').size()>0?overlaps('electrons')[0].key():-1", int, doc="index of first matching electron"), + electronIdx2 = Var("?overlaps('electrons').size()>1?overlaps('electrons')[1].key():-1", int, doc="index of second matching electron"), + nElectrons = Var("?hasOverlaps('electrons')?overlaps('electrons').size():0", int, doc="number of electrons in the jet"), + jetId = Var("userInt('looseId')+userInt('tightId')*2+4*userInt('tightIdLepVeto')",int,doc="Jet ID flags bit1 is loose, bit2 is tight, bit3 is tightLepVeto"), + nConstituents = Var("numberOfDaughters()",int,doc="Number of particles in the jet"), + rawFactor = Var("1.-jecFactor('Uncorrected')",float,doc="1 - Factor to get back to raw pT",precision=6), + chHEF = Var("chargedHadronEnergyFraction()", float, doc="charged Hadron Energy Fraction", precision= 6), + neHEF = Var("neutralHadronEnergyFraction()", float, doc="neutral Hadron Energy Fraction", precision= 6), + chEmEF = Var("chargedEmEnergyFraction()", float, doc="charged Electromagnetic Energy Fraction", precision= 6), + neEmEF = Var("neutralEmEnergyFraction()", float, doc="neutral Electromagnetic Energy Fraction", precision= 6), + muEF = Var("muonEnergyFraction()", float, doc="muon Energy Fraction", precision= 6), + ) + )) + + for varName, varDef in jetVariables.iteritems(): setattr( getattr( proc, 'jetToolboxJetTable' ).variables, varName.replace(":","_"), varDef ) + + if addPrunedSubjets or addSoftDropSubjets: + setattr( getattr( proc, 'jetToolboxJetTable' ).variables, 'subJetIdx1', Var("?nSubjetCollections()>0 && subjets().size()>0?subjets()[0].key():-1", int, doc="index of first subjet") ), + setattr( getattr( proc, 'jetToolboxJetTable' ).variables, 'subJetIdx2', Var("?nSubjetCollections()>0 && subjets().size()>1?subjets()[1].key():-1", int, doc="index of second subjet") ), + + _addProcessAndTask( proc, 'jetToolboxSubjetTable', cms.EDProducer("SimpleCandidateFlatTableProducer", + src=cms.InputTag(mod["selPATJets"+('Pruned' if addPrunedSubjets else 'SoftDrop')+"Packed"]+':SubJets'), + name=cms.string(mod["selPATJets"]+('Pruned' if addPrunedSubjets else 'SoftDrop')+'_Subjets'), + cut=cms.string(""), + doc=cms.string("customized jetToolbox variables for subjets"), + singleton=cms.bool(False), # the number of entries is variable + extension=cms.bool(False), # this is the main table for the jets + variables=cms.PSet(P4Vars, + rawFactor=Var("1.-jecFactor('Uncorrected')", float, doc="1 - Factor to get back to raw pT", precision=6), + area=Var("jetArea()", float, doc="jet catchment area, for JECs", precision=10), + nBHadrons=Var("jetFlavourInfo().getbHadrons().size()", int, doc="number of b-hadrons"), + nCHadrons=Var("jetFlavourInfo().getcHadrons().size()", int, doc="number of c-hadrons"), + ) + )) + for varName, varDef in subjetVariables.iteritems(): setattr( getattr( proc, 'jetToolboxSubjetTable' ).variables, varName.replace(":","_"), varDef ) + ################################################################################# + ################################################################################# ###### Adding to outputModule OR creating output file @@ -1294,6 +1420,7 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, setattr( proc, 'endpath', cms.EndPath(task) ) else: setattr( proc, 'endpath', cms.EndPath(getattr(proc, outputFile), task) ) + ################################################################################# #### removing mc matching for data if runOnData: diff --git a/python/nanoAOD_jetToolbox_cff.py b/python/nanoAOD_jetToolbox_cff.py index 81ebfeca7cf..7a4078a55fa 100644 --- a/python/nanoAOD_jetToolbox_cff.py +++ b/python/nanoAOD_jetToolbox_cff.py @@ -25,7 +25,7 @@ def setupCustomizedJetToolbox(process): ] JETCorrLevels = ['L2Relative', 'L3Absolute', 'L2L3Residual'] - from JMEAnalysis.JetToolbox.jetToolbox_cff_withNanoAOD import jetToolbox + from JMEAnalysis.JetToolbox.jetToolbox_cff import jetToolbox jetToolbox(process, 'ak8', 'dummyseq', 'noOutput', dataTier='nanoAOD', PUMethod='Puppi', JETCorrPayload='AK4PFPuppi', JETCorrLevels=JETCorrLevels, diff --git a/test/jetToolbox_nanoAODv5_cfg.py b/test/jetToolbox_nanoAODv5_cfg.py new file mode 100644 index 00000000000..97ca9027dc7 --- /dev/null +++ b/test/jetToolbox_nanoAODv5_cfg.py @@ -0,0 +1,99 @@ +# Auto generated configuration file +# using: +# Revision: 1.19 +# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v +# with command line options: myNanoProdMc2018_withJTB -s NANO --mc --eventcontent NANOAODSIM --datatier NANOAODSIM --no_exec --conditions 102X_upgrade2018_realistic_v19 --era Run2_2018,run2_nanoAOD_102Xv1 --customise JMEAnalysis/JetToolbox/nanoAOD_jetToolbox_cff.nanoJTB_customizeMC --customise_commands=process.add_(cms.Service('InitRootHandlers', EnableIMT = cms.untracked.bool(False))) +import FWCore.ParameterSet.Config as cms + +from Configuration.StandardSequences.Eras import eras + +process = cms.Process('NANO',eras.Run2_2018,eras.run2_nanoAOD_102Xv1) + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('SimGeneral.MixingModule.mixNoPU_cfi') +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('PhysicsTools.NanoAOD.nano_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1000) +) + +# Input source +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring('/store/mc/RunIIAutumn18MiniAOD/TTJets_TuneCP5_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/102X_upgrade2018_realistic_v15_ext1-v2/20000/7E65457A-87E5-C146-8321-9A48B4F56ED1.root'), + secondaryFileNames = cms.untracked.vstring() +) +#from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValTTbarPileUpMINIAODSIM +#process.source.fileNames = filesRelValTTbarPileUpMINIAODSIM + + +process.options = cms.untracked.PSet( + +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + annotation = cms.untracked.string('myNanoProdMc2018_withJTB nevts:1'), + name = cms.untracked.string('Applications'), + version = cms.untracked.string('$Revision: 1.19 $') +) + +# Output definition + +process.NANOAODSIMoutput = cms.OutputModule("NanoAODOutputModule", + compressionAlgorithm = cms.untracked.string('LZMA'), + compressionLevel = cms.untracked.int32(9), + dataset = cms.untracked.PSet( + dataTier = cms.untracked.string('NANOAODSIM'), + filterName = cms.untracked.string('') + ), + fileName = cms.untracked.string('jetToolbox_nanoAODv5.root'), + outputCommands = process.NANOAODSIMEventContent.outputCommands +) + +# Additional output definition + +# Other statements +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, '102X_upgrade2018_realistic_v19', '') + +# Path and EndPath definitions +process.nanoAOD_step = cms.Path(process.nanoSequenceMC) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.NANOAODSIMoutput_step = cms.EndPath(process.NANOAODSIMoutput) + +# Schedule definition +process.schedule = cms.Schedule(process.nanoAOD_step,process.endjob_step,process.NANOAODSIMoutput_step) +from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask +associatePatAlgosToolsTask(process) + +# customisation of the process. + +# Automatic addition of the customisation function from PhysicsTools.NanoAOD.nano_cff +from PhysicsTools.NanoAOD.nano_cff import nanoAOD_customizeMC + +#call to customisation function nanoAOD_customizeMC imported from PhysicsTools.NanoAOD.nano_cff +process = nanoAOD_customizeMC(process) + +# Automatic addition of the customisation function from JMEAnalysis.JetToolbox.nanoAOD_jetToolbox_cff +from JMEAnalysis.JetToolbox.nanoAOD_jetToolbox_cff import nanoJTB_customizeMC + +#call to customisation function nanoJTB_customizeMC imported from JMEAnalysis.JetToolbox.nanoAOD_jetToolbox_cff +process = nanoJTB_customizeMC(process) + +# End of customisation functions + +# Customisation from command line + +process.add_(cms.Service('InitRootHandlers', EnableIMT = cms.untracked.bool(False))) +# Add early deletion of temporary data products to reduce peak memory need +from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete +process = customiseEarlyDelete(process) +# End adding early deletion From 5d944cfa4e78b3bf297f4f36fd4b1db4f353e59a Mon Sep 17 00:00:00 2001 From: Alejandro Date: Wed, 3 Jul 2019 15:04:56 +0200 Subject: [PATCH 5/9] fix bug for nanoAOD with different jet collections --- python/jetToolbox_cff.py | 34 +++++++++------ python/nanoAOD_jetToolbox_cff.py | 74 ++++++++++++++++++++++---------- 2 files changed, 74 insertions(+), 34 deletions(-) diff --git a/python/jetToolbox_cff.py b/python/jetToolbox_cff.py index 173de844dca..8542a1571ec 100644 --- a/python/jetToolbox_cff.py +++ b/python/jetToolbox_cff.py @@ -1294,7 +1294,8 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, mod["tightJetIdLepVeto"] = mod["PATJets"]+"tightJetIdLepVeto" _addProcessAndTask( proc, mod["tightJetIdLepVeto"], tightJetIdLepVeto.clone(src = cms.InputTag(mod["PATJets"]) )) - _addProcessAndTask( proc, "PATJetswithUserData", + mod["PATJetswithUserData"] = mod["PATJets"]+"PATJetswithUserData" + _addProcessAndTask( proc, mod["PATJetswithUserData"], cms.EDProducer("PATJetUserDataEmbedder", src = cms.InputTag(mod["PATJets"]), userFloats = cms.PSet(), @@ -1304,7 +1305,7 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, tightIdLepVeto = cms.InputTag(mod["tightJetIdLepVeto"]), )) ) - jetSeq += getattr(proc, "PATJetswithUserData") + jetSeq += getattr(proc, mod["PATJetswithUserData"]) ################################################################################# @@ -1313,8 +1314,8 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, if hasattr(proc, 'patJetPartons'): proc.patJetPartons.particles = genParticlesLabel #_addProcessAndTask( proc, mod["selPATJets"], selectedPatJets.clone( src = mod["PATJets"], cut = Cut ) ) - _addProcessAndTask( proc, mod["selPATJets"], cms.EDFilter("PATJetRefSelector", src = cms.InputTag("PATJetswithUserData"), cut = cms.string( Cut ) ) ) - elemToKeep += [ 'keep *_'+mod["selPATJets"]+'_*_*' ] + _addProcessAndTask( proc, mod["selPATJets"], cms.EDFilter("PATJetRefSelector", src = cms.InputTag(mod["PATJetswithUserData"]), cut = cms.string( Cut ) ) ) + elemToKeep += [ 'keep *_'+mod["selPATJets"]+'_*_*' elemToKeep += [ 'drop *_'+mod["selPATJets"]+'_calo*_*' ] elemToKeep += [ 'drop *_'+mod["selPATJets"]+'_tagInfos_*' ] @@ -1338,22 +1339,28 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, #### Adding genJets info if runOnMC: from PhysicsTools.NanoAOD.jets_cff import genJetTable, genSubJetAK8Table - _addProcessAndTask( proc, 'jetToolboxGenJetTable', genJetTable.clone( + mod['jetToolboxGenJetTable'] = mod['GenJetsNoNu']+'JTBTable' + _addProcessAndTask( proc, mod['jetToolboxGenJetTable'], genJetTable.clone( src = cms.InputTag(mod["GenJetsNoNu"]), name = cms.string(mod["GenJetsNoNu"]), doc=cms.string("customized jetToolbox variables for genjets"), cut = cms.string(("pt > 100." if jetSize>.7 else 'pt>10' )), )) + jetSeq += getattr(proc, mod['jetToolboxGenJetTable']) + if addPrunedSubjets or addSoftDropSubjets: - _addProcessAndTask( proc, 'jetToolboxGenSubJetTable', genJetTable.clone( + mod['jetToolboxGenSubJetTable'] = mod["GenJetsNoNu"+("SoftDrop" if addSoftDropSubjets else "Pruned")]+'JTBTable' + _addProcessAndTask( proc, mod['jetToolboxGenSubJetTable'], genJetTable.clone( src = cms.InputTag(mod["GenJetsNoNu"+("SoftDrop" if addSoftDropSubjets else "Pruned")]), name = cms.string(mod["GenJetsNoNu"+("SoftDrop" if addSoftDropSubjets else "Pruned")]), doc=cms.string("customized jetToolbox variables for gensubjets"), )) + jetSeq += getattr(proc, mod['jetToolboxGenSubJetTable']) #### Adding Jets info - _addProcessAndTask( proc, 'jetToolboxJetTable', cms.EDProducer("SimpleCandidateFlatTableProducer", + mod['jetToolboxJetTable'] = mod["selPATJets"]+'JTBTable' + _addProcessAndTask( proc, mod['jetToolboxJetTable'], cms.EDProducer("SimpleCandidateFlatTableProducer", src=cms.InputTag(mod["selPATJets"]), name=cms.string(mod["selPATJets"]), cut=cms.string(""), @@ -1379,13 +1386,14 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, ) )) - for varName, varDef in jetVariables.iteritems(): setattr( getattr( proc, 'jetToolboxJetTable' ).variables, varName.replace(":","_"), varDef ) + for varName, varDef in jetVariables.iteritems(): setattr( getattr( proc, mod['jetToolboxJetTable'] ).variables, varName.replace(":","_"), varDef ) if addPrunedSubjets or addSoftDropSubjets: - setattr( getattr( proc, 'jetToolboxJetTable' ).variables, 'subJetIdx1', Var("?nSubjetCollections()>0 && subjets().size()>0?subjets()[0].key():-1", int, doc="index of first subjet") ), - setattr( getattr( proc, 'jetToolboxJetTable' ).variables, 'subJetIdx2', Var("?nSubjetCollections()>0 && subjets().size()>1?subjets()[1].key():-1", int, doc="index of second subjet") ), + setattr( getattr( proc, mod['jetToolboxJetTable'] ).variables, 'subJetIdx1', Var("?nSubjetCollections()>0 && subjets().size()>0?subjets()[0].key():-1", int, doc="index of first subjet") ), + setattr( getattr( proc, mod['jetToolboxJetTable'] ).variables, 'subJetIdx2', Var("?nSubjetCollections()>0 && subjets().size()>1?subjets()[1].key():-1", int, doc="index of second subjet") ), - _addProcessAndTask( proc, 'jetToolboxSubjetTable', cms.EDProducer("SimpleCandidateFlatTableProducer", + mod["jetToolboxSubjetTable"] = mod["selPATJets"+('Pruned' if addPrunedSubjets else 'SoftDrop')+"Packed"]+'SubJetsJTBTable' + _addProcessAndTask( proc, mod['jetToolboxSubjetTable'], cms.EDProducer("SimpleCandidateFlatTableProducer", src=cms.InputTag(mod["selPATJets"+('Pruned' if addPrunedSubjets else 'SoftDrop')+"Packed"]+':SubJets'), name=cms.string(mod["selPATJets"]+('Pruned' if addPrunedSubjets else 'SoftDrop')+'_Subjets'), cut=cms.string(""), @@ -1399,7 +1407,9 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, nCHadrons=Var("jetFlavourInfo().getcHadrons().size()", int, doc="number of c-hadrons"), ) )) - for varName, varDef in subjetVariables.iteritems(): setattr( getattr( proc, 'jetToolboxSubjetTable' ).variables, varName.replace(":","_"), varDef ) + for varName, varDef in subjetVariables.iteritems(): setattr( getattr( proc, mod['jetToolboxSubjetTable']).variables, varName.replace(":","_"), varDef ) + jetSeq += getattr(proc, mod['jetToolboxSubjetTable']) + jetSeq += getattr(proc, mod['jetToolboxJetTable']) ################################################################################# diff --git a/python/nanoAOD_jetToolbox_cff.py b/python/nanoAOD_jetToolbox_cff.py index 7a4078a55fa..4266e952c90 100644 --- a/python/nanoAOD_jetToolbox_cff.py +++ b/python/nanoAOD_jetToolbox_cff.py @@ -4,39 +4,69 @@ from Configuration.Eras.Modifier_run2_nanoAOD_94X2016_cff import run2_nanoAOD_94X2016 from Configuration.Eras.Modifier_run2_nanoAOD_94XMiniAODv2_cff import run2_nanoAOD_94XMiniAODv2 from Configuration.Eras.Modifier_run2_nanoAOD_102Xv1_cff import run2_nanoAOD_102Xv1 +from JMEAnalysis.JetToolbox.jetToolbox_cff import jetToolbox # --------------------------------------------------------- # This is the part the user should modify def setupCustomizedJetToolbox(process): - # recluster Puppi jets, add N-Subjettiness and ECF - bTagDiscriminators = [ - #'pfCombinedInclusiveSecondaryVertexV2BJetTags', - #'pfBoostedDoubleSecondaryVertexAK8BJetTags', - 'pfMassIndependentDeepDoubleBvLJetTags:probQCD', - 'pfMassIndependentDeepDoubleBvLJetTags:probHbb', - #'pfDeepCSVJetTags:probb', - #'pfDeepCSVJetTags:probbb', - ] - subjetBTagDiscriminators = [ - 'pfCombinedInclusiveSecondaryVertexV2BJetTags', - 'pfDeepCSVJetTags:probb', - 'pfDeepCSVJetTags:probbb', + #### AK4 PUPPI jets + + ak4btagdiscriminators = [ + 'pfDeepCSVJetTags:probb', + 'pfDeepCSVJetTags:probbb', + 'pfDeepCSVJetTags:probc', + 'pfDeepCSVJetTags:probudsg', +# 'pfDeepFlavourJetTags:probb', +# 'pfDeepFlavourJetTags:probbb', +# 'pfDeepFlavourJetTags:problepb', +# 'pfDeepFlavourJetTags:probc', +# 'pfDeepFlavourJetTags:probuds', +# 'pfDeepFlavourJetTags:probg', ] - JETCorrLevels = ['L2Relative', 'L3Absolute', 'L2L3Residual'] + ak4btaginfos = [ 'pfDeepCSVTagInfos' ] #'pfDeepFlavourTagInfos' - from JMEAnalysis.JetToolbox.jetToolbox_cff import jetToolbox - jetToolbox(process, 'ak8', 'dummyseq', 'noOutput', + jetToolbox(process, 'ak4', 'dummyseq', 'noOutput', dataTier='nanoAOD', - PUMethod='Puppi', JETCorrPayload='AK4PFPuppi', JETCorrLevels=JETCorrLevels, + PUMethod='Puppi', JETCorrPayload='AK4PFPuppi', #addQGTagger=True, - Cut='pt > 170.0 && abs(rapidity()) < 2.4', runOnMC=True, - addNsub=True, maxTau=3, addEnergyCorrFunc=True, - addSoftDrop=True, addSoftDropSubjets=True, subJETCorrPayload='AK4PFPuppi', subJETCorrLevels=JETCorrLevels, - #bTagDiscriminators=bTagDiscriminators, - #subjetBTagDiscriminators=subjetBTagDiscriminators + Cut='pt > 15.0 && abs(eta) < 2.4', + bTagDiscriminators=ak4btagdiscriminators, + bTagInfos=ak4btaginfos, + verbosity=4 + ) + + #### AK8 PUPPI jets + ak8btagdiscriminators = [ + 'pfBoostedDoubleSecondaryVertexAK8BJetTags', + 'pfMassIndependentDeepDoubleBvLJetTags:probQCD', + 'pfMassIndependentDeepDoubleBvLJetTags:probHbb', + 'pfMassIndependentDeepDoubleCvLJetTags:probQCD', + 'pfMassIndependentDeepDoubleCvLJetTags:probHcc', + 'pfMassIndependentDeepDoubleCvBJetTags:probHbb', + 'pfMassIndependentDeepDoubleCvBJetTags:probHcc', +# "pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:bbvsLight", +# "pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:ccvsLight", +# "pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:TvsQCD", +# "pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:ZHccvsQCD", +# "pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:WvsQCD", +# "pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:ZHbbvsQCD" + ] + + jetToolbox(process, 'ak8', 'adummyseq', 'noOutput', + dataTier='nanoAOD', + PUMethod='Puppi', JETCorrPayload='AK8PFPuppi', + runOnMC=True, + Cut='pt > 170.0 && abs(eta) < 2.4', + bTagDiscriminators=ak8btagdiscriminators, + addSoftDrop=True, + addSoftDropSubjets=True, + addPruning=True, + addNsub=True, + addEnergyCorrFunc=True, ) + return process # --------------------------------------------------------- From d136512c59f4af08dcad5d681dc18f345145897b Mon Sep 17 00:00:00 2001 From: Alejandro Gomez Espinosa Date: Wed, 3 Jul 2019 15:14:10 +0200 Subject: [PATCH 6/9] --amend --- python/jetToolbox_cff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/jetToolbox_cff.py b/python/jetToolbox_cff.py index 8542a1571ec..c6004061d78 100644 --- a/python/jetToolbox_cff.py +++ b/python/jetToolbox_cff.py @@ -1315,7 +1315,7 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, #_addProcessAndTask( proc, mod["selPATJets"], selectedPatJets.clone( src = mod["PATJets"], cut = Cut ) ) _addProcessAndTask( proc, mod["selPATJets"], cms.EDFilter("PATJetRefSelector", src = cms.InputTag(mod["PATJetswithUserData"]), cut = cms.string( Cut ) ) ) - elemToKeep += [ 'keep *_'+mod["selPATJets"]+'_*_*' + elemToKeep += [ 'keep *_'+mod["selPATJets"]+'_*_*' ] elemToKeep += [ 'drop *_'+mod["selPATJets"]+'_calo*_*' ] elemToKeep += [ 'drop *_'+mod["selPATJets"]+'_tagInfos_*' ] From f8a6c82e5dc9a27825dc7a43056cd31bb5c40b77 Mon Sep 17 00:00:00 2001 From: Alejandro Gomez Espinosa Date: Mon, 8 Jul 2019 14:40:23 +0200 Subject: [PATCH 7/9] fixing CHS in AOD --- python/jetToolbox_cff.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/jetToolbox_cff.py b/python/jetToolbox_cff.py index c6004061d78..10f34ed7461 100644 --- a/python/jetToolbox_cff.py +++ b/python/jetToolbox_cff.py @@ -325,7 +325,8 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, _addProcessAndTask( proc, 'newParticleFlowTmpPtrs', particleFlowTmpPtrs.clone( src = pfCand ) ) jetSeq += getattr(proc, 'newParticleFlowTmpPtrs') from CommonTools.ParticleFlow.pfNoPileUpJME_cff import pfPileUpJME, pfNoPileUpJME - proc.load('CommonTools.ParticleFlow.goodOfflinePrimaryVertices_cfi') + from CommonTools.ParticleFlow.goodOfflinePrimaryVertices_cfi import goodOfflinePrimaryVertices + _addProcessAndTask( proc, 'goodOfflinePrimaryVertices', goodOfflinePrimaryVertices.clone( ) ) _addProcessAndTask( proc, 'newPfPileUpJME', pfPileUpJME.clone( PFCandidates= 'newParticleFlowTmpPtrs' ) ) jetSeq += getattr(proc, 'newPfPileUpJME') _addProcessAndTask( proc, 'newPfNoPileUpJME', pfNoPileUpJME.clone( topCollection='newPfPileUpJME', bottomCollection= 'newParticleFlowTmpPtrs' ) ) From 2c3542b8c06a5fadb5964a586ae43829d6c13f6c Mon Sep 17 00:00:00 2001 From: Alejandro Date: Tue, 16 Jul 2019 18:37:53 +0200 Subject: [PATCH 8/9] adding missing variables to nanoAOD --- plugins/JetTester.cc | 8 +- python/jetToolbox_cff.py | 7 +- test/ClusterWithToolboxAndMakeHistos.py | 188 ++++++++++++++++++------ 3 files changed, 153 insertions(+), 50 deletions(-) diff --git a/plugins/JetTester.cc b/plugins/JetTester.cc index c9433cbe6f9..f0f45c9f7be 100644 --- a/plugins/JetTester.cc +++ b/plugins/JetTester.cc @@ -1324,16 +1324,16 @@ JetTester::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) //-------------------------------------------------------------------------------------------- // CA R=1.2 jets - from toolbox - edm::Handle CA12CHS; + /*edm::Handle CA12CHS; iEvent.getByToken(ca12PFCHSjetToken_, CA12CHS); for (const pat::Jet &ijet : *CA12CHS) { //cout << ijet.tagInfoLabels() << endl; cout << ijet.tagInfo("hepTopTagPFJetsCHS") << endl; - /*for ( auto st : ijet.tagInfoLabels() ) { + //for ( auto st : ijet.tagInfoLabels() ) { cout << st << endl; //ijet.tagInfo("CATop") << endl; - }*/ - } + }// + }*/ diff --git a/python/jetToolbox_cff.py b/python/jetToolbox_cff.py index 10f34ed7461..e8bd330756c 100644 --- a/python/jetToolbox_cff.py +++ b/python/jetToolbox_cff.py @@ -1314,8 +1314,8 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, ###### Saving jet collections if hasattr(proc, 'patJetPartons'): proc.patJetPartons.particles = genParticlesLabel - #_addProcessAndTask( proc, mod["selPATJets"], selectedPatJets.clone( src = mod["PATJets"], cut = Cut ) ) - _addProcessAndTask( proc, mod["selPATJets"], cms.EDFilter("PATJetRefSelector", src = cms.InputTag(mod["PATJetswithUserData"]), cut = cms.string( Cut ) ) ) + if dataTier.startswith("nanoAOD"): _addProcessAndTask( proc, mod["selPATJets"], cms.EDFilter("PATJetRefSelector", src = cms.InputTag(mod["PATJetswithUserData"]), cut = cms.string( Cut ) ) ) + else: _addProcessAndTask( proc, mod["selPATJets"], selectedPatJets.clone( src = mod["PATJets"], cut = Cut ) ) elemToKeep += [ 'keep *_'+mod["selPATJets"]+'_*_*' ] elemToKeep += [ 'drop *_'+mod["selPATJets"]+'_calo*_*' ] elemToKeep += [ 'drop *_'+mod["selPATJets"]+'_tagInfos_*' ] @@ -1388,6 +1388,9 @@ def jetToolbox( proc, jetType, jetSequence, outputFile, )) for varName, varDef in jetVariables.iteritems(): setattr( getattr( proc, mod['jetToolboxJetTable'] ).variables, varName.replace(":","_"), varDef ) + if runOnMC: + setattr( getattr( proc, mod['jetToolboxJetTable'] ).variables, 'partonFlavor', Var('partonFlavour()', int, doc="flavour from parton matching" ) ) + setattr( getattr( proc, mod['jetToolboxJetTable'] ).variables, 'hadronFlavor', Var('hadronFlavour()', int, doc="flavour from hadron matching" ) ) if addPrunedSubjets or addSoftDropSubjets: setattr( getattr( proc, mod['jetToolboxJetTable'] ).variables, 'subJetIdx1', Var("?nSubjetCollections()>0 && subjets().size()>0?subjets()[0].key():-1", int, doc="index of first subjet") ), diff --git a/test/ClusterWithToolboxAndMakeHistos.py b/test/ClusterWithToolboxAndMakeHistos.py index c9d2da1fabd..d54f95ab3af 100644 --- a/test/ClusterWithToolboxAndMakeHistos.py +++ b/test/ClusterWithToolboxAndMakeHistos.py @@ -23,7 +23,7 @@ process.MessageLogger.cerr.FwkReport.reportEvery = 100 ### INPUT -process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(100) ) +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring( @@ -31,104 +31,204 @@ ) ) - from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValTTbarPileUpMINIAODSIM process.source.fileNames = filesRelValTTbarPileUpMINIAODSIM +btagDiscAK4 = [ + 'pfCombinedInclusiveSecondaryVertexV2BJetTags', + 'pfCombinedCvsLJetTags', + 'pfCombinedCvsBJetTags', + 'pfDeepCSVJetTags:probb', + 'pfDeepCSVJetTags:probbb', + 'pfDeepCSVJetTags:probc', + 'pfDeepCSVJetTags:probudsg', + 'pfDeepFlavourJetTags:probb', + 'pfDeepFlavourJetTags:probbb', + 'pfDeepFlavourJetTags:problepb', + 'pfDeepFlavourJetTags:probc', + 'pfDeepFlavourJetTags:probuds', + 'pfDeepFlavourJetTags:probg', + ] + +btagDiscAK8 = [ + 'pfBoostedDoubleSecondaryVertexAK8BJetTags', + #'pfMassIndependentDeepDoubleBvLJetTags:probQCD', + #'pfMassIndependentDeepDoubleBvLJetTags:probHbb', + #'pfMassIndependentDeepDoubleCvLJetTags:probQCD', + #'pfMassIndependentDeepDoubleCvLJetTags:probHcc', + #'pfMassIndependentDeepDoubleCvBJetTags:probHbb', + #'pfMassIndependentDeepDoubleCvBJetTags:probHcc', + "pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:bbvsLight", + "pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:ccvsLight", + "pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:TvsQCD", + "pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:ZHccvsQCD", + "pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:WvsQCD", + "pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:ZHbbvsQCD" + ] + ### ADD SOME NEW JET COLLECTIONS from JMEAnalysis.JetToolbox.jetToolbox_cff import * -# AK R=0.4 jets from CHS inputs with basic grooming, W tagging, and top tagging +# updating slimmedJets (ak4 CHS jets) from miniAOD +jetToolbox( process, 'ak4', 'ak4UpdJetSubs', 'noOutput', + dataTier="miniAOD", + updateCollection='slimmedJets', + JETCorrPayload='AK4PFchs', + postFix='Updated', + bTagDiscriminators=btagDiscAK4 + ) + +# AK R=0.4 jets from CHS inputs jetToolbox( process, 'ak4', 'ak4JetSubs', 'noOutput', + dataTier="miniAOD", PUMethod='CHS', - addPruning=True, addSoftDrop=True , # add basic grooming - addTrimming=True, addFiltering=True, - addSoftDropSubjets=True, - addNsub=True, maxTau=4, # add Nsubjettiness tau1, tau2, tau3, tau4 - JETCorrPayload = 'AK4PFchs', JETCorrLevels = ['L2Relative', 'L3Absolute'] +# JETCorrPayload = 'AK4PFchs', JETCorrLevels = ['L2Relative', 'L3Absolute'] + addPUJetID=True, + addQGTagger=True, + Cut='pt>30 && abs(eta)<2.5' ) -# AK R=0.8 jets from PF inputs with basic grooming, W tagging, and top tagging -#jetToolbox( process, 'ak8', 'ak8JetSubs', 'noOutput', -# PUMethod='Plain', -# addPruning=True, addSoftDrop=True , # add basic grooming -# addTrimming=True, addFiltering=True, -# addSoftDropSubjets=True, -# addNsub=True, maxTau=4, # add Nsubjettiness tau1, tau2, tau3, tau4 -# JETCorrPayload = 'AK8PF', JETCorrLevels = ['L2Relative', 'L3Absolute'] -#) +# AK R=0.4 jets from Puppi inputs +jetToolbox( process, 'ak4', 'ak4JetSubs', 'noOutput', + dataTier="miniAOD", + PUMethod='Puppi', +# JETCorrPayload = 'AK4PFchs', JETCorrLevels = ['L2Relative', 'L3Absolute'] + Cut='pt>30 && abs(eta)<2.5' +) -# AK R=0.8 jets from CHS inputs with basic grooming, W tagging, and top tagging +# AK R=0.4 jets from PF inputs +jetToolbox( process, 'ak4', 'ak4JetSubs', 'noOutput', + dataTier="miniAOD", + PUMethod='Plain', +# JETCorrPayload = 'AK4PFchs', JETCorrLevels = ['L2Relative', 'L3Absolute'] + Cut='pt>30 && abs(eta)<2.5' +) + + + +# updating slimmedAK8Jets (ak8 puppi jets) from miniAOD +jetToolbox( process, 'ak8', 'ak8UpdJetSubs', 'noOutput', + dataTier="miniAOD", + PUMethod='Puppi', + updateCollection='slimmedJetsAK8', + JETCorrPayload='AK8PFPuppi', + postFix='Updated', + bTagDiscriminators=btagDiscAK8 + ) + +# AK R=0.8 jets from CHS jetToolbox( process, 'ak8', 'ak8JetSubs', 'noOutput', + dataTier="miniAOD", + Cut="pt>170 && abs(eta)<2.5", PUMethod='CHS', addPruning=True, addSoftDrop=True , # add basic grooming addTrimming=True, addFiltering=True, addSoftDropSubjets=True, addNsub=True, maxTau=4, # add Nsubjettiness tau1, tau2, tau3, tau4 - JETCorrPayload = 'AK8PFchs', JETCorrLevels = ['L2Relative', 'L3Absolute'] + JETCorrPayload = 'AK8PFchs', JETCorrLevels = ['L2Relative', 'L3Absolute'], ) -# AK R=0.8 from PUPPI inputs with basic grooming, W tagging, and top tagging +# AK R=0.8 from PUPPI jetToolbox( process, 'ak8', 'ak8JetSubs', 'noOutput', + dataTier="miniAOD", PUMethod='Puppi', + Cut="pt>170 && abs(eta)<2.5", addPruning=True, addSoftDrop=True , # add basic grooming addTrimming=True, addFiltering=True, addSoftDropSubjets=True, addNsub=True, maxTau=4, # add Nsubjettiness tau1, tau2, tau3, tau4 - JETCorrPayload = 'AK8PFPuppi', JETCorrLevels = ['L2Relative', 'L3Absolute'] + addEnergyCorrFunc=True, + #JETCorrPayload = 'AK8PFPuppi', JETCorrLevels = ['L2Relative', 'L3Absolute'] ) -# CA R=0.8 jets from CHS inputs with basic grooming, W tagging, and top tagging +# CA R=0.8 jets from CHS jetToolbox( process, 'ca8', 'ca8JetSubs', 'noOutput', + Cut="pt>170 && abs(eta)<2.5", + dataTier="miniAOD", PUMethod='CHS', addPruning=True, addSoftDrop=True , # add basic grooming - addTrimming=True, addFiltering=True, - addSoftDropSubjets=True, - addNsub=True, maxTau=4, # add Nsubjettiness tau1, tau2, tau3, tau4 JETCorrPayload = 'AK8PFchs', JETCorrLevels = ['L2Relative', 'L3Absolute'] ) -# KT R=0.8 jets from CHS inputs with basic grooming, W tagging, and top tagging +# KT R=0.8 jets from CHS jetToolbox( process, 'kt8', 'kt8JetSubs', 'noOutput', + Cut="pt>170 && abs(eta)<2.5", + dataTier="miniAOD", PUMethod='CHS', addPruning=True, addSoftDrop=True , # add basic grooming - addTrimming=True, addFiltering=True, - addSoftDropSubjets=True, - addNsub=True, maxTau=4, # add Nsubjettiness tau1, tau2, tau3, tau4 JETCorrPayload = 'AK8PFchs', JETCorrLevels = ['L2Relative', 'L3Absolute'] ) -# AK R=1.2 jets from CHS inputs with basic grooming, W tagging, and top tagging -jetToolbox( process, 'ak12', 'ak12JetSubs', 'noOutput', +# KT R=0.8 jets from CHS +jetToolbox( process, 'kt8', 'kt8JetSubs', 'noOutput', + dataTier="miniAOD", + Cut="pt>170 && abs(eta)<2.5", PUMethod='CHS', addPruning=True, addSoftDrop=True , # add basic grooming - addTrimming=True, addFiltering=True, - addSoftDropSubjets=True, - addNsub=True, maxTau=4, # add Nsubjettiness tau1, tau2, tau3, tau4 JETCorrPayload = 'AK8PFchs', JETCorrLevels = ['L2Relative', 'L3Absolute'] ) -# AK R=1.5 jets from CHS inputs with basic grooming, W tagging, and top tagging -jetToolbox( process, 'ak15', 'ak15JetSubs', 'noOutput', - PUMethod='CHS', +# AK R=0.8 jets from Puppi, modified Softdrop +jetToolbox( process, 'ak8', 'ak8JetSubs', 'noOutput', + dataTier="miniAOD", + Cut="pt>170 && abs(eta)<2.5", + PUMethod='Puppi', + postFix='modSD', + addSoftDrop=True , betaCut=1, # add basic grooming + JETCorrPayload = 'AK8PFchs', JETCorrLevels = ['L2Relative', 'L3Absolute'] +) + +# AK R=0.8 jets from SK +jetToolbox( process, 'ak8', 'ak8JetSubs', 'noOutput', + dataTier="miniAOD", + Cut="pt>170 && abs(eta)<2.5", + PUMethod='SK', addPruning=True, addSoftDrop=True , # add basic grooming - addTrimming=True, addFiltering=True, - addSoftDropSubjets=True, - addNsub=True, maxTau=4, # add Nsubjettiness tau1, tau2, tau3, tau4 JETCorrPayload = 'AK8PFchs', JETCorrLevels = ['L2Relative', 'L3Absolute'] ) +## AK R=0.8 jets from CS +#jetToolbox( process, 'ak8', 'ak8JetSubs', 'noOutput', +# PUMethod='CS', +# addPruning=True, addSoftDrop=True , # add basic grooming +# JETCorrPayload = 'AK8PFchs', JETCorrLevels = ['L2Relative', 'L3Absolute'] +#) + +# CA R=1.2 jets from CHS inputs with basic grooming, W tagging, and top tagging +#jetToolbox( process, 'ca12', 'ca12JetSubs', 'noOutput', +# PUMethod='CHS', +# addHEPTopTagger=True, +#) + + +## AK R=1.2 jets from CHS inputs with basic grooming, W tagging, and top tagging +#jetToolbox( process, 'ak12', 'ak12JetSubs', 'noOutput', +# PUMethod='CHS', +# addPruning=True, addSoftDrop=True , # add basic grooming +# addTrimming=True, addFiltering=True, +# addSoftDropSubjets=True, +# addNsub=True, maxTau=4, # add Nsubjettiness tau1, tau2, tau3, tau4 +# JETCorrPayload = 'AK8PFchs', JETCorrLevels = ['L2Relative', 'L3Absolute'] +#) +# +## AK R=1.5 jets from CHS inputs with basic grooming, W tagging, and top tagging +#jetToolbox( process, 'ak15', 'ak15JetSubs', 'noOutput', +# PUMethod='CHS', +# addPruning=True, addSoftDrop=True , # add basic grooming +# addTrimming=True, addFiltering=True, +# addSoftDropSubjets=True, +# addNsub=True, maxTau=4, # add Nsubjettiness tau1, tau2, tau3, tau4 +# JETCorrPayload = 'AK8PFchs', JETCorrLevels = ['L2Relative', 'L3Absolute'] +#) + ### MAKE SOME HISTOGRAMS process.ana = cms.EDAnalyzer('JetTester' ) ### OUT process.TFileService = cms.Service("TFileService", - fileName = cms.string("JetClusterHistos_ZP3.root"), + fileName = cms.string("jetToolbox_longTest.root"), closeFileFast = cms.untracked.bool(True) ) -# Uncomment the following line if you would like to output the jet collections in a root file -# process.endpath = cms.EndPath(process.out) - process.p = cms.Path(process.ana) From 84d61e1e5953250b77baf3a4b57d16b0b4e29a42 Mon Sep 17 00:00:00 2001 From: Alejandro Gomez Espinosa Date: Wed, 17 Jul 2019 14:58:11 +0200 Subject: [PATCH 9/9] updating tests --- test/ClusterWithToolboxAndMakeHistos.py | 10 +- test/jetToolbox_nanoAODv5_cfg.py | 3 +- test/jettoolbox_cfg.py | 137 +++++++++--------------- 3 files changed, 57 insertions(+), 93 deletions(-) diff --git a/test/ClusterWithToolboxAndMakeHistos.py b/test/ClusterWithToolboxAndMakeHistos.py index d54f95ab3af..3b9d849d272 100644 --- a/test/ClusterWithToolboxAndMakeHistos.py +++ b/test/ClusterWithToolboxAndMakeHistos.py @@ -20,19 +20,17 @@ process.GlobalTag.globaltag = '94X_mc2017_realistic_v12' process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) ) process.options.allowUnscheduled = cms.untracked.bool(True) -process.MessageLogger.cerr.FwkReport.reportEvery = 100 +process.MessageLogger.cerr.FwkReport.reportEvery = 1000 ### INPUT process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring( -'/store/mc/RunIISummer17MiniAOD/ZprimeToTT_M-3000_W-300_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/MINIAODSIM/NZSFlatPU28to62_92X_upgrade2017_realistic_v10-v1/150000/E45A17E6-AAAC-E711-A423-00266CFFC80C.root' - ) + fileNames = cms.untracked.vstring('/store/mc/RunIIAutumn18MiniAOD/TTJets_TuneCP5_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/102X_upgrade2018_realistic_v15_ext1-v2/20000/7E65457A-87E5-C146-8321-9A48B4F56ED1.root'), ) -from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValTTbarPileUpMINIAODSIM -process.source.fileNames = filesRelValTTbarPileUpMINIAODSIM +#from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValTTbarPileUpMINIAODSIM +#process.source.fileNames = filesRelValTTbarPileUpMINIAODSIM btagDiscAK4 = [ 'pfCombinedInclusiveSecondaryVertexV2BJetTags', diff --git a/test/jetToolbox_nanoAODv5_cfg.py b/test/jetToolbox_nanoAODv5_cfg.py index 97ca9027dc7..660b01866ed 100644 --- a/test/jetToolbox_nanoAODv5_cfg.py +++ b/test/jetToolbox_nanoAODv5_cfg.py @@ -22,7 +22,7 @@ process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(1000) + input = cms.untracked.int32(-1) ) # Input source @@ -32,6 +32,7 @@ ) #from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValTTbarPileUpMINIAODSIM #process.source.fileNames = filesRelValTTbarPileUpMINIAODSIM +process.MessageLogger.cerr.FwkReport.reportEvery = 1000 process.options = cms.untracked.PSet( diff --git a/test/jettoolbox_cfg.py b/test/jettoolbox_cfg.py index 21e4675589f..2db6a86f040 100644 --- a/test/jettoolbox_cfg.py +++ b/test/jettoolbox_cfg.py @@ -25,68 +25,8 @@ from JMEAnalysis.JetToolbox.jetToolbox_cff import jetToolbox -''' -jetToolbox( process, 'ak8', 'jetSequence', 'out', PUMethod='CHS', miniAOD=True, - #Cut='pt > 200 && abs(eta) < 2.5', # Tight - runOnMC=False, - addPruning = True, addSoftDrop = True, - addNsub = True, - #addPrunedSubjets=True, addSoftDropSubjets=True, - #addNsubSubjets =True - ) +jetToolbox( process, 'ak8', 'jetSequence', 'out', PUMethod='CHS', addPruning=False, dataTier="AOD", runOnMC=False) ### For example -#jetToolbox( process, 'ak4', 'jetSequence', 'out', PUMethod='Puppi', miniAOD=True, runOnMC=True ) -#process.load('CommonTools.PileupAlgos.Puppi_cff') -#process.PuppiOnTheFly = process.puppi.clone( candName = cms.InputTag( 'packedPFCandidates' ), vertexName = cms.InputTag( 'offlineSlimmedPrimaryVertices' ), clonePackedCands = cms.bool(True) ) -#process.PuppiOnTheFly.useExistingWeights = True -#jetToolbox(process, 'ak4', 'dummy', 'out', PUMethod = 'Puppi', JETCorrPayload = 'AK4PFchs', JETCorrLevels = ['L2Relative', 'L3Absolute'], miniAOD = True, newPFCollection=True, nameNewPFCollection='puppi') - -#jetToolbox( process, 'ak8', 'ak8JetSubs', 'out', PUMethod='Puppi', addPruning=True, addSoftDrop=True , addPrunedSubjets=True, addSoftDropSubjets=True, addNsub=True, maxTau=6, addTrimming=True, addFiltering=True , JETCorrPayload='AK8PFchs', subJETCorrPayload='AK4PFchs', subJETCorrLevels=['L2Relative', 'L3Absoulte'] ) #, Cut='pt > 100 && abs(eta) < 2.4' ) -#jetToolbox( process, 'ak8', 'ak8JetSubs', 'out', PUMethod='Puppi', addPruning=True, addSoftDrop=True , addPrunedSubjets=True, addSoftDropSubjets=True, addNsub=True, maxTau=6, addTrimming=True, addFiltering=True, JETCorrLevels=['L1FastJet', 'L2Relative'], newPFCollection=True, nameNewPFCollection='PuppiOnTheFly' ) -#jetToolbox( process, 'ak8', 'ak8JetSubs', 'out', PUMethod='SK', addPruning=True, addSoftDrop=True , addPrunedSubjets=True, addSoftDropSubjets=True, addNsub=True, maxTau=6, addTrimming=True, addFiltering=True, JETCorrLevels=['L1FastJet', 'L2Relative'] ) -#jetToolbox( process, 'ak8', 'ak8JetSubs', 'out', PUMethod='CS', addPruning=True, addSoftDrop=True , addPrunedSubjets=True, addSoftDropSubjets=True, addNsub=True, maxTau=6, addTrimming=True, addFiltering=True ) -#jetToolbox( process, 'ak8', 'ak8JetSubs', 'out', PUMethod='CHS', addPruning=True, addSoftDrop=True , addPrunedSubjets=True, addSoftDropSubjets=True, addNsub=True, maxTau=6, addTrimming=True, addFiltering=True, addNsubSubjets=True ) -#jetToolbox( process, 'ak8', 'ak8JetSubs', 'out', PUMethod='CHS', addPruning=True, addSoftDrop=True , addSoftDropSubjets=True, addNsub=True, maxTau=6, addTrimming=True, addFiltering=True, addNsubSubjets=True ) -jetToolbox( process, 'ak8', 'ak8JetSubs', 'out', - PUMethod='CHS', - #updateCollection='slimmedJetsAK8', - JETCorrPayload='AK8PFchs', - #addEnergyCorrFunc=True, - #updateCollectionSubjets='slimmedJetsAK8PFCHSSoftDropPacked:SubJets', - #subJETCorrPayload='AK4PFchs', - bTagDiscriminators=listBtagDiscriminatorsAK4, - #addNsubSubjets=True, - #addPrunedSubjets=True, - postFix= 'CollectionTests', - #addTrimming=True, - #addPruning=True - ) #, addPrunedSubjets=True, subJETCorrPayload='AK4PFchs' ) -listBtagDiscriminatorsAK4 = [ - #'pfJetProbabilityBJetTags', - #'pfCombinedInclusiveSecondaryVertexV2BJetTags', - 'pfCombinedMVAV2BJetTags', - #'pfCombinedCvsLJetTags', - #'pfCombinedCvsBJetTags', - ] -jetToolbox( process, 'ak8', 'ak8JetSubs', 'out', - PUMethod='Puppi', - #updateCollection='slimmedJetsAK8', - JETCorrPayload='AK8PFPuppi', - #addEnergyCorrFunc=True, - #updateCollectionSubjets='slimmedJetsAK8PFCHSSoftDropPacked:SubJets', - subJETCorrPayload='AK4PFPuppi', - bTagDiscriminators=listBtagDiscriminatorsAK4, - addNsub = True, - #addNsubSubjets=True, - #addPrunedSubjets=True, - #postFix= 'NEWCOLLECTIONOFJETS', - #addTrimming=True, - #addFiltering=True, - #addPruning=True, - addSoftDrop=True - ) #, addPrunedSubjets=True, subJETCorrPayload='AK4PFchs' ) -''' -#from JMEAnalysis.JetToolbox.jetToolbox_cff import jetToolbox #listBTagInfos = ['pfInclusiveSecondaryVertexFinderTagInfos','pfImpactParameterTagInfos'] #listBtagDiscriminatorsAK8 = [ # 'pfBoostedDoubleSecondaryVertexAK8BJetTags', @@ -165,36 +105,61 @@ # ) # -jetToolbox( process, 'ak15', 'ak15JetSubs', 'noOutput', - PUMethod='Puppi', - addPruning=True, addSoftDrop=True , # add basic grooming - addTrimming=True, addFiltering=True, - addSoftDropSubjets=True, - addPrunedSubjets=True, - addNsub=True, maxTau=4, # add Nsubjettiness tau1, tau2, tau3, tau4 - JETCorrPayload = 'AK8PFPuppi', #JETCorrLevels = ['L2Relative', 'L3Absolute'], - runOnMC=False, - miniAOD=True, - Cut='pt > 100 && abs(eta) < 2.5', - GetJetMCFlavour=False, - #GetSubJetMCFlavour=True, - addHEPTopTagger=True - ) - - -process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(10) ) +#jetToolbox( process, 'ak15', 'ak15JetSubs', 'noOutput', +# PUMethod='Puppi', +# addPruning=True, addSoftDrop=True , # add basic grooming +# addTrimming=True, addFiltering=True, +# addSoftDropSubjets=True, +# addPrunedSubjets=True, +# addNsub=True, maxTau=4, # add Nsubjettiness tau1, tau2, tau3, tau4 +# JETCorrPayload = 'AK8PFPuppi', #JETCorrLevels = ['L2Relative', 'L3Absolute'], +# runOnMC=False, +# miniAOD=True, +# Cut='pt > 100 && abs(eta) < 2.5', +# GetJetMCFlavour=False, +# #GetSubJetMCFlavour=True, +# addHEPTopTagger=True +# ) + +#bTagDiscriminators = [ +# #'pfCombinedInclusiveSecondaryVertexV2BJetTags', +# #'pfBoostedDoubleSecondaryVertexAK8BJetTags', +# 'pfMassIndependentDeepDoubleBvLJetTags:probQCD', +# 'pfMassIndependentDeepDoubleBvLJetTags:probHbb', +# #'pfDeepCSVJetTags:probb', +# #'pfDeepCSVJetTags:probbb', +#] +#subjetBTagDiscriminators = [ +# 'pfCombinedInclusiveSecondaryVertexV2BJetTags', +# 'pfDeepCSVJetTags:probb', +# 'pfDeepCSVJetTags:probbb', +#] +#JETCorrLevels = ['L2Relative', 'L3Absolute', 'L2L3Residual'] +# +#jetToolbox(process, 'ak8', 'dummyseq', 'out', +# dataTier='miniAOD', +# PUMethod='Puppi', JETCorrPayload='AK4PFPuppi', JETCorrLevels=JETCorrLevels, +# #addQGTagger=True, +# Cut='pt > 170.0 && abs(rapidity()) < 2.4', +# runOnMC=True, +# addNsub=True, maxTau=3, addEnergyCorrFunc=True, +# addSoftDrop=True, addSoftDropSubjets=True, subJETCorrPayload='AK4PFPuppi', subJETCorrLevels=JETCorrLevels, +# #bTagDiscriminators=bTagDiscriminators, +# #subjetBTagDiscriminators=subjetBTagDiscriminators +# ) + + +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1000) ) process.source = cms.Source("PoolSource", # fileNames = cms.untracked.vstring(#'file:example.root' - fileNames = cms.untracked.vstring( - '/store/data/Run2016G/JetHT/MINIAOD/PromptReco-v1/000/280/002/00000/E82E26C7-4375-E611-AE7F-FA163E48F736.root' - #'/store/mc/RunIIFall17MiniAOD/QCD_HT1000to1500_TuneCP5_13TeV-madgraph-pythia8/MINIAODSIM/94X_mc2017_realistic_v10-v1/00000/02961665-F9F9-E711-87B5-0026B93F49B0.root' - #'/store/mc/RunIIFall17MiniAODv2/Res1ToRes2GluTo3Glu_M1-2000_R-0p1_TuneCP5_13TeV-madgraph-pythia8/MINIAODSIM/PU2017_12Apr2018_94X_mc2017_realistic_v14-v2/00000/44F72487-F763-E811-9E6C-6C3BE5B5E4C0.root' - #'/store/relval/CMSSW_9_4_5_cand1/JetHT/MINIAOD/94X_dataRun2_relval_v11_RelVal_rmaod_jetHT2017B-v1/10000/18B5E95F-992E-E811-9422-0CC47A78A418.root' + fileNames = cms.untracked.vstring( + #'/store/mc/RunIIAutumn18MiniAOD/TTJets_TuneCP5_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/102X_upgrade2018_realistic_v15_ext1-v2/20000/7E65457A-87E5-C146-8321-9A48B4F56ED1.root' + '/store/data/Run2017C/DoubleMuon/AOD/17Nov2017-v1/50001/2005DA54-85D3-E711-BF10-02163E011E35.root' ), ) -from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValTTbarPileUpMINIAODSIM -process.source.fileNames = filesRelValTTbarPileUpMINIAODSIM +#from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValTTbarPileUpMINIAODSIM +#process.source.fileNames = filesRelValTTbarPileUpMINIAODSIM #from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValProdTTbarAODSIM #process.source.fileNames = filesRelValProdTTbarAODSIM