diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/Root/EventSaverFlatNtuple.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/Root/EventSaverFlatNtuple.cxx index 438a3524846a64d93e448191309bf4ce5756ffba..8b8e1751f10914a75d363afd6a30ef4b07f54406 100644 --- a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/Root/EventSaverFlatNtuple.cxx +++ b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/Root/EventSaverFlatNtuple.cxx @@ -815,6 +815,46 @@ namespace top { systematicTree->makeOutputVariable(m_VarRCjetsubBranches[VarRC+"_"+name+"_sub_phi"], VarRC+"sub_"+name+"_phi"); systematicTree->makeOutputVariable(m_VarRCjetsubBranches[VarRC+"_"+name+"_sub_e"], VarRC+"sub_"+name+"_e"); systematicTree->makeOutputVariable(m_VarRCjetsubBranches[VarRC+"_"+name+"_sub_mv2c10"], VarRC+"sub_"+name+"_mv2c10"); + + if (m_useRCJSS){ + systematicTree->makeOutputVariable(m_VarRCjetBranches["vrrcjet_"+name+"_pt"], "vrrcjet_"+name+"_pt" ); + systematicTree->makeOutputVariable(m_VarRCjetBranches["vrrcjet_"+name+"_eta"],"vrrcjet_"+name+"_eta"); + systematicTree->makeOutputVariable(m_VarRCjetBranches["vrrcjet_"+name+"_phi"],"vrrcjet_"+name+"_phi"); + systematicTree->makeOutputVariable(m_VarRCjetBranches["vrrcjet_"+name+"_e"], "vrrcjet_"+name+"_e" ); + + // RCJet SS from Clusters + systematicTree->makeOutputVariable(m_VarRCjetBranches[VarRC+"_"+name+"_tau32_clstr"], VarRC+"_"+name+"_tau32_clstr" ); + systematicTree->makeOutputVariable(m_VarRCjetBranches[VarRC+"_"+name+"_tau21_clstr"], VarRC+"_"+name+"_tau21_clstr" ); + systematicTree->makeOutputVariable(m_VarRCjetBranches[VarRC+"_"+name+"_tau3_clstr"], VarRC+"_"+name+"_tau3_clstr" ); + systematicTree->makeOutputVariable(m_VarRCjetBranches[VarRC+"_"+name+"_tau2_clstr"], VarRC+"_"+name+"_tau2_clstr" ); + systematicTree->makeOutputVariable(m_VarRCjetBranches[VarRC+"_"+name+"_tau1_clstr"], VarRC+"_"+name+"_tau1_clstr" ); + + systematicTree->makeOutputVariable(m_VarRCjetBranches[VarRC+"_"+name+"_D2_clstr"], VarRC+"_"+name+"_D2_clstr" ); + systematicTree->makeOutputVariable(m_VarRCjetBranches[VarRC+"_"+name+"_ECF1_clstr"], VarRC+"_"+name+"_ECF1_clstr" ); + systematicTree->makeOutputVariable(m_VarRCjetBranches[VarRC+"_"+name+"_ECF2_clstr"], VarRC+"_"+name+"_ECF2_clstr" ); + systematicTree->makeOutputVariable(m_VarRCjetBranches[VarRC+"_"+name+"_ECF3_clstr"], VarRC+"_"+name+"_ECF3_clstr" ); + + systematicTree->makeOutputVariable(m_VarRCjetBranches[VarRC+"_"+name+"_d12_clstr"], VarRC+"_"+name+"_d12_clstr" ); + systematicTree->makeOutputVariable(m_VarRCjetBranches[VarRC+"_"+name+"_d23_clstr"], VarRC+"_"+name+"_d23_clstr" ); + systematicTree->makeOutputVariable(m_VarRCjetBranches[VarRC+"_"+name+"_Qw_clstr"], VarRC+"_"+name+"_Qw_clstr" ); + + systematicTree->makeOutputVariable(m_VarRCjetBranches[VarRC+"_"+name+"_gECF332_clstr"],VarRC+"_"+name+"_gECF332_clstr"); + systematicTree->makeOutputVariable(m_VarRCjetBranches[VarRC+"_"+name+"_gECF461_clstr"],VarRC+"_"+name+"_gECF461_clstr"); + systematicTree->makeOutputVariable(m_VarRCjetBranches[VarRC+"_"+name+"_gECF322_clstr"],VarRC+"_"+name+"_gECF322_clstr"); + systematicTree->makeOutputVariable(m_VarRCjetBranches[VarRC+"_"+name+"_gECF331_clstr"],VarRC+"_"+name+"_gECF331_clstr"); + systematicTree->makeOutputVariable(m_VarRCjetBranches[VarRC+"_"+name+"_gECF422_clstr"],VarRC+"_"+name+"_gECF422_clstr"); + systematicTree->makeOutputVariable(m_VarRCjetBranches[VarRC+"_"+name+"_gECF441_clstr"],VarRC+"_"+name+"_gECF441_clstr"); + systematicTree->makeOutputVariable(m_VarRCjetBranches[VarRC+"_"+name+"_gECF212_clstr"],VarRC+"_"+name+"_gECF212_clstr"); + systematicTree->makeOutputVariable(m_VarRCjetBranches[VarRC+"_"+name+"_gECF321_clstr"],VarRC+"_"+name+"_gECF321_clstr"); + systematicTree->makeOutputVariable(m_VarRCjetBranches[VarRC+"_"+name+"_gECF311_clstr"],VarRC+"_"+name+"_gECF311_clstr"); + + systematicTree->makeOutputVariable(m_VarRCjetBranches[VarRC+"_"+name+"_L1_clstr"], VarRC+"_"+name+"_L1_clstr" ); + systematicTree->makeOutputVariable(m_VarRCjetBranches[VarRC+"_"+name+"_L2_clstr"], VarRC+"_"+name+"_L2_clstr" ); + systematicTree->makeOutputVariable(m_VarRCjetBranches[VarRC+"_"+name+"_L3_clstr"], VarRC+"_"+name+"_L3_clstr" ); + systematicTree->makeOutputVariable(m_VarRCjetBranches[VarRC+"_"+name+"_L4_clstr"], VarRC+"_"+name+"_L4_clstr" ); + systematicTree->makeOutputVariable(m_VarRCjetBranches[VarRC+"_"+name+"_L5_clstr"], VarRC+"_"+name+"_L5_clstr" ); + } + } // end loop over mass parameters } // end loop over multipliers for mass scale } // end if VarRC jets @@ -1218,6 +1258,46 @@ namespace top { m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetsubBranchesParticle[VarRC+"_"+name+"_sub_eta"], VarRC+"sub_"+name+"_eta"); m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetsubBranchesParticle[VarRC+"_"+name+"_sub_phi"], VarRC+"sub_"+name+"_phi"); m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetsubBranchesParticle[VarRC+"_"+name+"_sub_e"], VarRC+"sub_"+name+"_e"); + + if (m_useRCJSS){ + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle["vrrcjet_"+name+"_pt"], "vrrcjet_"+name+"_pt" ); + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle["vrrcjet_"+name+"_eta"],"vrrcjet_"+name+"_eta"); + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle["vrrcjet_"+name+"_phi"],"vrrcjet_"+name+"_phi"); + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle["vrrcjet_"+name+"_e"], "vrrcjet_"+name+"_e" ); + + // RCJet SS from Clusters + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle[VarRC+"_"+name+"_tau32_clstr"], VarRC+"_"+name+"_tau32_clstr" ); + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle[VarRC+"_"+name+"_tau21_clstr"], VarRC+"_"+name+"_tau21_clstr" ); + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle[VarRC+"_"+name+"_tau3_clstr"], VarRC+"_"+name+"_tau3_clstr" ); + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle[VarRC+"_"+name+"_tau2_clstr"], VarRC+"_"+name+"_tau2_clstr" ); + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle[VarRC+"_"+name+"_tau1_clstr"], VarRC+"_"+name+"_tau1_clstr" ); + + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle[VarRC+"_"+name+"_D2_clstr"], VarRC+"_"+name+"_D2_clstr" ); + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle[VarRC+"_"+name+"_ECF1_clstr"], VarRC+"_"+name+"_ECF1_clstr" ); + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle[VarRC+"_"+name+"_ECF2_clstr"], VarRC+"_"+name+"_ECF2_clstr" ); + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle[VarRC+"_"+name+"_ECF3_clstr"], VarRC+"_"+name+"_ECF3_clstr" ); + + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle[VarRC+"_"+name+"_d12_clstr"], VarRC+"_"+name+"_d12_clstr" ); + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle[VarRC+"_"+name+"_d23_clstr"], VarRC+"_"+name+"_d23_clstr" ); + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle[VarRC+"_"+name+"_Qw_clstr"], VarRC+"_"+name+"_Qw_clstr" ); + + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF332_clstr"],VarRC+"_"+name+"_gECF332_clstr"); + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF461_clstr"],VarRC+"_"+name+"_gECF461_clstr"); + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF322_clstr"],VarRC+"_"+name+"_gECF322_clstr"); + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF331_clstr"],VarRC+"_"+name+"_gECF331_clstr"); + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF422_clstr"],VarRC+"_"+name+"_gECF422_clstr"); + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF441_clstr"],VarRC+"_"+name+"_gECF441_clstr"); + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF212_clstr"],VarRC+"_"+name+"_gECF212_clstr"); + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF321_clstr"],VarRC+"_"+name+"_gECF321_clstr"); + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF311_clstr"],VarRC+"_"+name+"_gECF311_clstr"); + + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle[VarRC+"_"+name+"_L1_clstr"], VarRC+"_"+name+"_L1_clstr" ); + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle[VarRC+"_"+name+"_L2_clstr"], VarRC+"_"+name+"_L2_clstr" ); + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle[VarRC+"_"+name+"_L3_clstr"], VarRC+"_"+name+"_L3_clstr" ); + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle[VarRC+"_"+name+"_L4_clstr"], VarRC+"_"+name+"_L4_clstr" ); + m_particleLevelTreeManager->makeOutputVariable(m_VarRCjetBranchesParticle[VarRC+"_"+name+"_L5_clstr"], VarRC+"_"+name+"_L5_clstr" ); + } + } // end loop over mass parameters } // end loop over multipliers for mass scale } // end if VarRC jets @@ -2375,6 +2455,40 @@ namespace top { static SG::AuxElement::ConstAccessor<float> VarRCSplit12("Split12"); static SG::AuxElement::ConstAccessor<float> VarRCSplit23("Split23"); + // re-clustered jet substructure from clusters + static SG::AuxElement::ConstAccessor<float> Tau21_clstr("Tau21_clstr"); + static SG::AuxElement::ConstAccessor<float> Tau32_clstr("Tau32_clstr"); + static SG::AuxElement::ConstAccessor<float> Tau3_clstr("Tau3_clstr"); + static SG::AuxElement::ConstAccessor<float> Tau2_clstr("Tau2_clstr"); + static SG::AuxElement::ConstAccessor<float> Tau1_clstr("Tau1_clstr"); + static SG::AuxElement::ConstAccessor<float> D2_clstr("D2_clstr"); + static SG::AuxElement::ConstAccessor<float> ECF1_clstr("ECF1_clstr"); + static SG::AuxElement::ConstAccessor<float> ECF2_clstr("ECF2_clstr"); + static SG::AuxElement::ConstAccessor<float> ECF3_clstr("ECF3_clstr"); + static SG::AuxElement::ConstAccessor<float> d12_clstr("d12_clstr"); + static SG::AuxElement::ConstAccessor<float> d23_clstr("d23_clstr"); + static SG::AuxElement::ConstAccessor<float> Qw_clstr("Qw_clstr"); + + static SG::AuxElement::ConstAccessor<float> gECF332_clstr("gECF332_clstr"); + static SG::AuxElement::ConstAccessor<float> gECF461_clstr("gECF461_clstr"); + static SG::AuxElement::ConstAccessor<float> gECF322_clstr("gECF322_clstr"); + static SG::AuxElement::ConstAccessor<float> gECF331_clstr("gECF331_clstr"); + static SG::AuxElement::ConstAccessor<float> gECF422_clstr("gECF422_clstr"); + static SG::AuxElement::ConstAccessor<float> gECF441_clstr("gECF441_clstr"); + static SG::AuxElement::ConstAccessor<float> gECF212_clstr("gECF212_clstr"); + static SG::AuxElement::ConstAccessor<float> gECF321_clstr("gECF321_clstr"); + static SG::AuxElement::ConstAccessor<float> gECF311_clstr("gECF311_clstr"); + static SG::AuxElement::ConstAccessor<float> L1_clstr("L1_clstr"); + static SG::AuxElement::ConstAccessor<float> L2_clstr("L2_clstr"); + static SG::AuxElement::ConstAccessor<float> L3_clstr("L3_clstr"); + static SG::AuxElement::ConstAccessor<float> L4_clstr("L4_clstr"); + static SG::AuxElement::ConstAccessor<float> L5_clstr("L5_clstr"); + // store also the jet that is rebuilt to calculate the JSS + static SG::AuxElement::ConstAccessor<float> RRCJet_pt("RRCJet_pt"); + static SG::AuxElement::ConstAccessor<float> RRCJet_eta("RRCJet_eta"); + static SG::AuxElement::ConstAccessor<float> RRCJet_phi("RRCJet_phi"); + static SG::AuxElement::ConstAccessor<float> RRCJet_e("RRCJet_e"); + // Initialize the vectors to be saved as branches xAOD::JetContainer* vrc_jets = event.m_VarRCJets[name].get(); @@ -2391,6 +2505,45 @@ namespace top { m_VarRCjetsubBranches[VarRC+"_"+name+"_sub_e"].resize(sizeOfRCjets, std::vector<float>()); m_VarRCjetsubBranches[VarRC+"_"+name+"_sub_mv2c10"].resize(sizeOfRCjets, std::vector<float>()); + if (m_useRCJSS){ + m_VarRCjetBranches["vrrcjet_"+name+"_pt"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranches["vrrcjet_"+name+"_eta"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranches["vrrcjet_"+name+"_phi"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranches["vrrcjet_"+name+"_e"].resize(sizeOfRCjets,-999.); + + m_VarRCjetBranches[VarRC+"_"+name+"_tau32_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranches[VarRC+"_"+name+"_tau21_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranches[VarRC+"_"+name+"_tau1_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranches[VarRC+"_"+name+"_tau2_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranches[VarRC+"_"+name+"_tau3_clstr"].resize(sizeOfRCjets,-999.); + + m_VarRCjetBranches[VarRC+"_"+name+"_D2_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranches[VarRC+"_"+name+"_ECF1_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranches[VarRC+"_"+name+"_ECF2_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranches[VarRC+"_"+name+"_ECF3_clstr"].resize(sizeOfRCjets,-999.); + + m_VarRCjetBranches[VarRC+"_"+name+"_d12_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranches[VarRC+"_"+name+"_d23_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranches[VarRC+"_"+name+"_Qw_clstr"].resize(sizeOfRCjets,-999.); + + m_VarRCjetBranches[VarRC+"_"+name+"_gECF332_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranches[VarRC+"_"+name+"_gECF461_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranches[VarRC+"_"+name+"_gECF322_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranches[VarRC+"_"+name+"_gECF331_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranches[VarRC+"_"+name+"_gECF422_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranches[VarRC+"_"+name+"_gECF441_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranches[VarRC+"_"+name+"_gECF212_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranches[VarRC+"_"+name+"_gECF321_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranches[VarRC+"_"+name+"_gECF311_clstr"].resize(sizeOfRCjets,-999.); + + m_VarRCjetBranches[VarRC+"_"+name+"_L1_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranches[VarRC+"_"+name+"_L2_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranches[VarRC+"_"+name+"_L3_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranches[VarRC+"_"+name+"_L4_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranches[VarRC+"_"+name+"_L5_clstr"].resize(sizeOfRCjets,-999.); + } + + unsigned int i = 0; for (auto jet_ptr : *vrc_jets) { @@ -2404,6 +2557,44 @@ namespace top { m_VarRCjetBranches[VarRC+"_"+name+"_d12"][i] = (VarRCSplit12.isAvailable(*rc_jet)) ? VarRCSplit12(*rc_jet) : -999.; m_VarRCjetBranches[VarRC+"_"+name+"_d23"][i] = (VarRCSplit23.isAvailable(*rc_jet)) ? VarRCSplit23(*rc_jet) : -999.; + if (m_useRCJSS){ + m_VarRCjetBranches["vrrcjet_"+name+"_pt"][i] = (RRCJet_pt.isAvailable(*rc_jet)) ? RRCJet_pt(*rc_jet) : -999.; + m_VarRCjetBranches["vrrcjet_"+name+"_eta"][i] = (RRCJet_eta.isAvailable(*rc_jet)) ? RRCJet_eta(*rc_jet) : -999.; + m_VarRCjetBranches["vrrcjet_"+name+"_phi"][i] = (RRCJet_phi.isAvailable(*rc_jet)) ? RRCJet_phi(*rc_jet) : -999.; + m_VarRCjetBranches["vrrcjet_"+name+"_e"][i] = (RRCJet_e.isAvailable(*rc_jet)) ? RRCJet_e(*rc_jet) : -999.; + + m_VarRCjetBranches[VarRC+"_"+name+"_tau32_clstr"][i] = (Tau32_clstr.isAvailable(*rc_jet)) ? Tau32_clstr(*rc_jet) : -999.; + m_VarRCjetBranches[VarRC+"_"+name+"_tau21_clstr"][i] = (Tau21_clstr.isAvailable(*rc_jet)) ? Tau21_clstr(*rc_jet) : -999.; + m_VarRCjetBranches[VarRC+"_"+name+"_tau3_clstr"][i] = (Tau3_clstr.isAvailable(*rc_jet)) ? Tau3_clstr(*rc_jet) : -999.; + m_VarRCjetBranches[VarRC+"_"+name+"_tau2_clstr"][i] = (Tau2_clstr.isAvailable(*rc_jet)) ? Tau2_clstr(*rc_jet) : -999.; + m_VarRCjetBranches[VarRC+"_"+name+"_tau1_clstr"][i] = (Tau1_clstr.isAvailable(*rc_jet)) ? Tau1_clstr(*rc_jet) : -999.; + m_VarRCjetBranches[VarRC+"_"+name+"_D2_clstr"][i] = (D2_clstr.isAvailable(*rc_jet)) ? D2_clstr(*rc_jet) : -999.; + m_VarRCjetBranches[VarRC+"_"+name+"_ECF1_clstr"][i] = (ECF1_clstr.isAvailable(*rc_jet)) ? ECF1_clstr(*rc_jet) : -999.; + m_VarRCjetBranches[VarRC+"_"+name+"_ECF2_clstr"][i] = (ECF2_clstr.isAvailable(*rc_jet)) ? ECF2_clstr(*rc_jet) : -999.; + m_VarRCjetBranches[VarRC+"_"+name+"_ECF3_clstr"][i] = (ECF3_clstr.isAvailable(*rc_jet)) ? ECF3_clstr(*rc_jet) : -999.; + m_VarRCjetBranches[VarRC+"_"+name+"_d12_clstr"][i] = (d12_clstr.isAvailable(*rc_jet)) ? d12_clstr(*rc_jet) : -999.; + m_VarRCjetBranches[VarRC+"_"+name+"_d23_clstr"][i] = (d23_clstr.isAvailable(*rc_jet)) ? d23_clstr(*rc_jet) : -999.; + m_VarRCjetBranches[VarRC+"_"+name+"_Qw_clstr"][i] = (Qw_clstr.isAvailable(*rc_jet)) ? Qw_clstr(*rc_jet) : -999.; + + m_VarRCjetBranches[VarRC+"_"+name+"_gECF332_clstr"][i] = (gECF332_clstr.isAvailable(*rc_jet)) ? gECF332_clstr(*rc_jet) : -999.; + m_VarRCjetBranches[VarRC+"_"+name+"_gECF461_clstr"][i] = (gECF461_clstr.isAvailable(*rc_jet)) ? gECF461_clstr(*rc_jet) : -999.; + m_VarRCjetBranches[VarRC+"_"+name+"_gECF322_clstr"][i] = (gECF322_clstr.isAvailable(*rc_jet)) ? gECF322_clstr(*rc_jet) : -999.; + m_VarRCjetBranches[VarRC+"_"+name+"_gECF331_clstr"][i] = (gECF331_clstr.isAvailable(*rc_jet)) ? gECF331_clstr(*rc_jet) : -999.; + m_VarRCjetBranches[VarRC+"_"+name+"_gECF422_clstr"][i] = (gECF422_clstr.isAvailable(*rc_jet)) ? gECF422_clstr(*rc_jet) : -999.; + m_VarRCjetBranches[VarRC+"_"+name+"_gECF441_clstr"][i] = (gECF441_clstr.isAvailable(*rc_jet)) ? gECF441_clstr(*rc_jet) : -999.; + m_VarRCjetBranches[VarRC+"_"+name+"_gECF212_clstr"][i] = (gECF212_clstr.isAvailable(*rc_jet)) ? gECF212_clstr(*rc_jet) : -999.; + m_VarRCjetBranches[VarRC+"_"+name+"_gECF321_clstr"][i] = (gECF321_clstr.isAvailable(*rc_jet)) ? gECF321_clstr(*rc_jet) : -999.; + m_VarRCjetBranches[VarRC+"_"+name+"_gECF311_clstr"][i] = (gECF311_clstr.isAvailable(*rc_jet)) ? gECF311_clstr(*rc_jet) : -999.; + + m_VarRCjetBranches[VarRC+"_"+name+"_L1_clstr"][i] = (L1_clstr.isAvailable(*rc_jet)) ? L1_clstr(*rc_jet) : -999.; + m_VarRCjetBranches[VarRC+"_"+name+"_L2_clstr"][i] = (L2_clstr.isAvailable(*rc_jet)) ? L2_clstr(*rc_jet) : -999.; + m_VarRCjetBranches[VarRC+"_"+name+"_L3_clstr"][i] = (L3_clstr.isAvailable(*rc_jet)) ? L3_clstr(*rc_jet) : -999.; + m_VarRCjetBranches[VarRC+"_"+name+"_L4_clstr"][i] = (L4_clstr.isAvailable(*rc_jet)) ? L4_clstr(*rc_jet) : -999.; + m_VarRCjetBranches[VarRC+"_"+name+"_L5_clstr"][i] = (L5_clstr.isAvailable(*rc_jet)) ? L5_clstr(*rc_jet) : -999.; + + } + + // loop over subjets const xAOD::Jet* subjet(nullptr); const xAOD::BTagging* btag(nullptr); @@ -3364,6 +3555,39 @@ namespace top { // re-clustered jet substructure static SG::AuxElement::ConstAccessor<float> VarRCSplit12("Split12"); static SG::AuxElement::ConstAccessor<float> VarRCSplit23("Split23"); + // re-clustered jet substructure from clusters + static SG::AuxElement::ConstAccessor<float> Tau21_clstr("Tau21_clstr"); + static SG::AuxElement::ConstAccessor<float> Tau32_clstr("Tau32_clstr"); + static SG::AuxElement::ConstAccessor<float> Tau3_clstr("Tau3_clstr"); + static SG::AuxElement::ConstAccessor<float> Tau2_clstr("Tau2_clstr"); + static SG::AuxElement::ConstAccessor<float> Tau1_clstr("Tau1_clstr"); + static SG::AuxElement::ConstAccessor<float> D2_clstr("D2_clstr"); + static SG::AuxElement::ConstAccessor<float> ECF1_clstr("ECF1_clstr"); + static SG::AuxElement::ConstAccessor<float> ECF2_clstr("ECF2_clstr"); + static SG::AuxElement::ConstAccessor<float> ECF3_clstr("ECF3_clstr"); + static SG::AuxElement::ConstAccessor<float> d12_clstr("d12_clstr"); + static SG::AuxElement::ConstAccessor<float> d23_clstr("d23_clstr"); + static SG::AuxElement::ConstAccessor<float> Qw_clstr("Qw_clstr"); + + static SG::AuxElement::ConstAccessor<float> gECF332_clstr("gECF332_clstr"); + static SG::AuxElement::ConstAccessor<float> gECF461_clstr("gECF461_clstr"); + static SG::AuxElement::ConstAccessor<float> gECF322_clstr("gECF322_clstr"); + static SG::AuxElement::ConstAccessor<float> gECF331_clstr("gECF331_clstr"); + static SG::AuxElement::ConstAccessor<float> gECF422_clstr("gECF422_clstr"); + static SG::AuxElement::ConstAccessor<float> gECF441_clstr("gECF441_clstr"); + static SG::AuxElement::ConstAccessor<float> gECF212_clstr("gECF212_clstr"); + static SG::AuxElement::ConstAccessor<float> gECF321_clstr("gECF321_clstr"); + static SG::AuxElement::ConstAccessor<float> gECF311_clstr("gECF311_clstr"); + static SG::AuxElement::ConstAccessor<float> L1_clstr("L1_clstr"); + static SG::AuxElement::ConstAccessor<float> L2_clstr("L2_clstr"); + static SG::AuxElement::ConstAccessor<float> L3_clstr("L3_clstr"); + static SG::AuxElement::ConstAccessor<float> L4_clstr("L4_clstr"); + static SG::AuxElement::ConstAccessor<float> L5_clstr("L5_clstr"); + // store also the jet that is rebuilt to calculate the JSS + static SG::AuxElement::ConstAccessor<float> RRCJet_pt("RRCJet_pt"); + static SG::AuxElement::ConstAccessor<float> RRCJet_eta("RRCJet_eta"); + static SG::AuxElement::ConstAccessor<float> RRCJet_phi("RRCJet_phi"); + static SG::AuxElement::ConstAccessor<float> RRCJet_e("RRCJet_e"); // Initialize the vectors to be saved as branches @@ -3379,6 +3603,43 @@ namespace top { m_VarRCjetsubBranchesParticle[VarRC+"_"+name+"_sub_eta"].resize(sizeOfRCjets, std::vector<float>()); m_VarRCjetsubBranchesParticle[VarRC+"_"+name+"_sub_phi"].resize(sizeOfRCjets, std::vector<float>()); m_VarRCjetsubBranchesParticle[VarRC+"_"+name+"_sub_e"].resize(sizeOfRCjets, std::vector<float>()); + if (m_useRCJSS){ + m_VarRCjetBranchesParticle["vrrcjet_"+name+"_pt"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranchesParticle["vrrcjet_"+name+"_eta"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranchesParticle["vrrcjet_"+name+"_phi"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranchesParticle["vrrcjet_"+name+"_e"].resize(sizeOfRCjets,-999.); + + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_tau32_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_tau21_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_tau1_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_tau2_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_tau3_clstr"].resize(sizeOfRCjets,-999.); + + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_D2_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_ECF1_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_ECF2_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_ECF3_clstr"].resize(sizeOfRCjets,-999.); + + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_d12_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_d23_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_Qw_clstr"].resize(sizeOfRCjets,-999.); + + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF332_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF461_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF322_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF331_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF422_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF441_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF212_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF321_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF311_clstr"].resize(sizeOfRCjets,-999.); + + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_L1_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_L2_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_L3_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_L4_clstr"].resize(sizeOfRCjets,-999.); + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_L5_clstr"].resize(sizeOfRCjets,-999.); + } unsigned int i = 0; @@ -3393,6 +3654,43 @@ namespace top { m_VarRCjetBranchesParticle[VarRC+"_"+name+"_d12"][i] = (VarRCSplit12.isAvailable(*rc_jet)) ? VarRCSplit12(*rc_jet) : -999.; m_VarRCjetBranchesParticle[VarRC+"_"+name+"_d23"][i] = (VarRCSplit23.isAvailable(*rc_jet)) ? VarRCSplit23(*rc_jet) : -999.; + if (m_useRCJSS){ + m_VarRCjetBranchesParticle["vrrcjet_"+name+"_pt"][i] = (RRCJet_pt.isAvailable(*rc_jet)) ? RRCJet_pt(*rc_jet) : -999.; + m_VarRCjetBranchesParticle["vrrcjet_"+name+"_eta"][i] = (RRCJet_eta.isAvailable(*rc_jet)) ? RRCJet_eta(*rc_jet) : -999.; + m_VarRCjetBranchesParticle["vrrcjet_"+name+"_phi"][i] = (RRCJet_phi.isAvailable(*rc_jet)) ? RRCJet_phi(*rc_jet) : -999.; + m_VarRCjetBranchesParticle["vrrcjet_"+name+"_e"][i] = (RRCJet_e.isAvailable(*rc_jet)) ? RRCJet_e(*rc_jet) : -999.; + + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_tau32_clstr"][i] = (Tau32_clstr.isAvailable(*rc_jet)) ? Tau32_clstr(*rc_jet) : -999.; + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_tau21_clstr"][i] = (Tau21_clstr.isAvailable(*rc_jet)) ? Tau21_clstr(*rc_jet) : -999.; + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_tau3_clstr"][i] = (Tau3_clstr.isAvailable(*rc_jet)) ? Tau3_clstr(*rc_jet) : -999.; + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_tau2_clstr"][i] = (Tau2_clstr.isAvailable(*rc_jet)) ? Tau2_clstr(*rc_jet) : -999.; + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_tau1_clstr"][i] = (Tau1_clstr.isAvailable(*rc_jet)) ? Tau1_clstr(*rc_jet) : -999.; + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_D2_clstr"][i] = (D2_clstr.isAvailable(*rc_jet)) ? D2_clstr(*rc_jet) : -999.; + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_ECF1_clstr"][i] = (ECF1_clstr.isAvailable(*rc_jet)) ? ECF1_clstr(*rc_jet) : -999.; + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_ECF2_clstr"][i] = (ECF2_clstr.isAvailable(*rc_jet)) ? ECF2_clstr(*rc_jet) : -999.; + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_ECF3_clstr"][i] = (ECF3_clstr.isAvailable(*rc_jet)) ? ECF3_clstr(*rc_jet) : -999.; + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_d12_clstr"][i] = (d12_clstr.isAvailable(*rc_jet)) ? d12_clstr(*rc_jet) : -999.; + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_d23_clstr"][i] = (d23_clstr.isAvailable(*rc_jet)) ? d23_clstr(*rc_jet) : -999.; + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_Qw_clstr"][i] = (Qw_clstr.isAvailable(*rc_jet)) ? Qw_clstr(*rc_jet) : -999.; + + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF332_clstr"][i] = (gECF332_clstr.isAvailable(*rc_jet)) ? gECF332_clstr(*rc_jet) : -999.; + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF461_clstr"][i] = (gECF461_clstr.isAvailable(*rc_jet)) ? gECF461_clstr(*rc_jet) : -999.; + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF322_clstr"][i] = (gECF322_clstr.isAvailable(*rc_jet)) ? gECF322_clstr(*rc_jet) : -999.; + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF331_clstr"][i] = (gECF331_clstr.isAvailable(*rc_jet)) ? gECF331_clstr(*rc_jet) : -999.; + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF422_clstr"][i] = (gECF422_clstr.isAvailable(*rc_jet)) ? gECF422_clstr(*rc_jet) : -999.; + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF441_clstr"][i] = (gECF441_clstr.isAvailable(*rc_jet)) ? gECF441_clstr(*rc_jet) : -999.; + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF212_clstr"][i] = (gECF212_clstr.isAvailable(*rc_jet)) ? gECF212_clstr(*rc_jet) : -999.; + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF321_clstr"][i] = (gECF321_clstr.isAvailable(*rc_jet)) ? gECF321_clstr(*rc_jet) : -999.; + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_gECF311_clstr"][i] = (gECF311_clstr.isAvailable(*rc_jet)) ? gECF311_clstr(*rc_jet) : -999.; + + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_L1_clstr"][i] = (L1_clstr.isAvailable(*rc_jet)) ? L1_clstr(*rc_jet) : -999.; + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_L2_clstr"][i] = (L2_clstr.isAvailable(*rc_jet)) ? L2_clstr(*rc_jet) : -999.; + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_L3_clstr"][i] = (L3_clstr.isAvailable(*rc_jet)) ? L3_clstr(*rc_jet) : -999.; + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_L4_clstr"][i] = (L4_clstr.isAvailable(*rc_jet)) ? L4_clstr(*rc_jet) : -999.; + m_VarRCjetBranchesParticle[VarRC+"_"+name+"_L5_clstr"][i] = (L5_clstr.isAvailable(*rc_jet)) ? L5_clstr(*rc_jet) : -999.; + + } + // loop over subjets const xAOD::Jet* subjet(nullptr); m_VarRCjetsubBranchesParticle[VarRC+"_"+name+"_sub_pt"][i].clear(); // clear the vector size (otherwise it grows out of control!) diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopEvent/Root/RCJetMC15.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopEvent/Root/RCJetMC15.cxx index 1d97df8b8b09f304bd26d9477c62f7e0dc4242f1..4f4ef6476f3b3dfd611d1f6d0860830fc5967699 100644 --- a/PhysicsAnalysis/TopPhys/xAOD/TopEvent/Root/RCJetMC15.cxx +++ b/PhysicsAnalysis/TopPhys/xAOD/TopEvent/Root/RCJetMC15.cxx @@ -103,6 +103,9 @@ StatusCode RCJetMC15::initialize(){ float rho = std::stof(original_rho); float m_scale = mass_scales.at(m_VarRCjets_mass_scale); m_massscale = rho*m_scale*1e-3; // e.g., 2*m_top; in [GeV]! + + if (m_config->useRCJetSubstructure())m_useJSS=true; + } else{ m_ptcut = std::stof( configSettings->value("RCJetPt") ); // for initialize [GeV] & passSelection @@ -111,8 +114,10 @@ StatusCode RCJetMC15::initialize(){ m_radius = std::stof( configSettings->value("RCJetRadius") ); // for initialize m_minradius = -1.0; m_massscale = -1.0; - if (m_config->useRCJetSubstructure()){ - m_useJSS = true; + if (m_config->useRCJetSubstructure())m_useJSS=true; + } + + if (m_useJSS){ ATH_MSG_INFO("Calculating RCJet Substructure"); @@ -164,7 +169,9 @@ StatusCode RCJetMC15::initialize(){ m_gECF321 = new JetSubStructureUtils::EnergyCorrelatorGeneralized(2,3,1, JetSubStructureUtils::EnergyCorrelator::pt_R); m_gECF311 = new JetSubStructureUtils::EnergyCorrelatorGeneralized(1,3,1, JetSubStructureUtils::EnergyCorrelator::pt_R); } - } + + + for (auto treeName : *m_config->systAllTTreeNames()) { // only make a new tool if it is the nominal systematic or one that could affect small-r jets (el, mu, jet) diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopParticleLevel/Root/ParticleLevelRCJetObjectLoader.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopParticleLevel/Root/ParticleLevelRCJetObjectLoader.cxx index 3055352e437aa2f63d78aae596e52929825ebdcc..68e1572628e11dd2572f5f3ef1badf24af0d9d12 100644 --- a/PhysicsAnalysis/TopPhys/xAOD/TopParticleLevel/Root/ParticleLevelRCJetObjectLoader.cxx +++ b/PhysicsAnalysis/TopPhys/xAOD/TopParticleLevel/Root/ParticleLevelRCJetObjectLoader.cxx @@ -82,7 +82,9 @@ StatusCode ParticleLevelRCJetObjectLoader::initialize(){ std::replace( original_rho.begin(), original_rho.end(), '_', '.'); float rho = std::stof(original_rho); float m_scale = mass_scales.at(m_VarRCjets_mass_scale); - m_massscale = rho*m_scale*1e-3; + m_massscale = rho*m_scale*1e-3; + + if (m_config->useRCJetSubstructure())m_useJSS=true; } else { m_ptcut = m_config->RCJetPtcut() ; // for initialize [GeV] & passSelection @@ -91,6 +93,8 @@ StatusCode ParticleLevelRCJetObjectLoader::initialize(){ m_radius = m_config->RCJetRadius() ; // for initialize m_minradius = -1.0; m_massscale = -1.0; + + if (m_config->useRCJetSubstructure())m_useJSS=true; } @@ -111,8 +115,7 @@ StatusCode ParticleLevelRCJetObjectLoader::initialize(){ top::check(m_jetReclusteringTool->setProperty("VariableRMassScale", m_massscale),"Failed VarRC mass scale initialize reclustering tool"); top::check(m_jetReclusteringTool->initialize(),"Failed to initialize reclustering tool"); - if (m_config->useRCJetSubstructure()){ - m_useJSS = true; + if (m_useJSS){ ATH_MSG_INFO("Calculating PL RCJet Substructure"); //clean up the null ptrs delete m_jet_def_rebuild;