.. _program_listing_file_Root_JetContainer.cxx: Program Listing for File JetContainer.cxx ========================================= |exhale_lsh| :ref:`Return to documentation for file ` (``Root/JetContainer.cxx``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #include "xAODAnaHelpers/JetContainer.h" #include #include #include // std::domain_error #include "xAODTruth/TruthEventContainer.h" #include "xAODBTagging/BTaggingUtilities.h" using namespace xAH; JetContainer::JetContainer(const std::string& name, const std::string& detailStr, float units, bool mc) : ParticleContainer(name,detailStr,units,mc), m_trkSelTool(nullptr) { // rapidity if(m_infoSwitch.m_rapidity) { m_rapidity =new std::vector(); } // trigger if ( m_infoSwitch.m_trigger ) { m_isTrigMatched = new std::vector (); m_isTrigMatchedToChain = new std::vector > (); m_listTrigChains = new std::vector (); } // clean if(m_infoSwitch.m_cleanTrig && ! (m_infoSwitch.m_clean || m_infoSwitch.m_cleanLight || m_infoSwitch.m_cleanLLP)) { std::cout << "JetContainer WARNING You asked for cleanTrig for " << name << "but didn't specify clean, cleanLight or cleanLLP. Going to assume you wanted clean." << std::endl; m_infoSwitch.m_clean = true; } if(m_infoSwitch.m_clean || m_infoSwitch.m_cleanLight || m_infoSwitch.m_cleanLLP) { if(m_infoSwitch.m_clean){ m_Timing =new std::vector(); m_LArQuality =new std::vector(); m_HECQuality =new std::vector(); m_NegativeE =new std::vector(); m_AverageLArQF =new std::vector(); m_BchCorrCell =new std::vector(); m_N90Constituents =new std::vector(); m_LArBadHVEnergyFrac =new std::vector(); m_LArBadHVNCell =new std::vector(); m_ChargedFraction =new std::vector(); m_OotFracClusters5 =new std::vector(); m_OotFracClusters10 =new std::vector(); m_LeadingClusterPt =new std::vector(); m_LeadingClusterSecondLambda=new std::vector(); m_LeadingClusterCenterLambda=new std::vector(); m_LeadingClusterSecondR =new std::vector(); if(m_infoSwitch.m_cleanTrig) { m_clean_passLooseBadTriggerUgly=new std::vector(); } else { m_clean_passLooseBadUgly =new std::vector(); m_clean_passTightBadUgly =new std::vector(); } } if(m_infoSwitch.m_cleanTrig) { m_clean_passLooseBadTrigger =new std::vector(); } else { m_clean_passLooseBad =new std::vector(); m_clean_passTightBad =new std::vector(); } if(m_infoSwitch.m_cleanLLP) { m_clean_passLooseBadLLP =new std::vector(); } } if(m_infoSwitch.m_timing && !m_infoSwitch.m_clean){ m_Timing = new std::vector(); } // energy if ( m_infoSwitch.m_energy || m_infoSwitch.m_energyLight ) { if ( m_infoSwitch.m_energy ) { m_HECFrac = new std::vector(); m_CentroidR = new std::vector(); m_LowEtConstituentsFrac = new std::vector(); } m_EMFrac = new std::vector(); m_FracSamplingMax = new std::vector(); m_FracSamplingMaxIndex = new std::vector(); m_GhostMuonSegmentCount = new std::vector(); m_Width = new std::vector(); } // scales if ( m_infoSwitch.m_scales ) { m_emScalePt = new std::vector(); m_constScalePt = new std::vector(); m_pileupScalePt = new std::vector(); m_originConstitScalePt = new std::vector(); m_etaJESScalePt = new std::vector(); m_gscScalePt = new std::vector(); m_jmsScalePt = new std::vector(); m_insituScalePt = new std::vector(); m_emScaleM = new std::vector(); m_constScaleM = new std::vector(); m_pileupScaleM = new std::vector(); m_originConstitScaleM = new std::vector(); m_etaJESScaleM = new std::vector(); m_gscScaleM = new std::vector(); m_jmsScaleM = new std::vector(); m_insituScaleM = new std::vector(); } // constscale eta if ( m_infoSwitch.m_constscaleEta ) { m_constScaleEta = new std::vector(); } // detector eta if ( m_infoSwitch.m_detectorEta ) { m_detectorEta = new std::vector(); } // layer if ( m_infoSwitch.m_layer ) { m_EnergyPerSampling = new std::vector< std::vector >(); } // tracksAll if ( m_infoSwitch.m_trackAll ) { m_NumTrkPt1000 = new std::vector< std::vector > (); m_SumPtTrkPt1000 = new std::vector< std::vector > (); m_TrackWidthPt1000 = new std::vector< std::vector > (); m_NumTrkPt500 = new std::vector< std::vector > (); m_SumPtTrkPt500 = new std::vector< std::vector > (); m_TrackWidthPt500 = new std::vector< std::vector > (); m_JVF = new std::vector< std::vector > (); } // trackPV if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_jvt ) { if (m_infoSwitch.m_trackPV){ m_NumTrkPt1000PV = new std::vector(); m_SumPtTrkPt1000PV = new std::vector(); m_TrackWidthPt1000PV = new std::vector(); m_NumTrkPt500PV = new std::vector(); m_SumPtTrkPt500PV = new std::vector(); m_TrackWidthPt500PV = new std::vector(); m_JVFPV = new std::vector(); m_JvtJvfcorr = new std::vector(); m_JvtRpt = new std::vector(); } m_Jvt = new std::vector(); } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sfJVTName == "Loose" ) { m_JvtPass_Loose = new std::vector(); if ( m_mc ) { m_JvtEff_SF_Loose = new std::vector< std::vector > (); } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sfJVTName == "Medium" ) { m_JvtPass_Medium = new std::vector(); if ( m_mc ) { m_JvtEff_SF_Medium = new std::vector< std::vector > (); } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sfJVTName == "Tight" ) { m_JvtPass_Tight = new std::vector(); if ( m_mc ) { m_JvtEff_SF_Tight = new std::vector< std::vector > (); } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sfJVTName == "FixedEffPt" ) { m_JvtPass_FixedEffPt = new std::vector(); if ( m_mc ) { m_JvtEff_SF_FixedEffPt = new std::vector< std::vector > (); } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sfJVTName == "TightFwd" ) { m_JvtPass_TightFwd = new std::vector(); if ( m_mc ) { m_JvtEff_SF_TightFwd = new std::vector< std::vector > (); } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sffJVTName == "Loose" ) { m_fJvtPass_Loose = new std::vector(); if ( m_mc ) { m_fJvtEff_SF_Loose = new std::vector< std::vector > (); } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sffJVTName == "Medium" ) { m_fJvtPass_Medium = new std::vector(); if ( m_mc ) { m_fJvtEff_SF_Medium = new std::vector< std::vector > (); } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sffJVTName == "Tight" ) { m_fJvtPass_Tight = new std::vector(); if ( m_mc ) { m_fJvtEff_SF_Tight = new std::vector< std::vector > (); } } if (m_infoSwitch.m_fJvt) { m_fJvt = new std::vector(); } if (m_infoSwitch.m_NNJvt) { m_NNJvt = new std::vector(); m_NNJvtPass = new std::vector(); } // chargedPFOPV if ( m_infoSwitch.m_chargedPFOPV ) { m_SumPtChargedPFOPt500PV = new std::vector (); m_fCharged = new std::vector (); } // allTrack // trackAll or trackPV if ( m_infoSwitch.m_allTrack ) { m_GhostTrackCount = new std::vector (); m_GhostTrackPt = new std::vector (); m_GhostTrack_pt = new std::vector< std::vector > (); m_GhostTrack_qOverP = new std::vector< std::vector > (); m_GhostTrack_eta = new std::vector< std::vector > (); m_GhostTrack_phi = new std::vector< std::vector > (); m_GhostTrack_e = new std::vector< std::vector > (); m_GhostTrack_d0 = new std::vector< std::vector > (); m_GhostTrack_z0 = new std::vector< std::vector > (); // allTrackDetail if(m_infoSwitch.m_allTrackDetail){ m_GhostTrack_nPixelHits = new std::vector< std::vector >(); m_GhostTrack_nSCTHits = new std::vector< std::vector >(); m_GhostTrack_nTRTHits = new std::vector< std::vector >(); m_GhostTrack_nPixelSharedHits = new std::vector< std::vector >(); m_GhostTrack_nPixelSplitHits = new std::vector< std::vector >(); m_GhostTrack_nInnermostPixelLayerHits = new std::vector< std::vector >(); m_GhostTrack_nInnermostPixelLayerSharedHits = new std::vector< std::vector >(); m_GhostTrack_nInnermostPixelLayerSplitHits = new std::vector< std::vector >(); m_GhostTrack_nNextToInnermostPixelLayerHits = new std::vector< std::vector >(); m_GhostTrack_nNextToInnermostPixelLayerSharedHits = new std::vector< std::vector >(); m_GhostTrack_nNextToInnermostPixelLayerSplitHits = new std::vector< std::vector >(); } } // constituent if ( m_infoSwitch.m_constituent ) { m_numConstituents = new std::vector< int > (); } if ( m_infoSwitch.m_constituentAll ) { m_constituentWeights = new std::vector< std::vector > (); m_constituent_pt = new std::vector< std::vector > (); m_constituent_eta = new std::vector< std::vector > (); m_constituent_phi = new std::vector< std::vector > (); m_constituent_e = new std::vector< std::vector > (); } // flavorTag if( m_infoSwitch.m_flavorTag || m_infoSwitch.m_flavorTagHLT || m_infoSwitch.m_flavorTagTLA ) { m_HadronConeExclTruthLabelID =new std::vector(); m_HadronConeExclExtendedTruthLabelID=new std::vector(); } if( m_infoSwitch.m_flavorTag || m_infoSwitch.m_flavorTagHLT ) { m_DL1r =new std::vector(); m_DL1r_pu =new std::vector(); m_DL1r_pc =new std::vector(); m_DL1r_pb =new std::vector(); m_DL1dv00 =new std::vector(); m_DL1dv00_pu =new std::vector(); m_DL1dv00_pc =new std::vector(); m_DL1dv00_pb =new std::vector(); m_DL1dv01 =new std::vector(); m_DL1dv01_pu =new std::vector(); m_DL1dv01_pc =new std::vector(); m_DL1dv01_pb =new std::vector(); m_GN1 =new std::vector(); m_GN1_pu =new std::vector(); m_GN1_pc =new std::vector(); m_GN1_pb =new std::vector(); m_GN2v00LegacyWP =new std::vector(); m_GN2v00LegacyWP_pu =new std::vector(); m_GN2v00LegacyWP_pc =new std::vector(); m_GN2v00LegacyWP_pb =new std::vector(); m_GN2v00NewAliasWP =new std::vector(); m_GN2v00NewAliasWP_pu =new std::vector(); m_GN2v00NewAliasWP_pc =new std::vector(); m_GN2v00NewAliasWP_pb =new std::vector(); m_GN2v01 =new std::vector(); m_GN2v01_pu =new std::vector(); m_GN2v01_pc =new std::vector(); m_GN2v01_pb =new std::vector(); m_GN2v01_ptau =new std::vector(); // Jet Fitter if( m_infoSwitch.m_jetFitterDetails){ m_JetFitter_nVTX = new std::vector(); m_JetFitter_nSingleTracks = new std::vector(); m_JetFitter_nTracksAtVtx = new std::vector(); m_JetFitter_mass = new std::vector(); m_JetFitter_energyFraction = new std::vector(); m_JetFitter_significance3d = new std::vector(); m_JetFitter_deltaeta = new std::vector(); m_JetFitter_deltaphi = new std::vector(); m_JetFitter_N2Tpar = new std::vector(); } // SV Details if( m_infoSwitch.m_svDetails){ m_SV0 = new std::vector(); m_sv0_NGTinSvx = new std::vector(); m_sv0_N2Tpair = new std::vector(); m_sv0_massvx = new std::vector(); m_sv0_efracsvx = new std::vector(); m_sv0_normdist = new std::vector(); m_SV1 = new std::vector(); m_SV1IP3D = new std::vector(); m_COMBx = new std::vector(); m_sv1_pu = new std::vector(); m_sv1_pb = new std::vector(); m_sv1_pc = new std::vector(); m_sv1_c = new std::vector(); m_sv1_cu = new std::vector(); m_sv1_NGTinSvx = new std::vector(); m_sv1_N2Tpair = new std::vector(); m_sv1_massvx = new std::vector(); m_sv1_efracsvx = new std::vector(); m_sv1_normdist = new std::vector(); m_sv1_Lxy = new std::vector(); m_sv1_sig3d = new std::vector(); m_sv1_L3d = new std::vector(); m_sv1_distmatlay = new std::vector(); m_sv1_dR = new std::vector(); } // IP3D if( m_infoSwitch.m_ipDetails){ m_IP2D_pu = new std::vector(); m_IP2D_pb = new std::vector(); m_IP2D_pc = new std::vector(); m_IP2D = new std::vector(); m_IP2D_c = new std::vector(); m_IP2D_cu = new std::vector(); m_nIP2DTracks = new std::vector(); m_IP2D_gradeOfTracks = new std::vector >(); m_IP2D_flagFromV0ofTracks = new std::vector >(); m_IP2D_valD0wrtPVofTracks = new std::vector >(); m_IP2D_sigD0wrtPVofTracks = new std::vector >(); m_IP2D_weightBofTracks = new std::vector >(); m_IP2D_weightCofTracks = new std::vector >(); m_IP2D_weightUofTracks = new std::vector >(); m_IP3D = new std::vector(); m_IP3D_pu = new std::vector(); m_IP3D_pb = new std::vector(); m_IP3D_pc = new std::vector(); m_IP3D_c = new std::vector(); m_IP3D_cu = new std::vector(); m_nIP3DTracks = new std::vector(); m_IP3D_gradeOfTracks = new std::vector >(); m_IP3D_flagFromV0ofTracks = new std::vector >(); m_IP3D_valD0wrtPVofTracks = new std::vector >(); m_IP3D_sigD0wrtPVofTracks = new std::vector >(); m_IP3D_valZ0wrtPVofTracks = new std::vector >(); m_IP3D_sigZ0wrtPVofTracks = new std::vector >(); m_IP3D_weightBofTracks = new std::vector >(); m_IP3D_weightCofTracks = new std::vector >(); m_IP3D_weightUofTracks = new std::vector >(); } if( m_infoSwitch.m_JVC ) { m_JetVertexCharge_discriminant = new std::vector(); } } // flavorTagHLT if( m_infoSwitch.m_flavorTagHLT ) { m_vtxOnlineValid = new std::vector(); m_vtxHadDummy = new std::vector(); m_bs_online_vx = new std::vector(); m_bs_online_vy = new std::vector(); m_bs_online_vz = new std::vector(); m_vtx_offline_x0 = new std::vector(); m_vtx_offline_y0 = new std::vector(); m_vtx_offline_z0 = new std::vector(); m_vtx_online_x0 = new std::vector(); m_vtx_online_y0 = new std::vector(); m_vtx_online_z0 = new std::vector(); m_vtx_online_bkg_x0 = new std::vector(); m_vtx_online_bkg_y0 = new std::vector(); m_vtx_online_bkg_z0 = new std::vector(); } if( m_infoSwitch.m_flavorTagTLA ) { m_fastDIPS =new std::vector(); m_fastDIPS_pu =new std::vector(); m_fastDIPS_pc =new std::vector(); m_fastDIPS_pb =new std::vector(); } if( !m_infoSwitch.m_jetBTag.empty() ) { std::stringstream ss_wpName; for(const auto& btaginfo : m_infoSwitch.m_jetBTag) { for(auto wp : btaginfo.second) { ss_wpName.str(""); ss_wpName << wp.first << "_" << std::setfill('0') << std::setw(2) << wp.second; m_btags.push_back(new btagOpPoint(m_mc, btaginfo.first, ss_wpName.str())); } } } if ( !m_infoSwitch.m_jetBTagCts.empty() ){ for(const auto& tagger: m_infoSwitch.m_jetBTagCts) { m_btags.push_back(new btagOpPoint(m_mc,tagger,"Continuous")); } } // area if( m_infoSwitch.m_area ) { m_GhostArea = new std::vector(); m_ActiveArea = new std::vector(); m_VoronoiArea = new std::vector(); m_ActiveArea4vec_pt = new std::vector(); m_ActiveArea4vec_eta = new std::vector(); m_ActiveArea4vec_phi = new std::vector(); m_ActiveArea4vec_m = new std::vector(); } // truth if ( m_infoSwitch.m_truth && m_mc ) { m_ConeTruthLabelID =new std::vector(); m_TruthCount =new std::vector(); m_TruthLabelDeltaR_B=new std::vector; m_TruthLabelDeltaR_C=new std::vector; m_TruthLabelDeltaR_T=new std::vector; m_PartonTruthLabelID=new std::vector(); m_GhostTruthAssociationFraction=new std::vector; m_truth_E =new std::vector; m_truth_pt =new std::vector; m_truth_phi=new std::vector; m_truth_eta=new std::vector; } // truth detail if ( m_infoSwitch.m_truthDetails ) { m_GhostBHadronsFinalCount = new std::vector (); m_GhostBHadronsInitialCount = new std::vector (); m_GhostBQuarksFinalCount = new std::vector (); m_GhostBHadronsFinalPt = new std::vector (); m_GhostBHadronsInitialPt = new std::vector (); m_GhostBQuarksFinalPt = new std::vector (); m_GhostCHadronsFinalCount = new std::vector (); m_GhostCHadronsInitialCount = new std::vector (); m_GhostCQuarksFinalCount = new std::vector (); m_GhostCHadronsFinalPt = new std::vector (); m_GhostCHadronsInitialPt = new std::vector (); m_GhostCQuarksFinalPt = new std::vector (); m_GhostTausFinalCount = new std::vector (); m_GhostTausFinalPt = new std::vector (); m_truth_pdgId = new std::vector (); m_truth_partonPt = new std::vector (); m_truth_partonDR = new std::vector (); } // charge if ( m_infoSwitch.m_charge ) { m_charge =new std::vector(); } // passSel if ( m_infoSwitch.m_passSel ) { m_passSel =new std::vector(); } // passOR if ( m_infoSwitch.m_passOR ) { m_passOR =new std::vector(); } } JetContainer::~JetContainer() { if(m_debug) std::cout << " Deleting JetContainer " << std::endl; if(m_infoSwitch.m_rapidity) { delete m_rapidity; } // trigger if ( m_infoSwitch.m_trigger ) { delete m_isTrigMatched ; delete m_isTrigMatchedToChain ; delete m_listTrigChains ; } // clean if(m_infoSwitch.m_clean || m_infoSwitch.m_cleanLight || m_infoSwitch.m_cleanLLP) { if(m_infoSwitch.m_clean){ delete m_Timing; delete m_LArQuality; delete m_HECQuality; delete m_NegativeE; delete m_AverageLArQF; delete m_BchCorrCell; delete m_N90Constituents; delete m_LArBadHVEnergyFrac; delete m_LArBadHVNCell; delete m_ChargedFraction; delete m_OotFracClusters5; delete m_OotFracClusters10; delete m_LeadingClusterPt; delete m_LeadingClusterSecondLambda; delete m_LeadingClusterCenterLambda; delete m_LeadingClusterSecondR; if(m_infoSwitch.m_cleanTrig) { delete m_clean_passLooseBadTriggerUgly; } else { delete m_clean_passLooseBadUgly; delete m_clean_passTightBadUgly; } } if(m_infoSwitch.m_cleanTrig) { delete m_clean_passLooseBadTrigger; } else { delete m_clean_passLooseBad; delete m_clean_passTightBad; } if(m_infoSwitch.m_cleanLLP) { delete m_clean_passLooseBadLLP; } } if(m_infoSwitch.m_timing && !m_infoSwitch.m_clean){ delete m_Timing; } // energy if ( m_infoSwitch.m_energy || m_infoSwitch.m_energyLight ) { if ( m_infoSwitch.m_energy ){ delete m_HECFrac; delete m_CentroidR; delete m_LowEtConstituentsFrac; } delete m_EMFrac; delete m_FracSamplingMax; delete m_FracSamplingMaxIndex; delete m_GhostMuonSegmentCount; delete m_Width; } // scales if ( m_infoSwitch.m_scales ) { delete m_emScalePt ; delete m_constScalePt ; delete m_pileupScalePt ; delete m_originConstitScalePt ; delete m_etaJESScalePt ; delete m_gscScalePt ; delete m_jmsScalePt ; delete m_insituScalePt ; delete m_emScaleM ; delete m_constScaleM ; delete m_pileupScaleM ; delete m_originConstitScaleM ; delete m_etaJESScaleM ; delete m_gscScaleM ; delete m_jmsScaleM ; delete m_insituScaleM ; } // constscale eta if ( m_infoSwitch.m_constscaleEta ) { delete m_constScaleEta ; } // detector eta if ( m_infoSwitch.m_detectorEta ) { delete m_detectorEta; } // layer if ( m_infoSwitch.m_layer ) { delete m_EnergyPerSampling; } // tracksAll if ( m_infoSwitch.m_trackAll ) { delete m_NumTrkPt1000 ; delete m_SumPtTrkPt1000 ; delete m_TrackWidthPt1000 ; delete m_NumTrkPt500 ; delete m_SumPtTrkPt500 ; delete m_TrackWidthPt500 ; delete m_JVF ; } // trackPV if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_jvt ) { if ( m_infoSwitch.m_trackPV ){ delete m_NumTrkPt1000PV; delete m_SumPtTrkPt1000PV; delete m_TrackWidthPt1000PV; delete m_NumTrkPt500PV; delete m_SumPtTrkPt500PV; delete m_TrackWidthPt500PV; delete m_JVFPV; delete m_JvtJvfcorr; delete m_JvtRpt; } delete m_Jvt; } if (m_infoSwitch.m_fJvt){ delete m_fJvt; } if (m_infoSwitch.m_NNJvt){ delete m_NNJvt; delete m_NNJvtPass; } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sfJVTName == "Loose" ) { delete m_JvtPass_Loose; if ( m_mc ) { delete m_JvtEff_SF_Loose; } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sfJVTName == "Medium" ) { delete m_JvtPass_Medium; if ( m_mc ) { delete m_JvtEff_SF_Medium; } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sfJVTName == "Tight" ) { delete m_JvtPass_Tight; if ( m_mc ) { delete m_JvtEff_SF_Tight; } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sfJVTName == "FixedEffPt" ) { delete m_JvtPass_FixedEffPt; if ( m_mc ) { delete m_JvtEff_SF_FixedEffPt; } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sfJVTName == "TightFwd" ) { delete m_JvtPass_TightFwd; if ( m_mc ) { delete m_JvtEff_SF_TightFwd; } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sffJVTName == "Loose" ) { delete m_fJvtPass_Loose; if ( m_mc ) { delete m_fJvtEff_SF_Loose; } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sffJVTName == "Medium" ) { delete m_fJvtPass_Medium; if ( m_mc ) { delete m_fJvtEff_SF_Medium; } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sffJVTName == "Tight" ) { delete m_fJvtPass_Tight; if ( m_mc ) { delete m_fJvtEff_SF_Tight; } } // chargedPFOPV if ( m_infoSwitch.m_chargedPFOPV ) { delete m_SumPtChargedPFOPt500PV; delete m_fCharged; } // allTrack // trackAll or trackPV if ( m_infoSwitch.m_allTrack ) { delete m_GhostTrackCount ; delete m_GhostTrackPt ; delete m_GhostTrack_pt ; delete m_GhostTrack_qOverP ; delete m_GhostTrack_eta ; delete m_GhostTrack_phi ; delete m_GhostTrack_e ; delete m_GhostTrack_d0 ; delete m_GhostTrack_z0 ; // allTrackDetail if(m_infoSwitch.m_allTrackDetail){ delete m_GhostTrack_nPixelHits ; delete m_GhostTrack_nSCTHits ; delete m_GhostTrack_nTRTHits ; delete m_GhostTrack_nPixelSharedHits ; delete m_GhostTrack_nPixelSplitHits ; delete m_GhostTrack_nInnermostPixelLayerHits ; delete m_GhostTrack_nInnermostPixelLayerSharedHits ; delete m_GhostTrack_nInnermostPixelLayerSplitHits ; delete m_GhostTrack_nNextToInnermostPixelLayerHits ; delete m_GhostTrack_nNextToInnermostPixelLayerSharedHits ; delete m_GhostTrack_nNextToInnermostPixelLayerSplitHits ; } } // constituent if ( m_infoSwitch.m_constituent ) { delete m_numConstituents; } if ( m_infoSwitch.m_constituentAll ) { delete m_constituentWeights; delete m_constituent_pt ; delete m_constituent_eta ; delete m_constituent_phi ; delete m_constituent_e ; } // flavorTag if( m_infoSwitch.m_flavorTag || m_infoSwitch.m_flavorTagHLT || m_infoSwitch.m_flavorTagTLA ) { delete m_HadronConeExclTruthLabelID; delete m_HadronConeExclExtendedTruthLabelID; } if( m_infoSwitch.m_flavorTag || m_infoSwitch.m_flavorTagHLT ) { // flavorTag delete m_DL1r; delete m_DL1r_pu; delete m_DL1r_pc; delete m_DL1r_pb; delete m_DL1dv00; delete m_DL1dv00_pu; delete m_DL1dv00_pc; delete m_DL1dv00_pb; delete m_DL1dv01; delete m_DL1dv01_pu; delete m_DL1dv01_pc; delete m_DL1dv01_pb; delete m_GN1; delete m_GN1_pu; delete m_GN1_pc; delete m_GN1_pb; delete m_GN2v00LegacyWP; delete m_GN2v00LegacyWP_pu; delete m_GN2v00LegacyWP_pc; delete m_GN2v00LegacyWP_pb; delete m_GN2v00NewAliasWP; delete m_GN2v00NewAliasWP_pu; delete m_GN2v00NewAliasWP_pc; delete m_GN2v00NewAliasWP_pb; delete m_GN2v01; delete m_GN2v01_pu; delete m_GN2v01_pc; delete m_GN2v01_pb; delete m_GN2v01_ptau; // Jet Fitter if( m_infoSwitch.m_jetFitterDetails){ delete m_JetFitter_nVTX ; delete m_JetFitter_nSingleTracks ; delete m_JetFitter_nTracksAtVtx ; delete m_JetFitter_mass ; delete m_JetFitter_energyFraction; delete m_JetFitter_significance3d; delete m_JetFitter_deltaeta ; delete m_JetFitter_deltaphi ; delete m_JetFitter_N2Tpar ; } // SV Details if( m_infoSwitch.m_svDetails){ delete m_SV0; delete m_sv0_NGTinSvx ; delete m_sv0_N2Tpair ; delete m_sv0_massvx ; delete m_sv0_efracsvx ; delete m_sv0_normdist ; delete m_SV1; delete m_SV1IP3D; delete m_COMBx; delete m_sv1_pb ; delete m_sv1_pc ; delete m_sv1_c ; delete m_sv1_cu ; delete m_sv1_NGTinSvx ; delete m_sv1_N2Tpair ; delete m_sv1_massvx ; delete m_sv1_efracsvx ; delete m_sv1_normdist ; delete m_sv1_Lxy ; delete m_sv1_sig3d ; delete m_sv1_L3d ; delete m_sv1_distmatlay; delete m_sv1_dR ; } // IP3D if( m_infoSwitch.m_ipDetails){ delete m_IP2D_pu ; delete m_IP2D_pb ; delete m_IP2D_pc ; delete m_IP2D ; delete m_IP2D_c ; delete m_IP2D_cu ; delete m_nIP2DTracks ; delete m_IP2D_gradeOfTracks ; delete m_IP2D_flagFromV0ofTracks; delete m_IP2D_valD0wrtPVofTracks; delete m_IP2D_sigD0wrtPVofTracks; delete m_IP2D_weightBofTracks ; delete m_IP2D_weightCofTracks ; delete m_IP2D_weightUofTracks ; delete m_IP3D; delete m_IP3D_pu ; delete m_IP3D_pb ; delete m_IP3D_pc ; delete m_IP3D_c ; delete m_IP3D_cu ; delete m_nIP3DTracks ; delete m_IP3D_gradeOfTracks ; delete m_IP3D_flagFromV0ofTracks ; delete m_IP3D_valD0wrtPVofTracks ; delete m_IP3D_sigD0wrtPVofTracks ; delete m_IP3D_valZ0wrtPVofTracks ; delete m_IP3D_sigZ0wrtPVofTracks ; delete m_IP3D_weightBofTracks ; delete m_IP3D_weightCofTracks ; delete m_IP3D_weightUofTracks ; } if( m_infoSwitch.m_JVC ) { delete m_JetVertexCharge_discriminant ; } } // flavorTagHLT if( m_infoSwitch.m_flavorTagHLT ) { delete m_vtxOnlineValid ; delete m_vtxHadDummy ; delete m_bs_online_vx ; delete m_bs_online_vy ; delete m_bs_online_vz ; delete m_vtx_offline_x0 ; delete m_vtx_offline_y0 ; delete m_vtx_offline_z0 ; delete m_vtx_online_x0 ; delete m_vtx_online_y0 ; delete m_vtx_online_z0 ; delete m_vtx_online_bkg_x0 ; delete m_vtx_online_bkg_y0 ; delete m_vtx_online_bkg_z0 ; } if( m_infoSwitch.m_flavorTagTLA ) { delete m_fastDIPS; delete m_fastDIPS_pu; delete m_fastDIPS_pc; delete m_fastDIPS_pb; } for(auto btag : m_btags) delete btag; // area if( m_infoSwitch.m_area ) { delete m_GhostArea ; delete m_ActiveArea ; delete m_VoronoiArea ; delete m_ActiveArea4vec_pt ; delete m_ActiveArea4vec_eta ; delete m_ActiveArea4vec_phi ; delete m_ActiveArea4vec_m ; } // truth if ( m_infoSwitch.m_truth && m_mc ) { delete m_ConeTruthLabelID; delete m_TruthCount; delete m_TruthLabelDeltaR_B; delete m_TruthLabelDeltaR_C; delete m_TruthLabelDeltaR_T; delete m_PartonTruthLabelID; delete m_GhostTruthAssociationFraction; delete m_truth_E; delete m_truth_pt; delete m_truth_phi; delete m_truth_eta; } // truth detail if ( m_infoSwitch.m_truthDetails ) { delete m_GhostBHadronsFinalCount ; delete m_GhostBHadronsInitialCount ; delete m_GhostBQuarksFinalCount ; delete m_GhostBHadronsFinalPt ; delete m_GhostBHadronsInitialPt ; delete m_GhostBQuarksFinalPt ; delete m_GhostCHadronsFinalCount ; delete m_GhostCHadronsInitialCount ; delete m_GhostCQuarksFinalCount ; delete m_GhostCHadronsFinalPt ; delete m_GhostCHadronsInitialPt ; delete m_GhostCQuarksFinalPt ; delete m_GhostTausFinalCount ; delete m_GhostTausFinalPt ; delete m_truth_pdgId ; delete m_truth_partonPt ; delete m_truth_partonDR ; } // charge if ( m_infoSwitch.m_charge ) { delete m_charge; } // passSel if ( m_infoSwitch.m_passSel ) { delete m_passSel; } // passOR if ( m_infoSwitch.m_passOR ) { delete m_passOR; } } void JetContainer::setTree(TTree *tree) { // // Connect branches ParticleContainer::setTree(tree); if(m_infoSwitch.m_rapidity) { connectBranch(tree,"rapidity", &m_rapidity); } if ( m_infoSwitch.m_trigger ){ connectBranch (tree, "isTrigMatched", &m_isTrigMatched); connectBranch >(tree, "isTrigMatchedToChain", &m_isTrigMatchedToChain ); connectBranch (tree, "listTrigChains", &m_listTrigChains ); } if(m_infoSwitch.m_clean || m_infoSwitch.m_cleanLight || m_infoSwitch.m_cleanLLP) { if(m_infoSwitch.m_clean){ connectBranch(tree, "Timing", &m_Timing); connectBranch(tree, "LArQuality", &m_LArQuality); connectBranch (tree, "LArBadHVNCell", &m_LArBadHVNCell); connectBranch(tree, "LArQuality", &m_LArQuality); connectBranch(tree, "HECQuality", &m_HECQuality); connectBranch(tree, "NegativeE", &m_NegativeE); connectBranch(tree, "AverageLArQF", &m_AverageLArQF); connectBranch(tree, "BchCorrCell", &m_BchCorrCell); connectBranch(tree, "N90Constituents", &m_N90Constituents); connectBranch(tree, "LArBadHVEnergyFrac", &m_LArBadHVEnergyFrac); connectBranch(tree, "ChargedFraction", &m_ChargedFraction); connectBranch(tree, "OotFracClusters5", &m_OotFracClusters5); connectBranch(tree, "OotFracClusters10", &m_OotFracClusters10); connectBranch(tree, "LeadingClusterPt", &m_LeadingClusterPt); connectBranch(tree, "LeadingClusterSecondLambda", &m_LeadingClusterSecondLambda); connectBranch(tree, "LeadingClusterCenterLambda", &m_LeadingClusterCenterLambda); connectBranch(tree, "LeadingClusterSecondR", &m_LeadingClusterSecondR); if(m_infoSwitch.m_cleanTrig) { connectBranch (tree, "clean_passLooseBadTriggerUgly",&m_clean_passLooseBadTriggerUgly); } else { connectBranch (tree, "clean_passLooseBadUgly", &m_clean_passLooseBadUgly); connectBranch (tree, "clean_passTightBadUgly", &m_clean_passTightBadUgly); } } if(m_infoSwitch.m_cleanTrig) { connectBranch (tree, "clean_passLooseBadTrigger", &m_clean_passLooseBadTrigger); } else { connectBranch (tree, "clean_passLooseBad", &m_clean_passLooseBad); connectBranch (tree, "clean_passTightBad", &m_clean_passTightBad); } if(m_infoSwitch.m_cleanLLP) { connectBranch (tree, "clean_passLooseBadLLP", &m_clean_passLooseBadLLP); } } if(m_infoSwitch.m_timing && !m_infoSwitch.m_clean){ connectBranch(tree, "Timing", &m_Timing); } if(m_infoSwitch.m_energy || m_infoSwitch.m_energyLight ) { if ( m_infoSwitch.m_energy ){ connectBranch(tree, "HECFrac", &m_HECFrac); connectBranch(tree, "CentroidR", &m_CentroidR); connectBranch(tree, "LowEtConstituentsFrac", &m_LowEtConstituentsFrac); } connectBranch(tree, "EMFrac", &m_EMFrac); connectBranch(tree, "FracSamplingMax", &m_FracSamplingMax); connectBranch(tree, "FracSamplingMaxIndex", &m_FracSamplingMaxIndex); connectBranch(tree, "GhostMuonSegmentCount", &m_GhostMuonSegmentCount); connectBranch(tree, "Width", &m_Width); } if(m_infoSwitch.m_trackPV) { connectBranch(tree, "NumTrkPt1000PV", &m_NumTrkPt1000PV); connectBranch(tree, "SumPtTrkPt1000PV", &m_SumPtTrkPt1000PV); connectBranch(tree, "TrackWidthPt1000PV", &m_TrackWidthPt1000PV); connectBranch(tree, "NumTrkPt500PV", &m_NumTrkPt500PV); connectBranch(tree, "SumPtTrkPt500PV", &m_SumPtTrkPt500PV); connectBranch(tree, "TrackWidthPt500PV", &m_TrackWidthPt500PV); connectBranch(tree, "JVFPV", &m_JVFPV); } if(m_infoSwitch.m_trackAll || m_infoSwitch.m_trackPV || m_infoSwitch.m_jvt) { if(m_infoSwitch.m_trackAll || m_infoSwitch.m_trackPV){ connectBranch(tree, "JvtJvfcorr", &m_JvtJvfcorr); connectBranch(tree, "JvtRpt", &m_JvtRpt); } connectBranch(tree, "Jvt", &m_Jvt); } if ( m_infoSwitch.m_chargedPFOPV ) { connectBranch(tree, "SumPtChargedPFOPt500PV", &m_SumPtChargedPFOPt500PV); connectBranch(tree, "fCharged", &m_fCharged); } if(m_infoSwitch.m_JVC) { connectBranch(tree,"JetVertexCharge_discriminant", &m_JetVertexCharge_discriminant); } if(m_infoSwitch.m_flavorTag || m_infoSwitch.m_flavorTagHLT || m_infoSwitch.m_flavorTagTLA) { connectBranch (tree,"HadronConeExclTruthLabelID" ,&m_HadronConeExclTruthLabelID); connectBranch (tree,"HadronConeExclExtendedTruthLabelID",&m_HadronConeExclExtendedTruthLabelID); } if(m_infoSwitch.m_flavorTag || m_infoSwitch.m_flavorTagHLT) { connectBranch(tree,"DL1r" ,&m_DL1r ); connectBranch(tree,"DL1r_pu" ,&m_DL1r_pu ); connectBranch(tree,"DL1r_pc" ,&m_DL1r_pc ); connectBranch(tree,"DL1r_pb" ,&m_DL1r_pb ); connectBranch(tree,"DL1dv00" ,&m_DL1dv00 ); connectBranch(tree,"DL1dv00_pu" ,&m_DL1dv00_pu ); connectBranch(tree,"DL1dv00_pc" ,&m_DL1dv00_pc ); connectBranch(tree,"DL1dv00_pb" ,&m_DL1dv00_pb ); connectBranch(tree,"DL1dv01" ,&m_DL1dv01 ); connectBranch(tree,"DL1dv01_pu" ,&m_DL1dv01_pu ); connectBranch(tree,"DL1dv01_pc" ,&m_DL1dv01_pc ); connectBranch(tree,"DL1dv01_pb" ,&m_DL1dv01_pb ); connectBranch(tree,"GN1" ,&m_GN1 ); connectBranch(tree,"GN1_pu" ,&m_GN1_pu ); connectBranch(tree,"GN1_pc" ,&m_GN1_pc ); connectBranch(tree,"GN1_pb" ,&m_GN1_pb ); connectBranch(tree,"GN2v00LegacyWP" ,&m_GN2v00LegacyWP ); connectBranch(tree,"GN2v00LegacyWP_pu" ,&m_GN2v00LegacyWP_pu ); connectBranch(tree,"GN2v00LegacyWP_pc" ,&m_GN2v00LegacyWP_pc ); connectBranch(tree,"GN2v00LegacyWP_pb" ,&m_GN2v00LegacyWP_pb ); connectBranch(tree,"GN2v00NewAliasWP" ,&m_GN2v00NewAliasWP ); connectBranch(tree,"GN2v00NewAliasWP_pu" ,&m_GN2v00NewAliasWP_pu ); connectBranch(tree,"GN2v00NewAliasWP_pc" ,&m_GN2v00NewAliasWP_pc ); connectBranch(tree,"GN2v00NewAliasWP_pb" ,&m_GN2v00NewAliasWP_pb ); connectBranch(tree,"GN2v01" ,&m_GN2v01 ); connectBranch(tree,"GN2v01_pu" ,&m_GN2v01_pu ); connectBranch(tree,"GN2v01_pc" ,&m_GN2v01_pc ); connectBranch(tree,"GN2v01_pb" ,&m_GN2v01_pb ); connectBranch(tree,"GN2v01_ptau" ,&m_GN2v01_ptau); } if(m_infoSwitch.m_flavorTagHLT) { connectBranch(tree,"vtxHadDummy", &m_vtxHadDummy); connectBranch(tree,"bs_online_vx", &m_bs_online_vx); connectBranch(tree,"bs_online_vy", &m_bs_online_vy); connectBranch(tree,"bs_online_vz", &m_bs_online_vz); connectBranch(tree,"vtx_offline_x0", &m_vtx_offline_x0); connectBranch(tree,"vtx_offline_y0", &m_vtx_offline_y0); connectBranch(tree,"vtx_offline_z0", &m_vtx_offline_z0); connectBranch(tree,"vtx_online_x0", &m_vtx_online_x0); connectBranch(tree,"vtx_online_y0", &m_vtx_online_y0); connectBranch(tree,"vtx_online_z0", &m_vtx_online_z0); connectBranch(tree,"vtx_online_bkg_x0", &m_vtx_online_bkg_x0); connectBranch(tree,"vtx_online_bkg_y0", &m_vtx_online_bkg_y0); connectBranch(tree,"vtx_online_bkg_z0", &m_vtx_online_bkg_z0); } if(m_infoSwitch.m_flavorTagTLA) { connectBranch(tree,"fastDIPS", &m_fastDIPS); connectBranch(tree,"fastDIPS_pu", &m_fastDIPS_pu); connectBranch(tree,"fastDIPS_pc", &m_fastDIPS_pc); connectBranch(tree,"fastDIPS_pb", &m_fastDIPS_pb); } if(m_infoSwitch.m_jetFitterDetails) { connectBranch(tree,"JetFitter_nVTX" , &m_JetFitter_nVTX ); connectBranch(tree,"JetFitter_nSingleTracks" , &m_JetFitter_nSingleTracks ); connectBranch(tree,"JetFitter_nTracksAtVtx" , &m_JetFitter_nTracksAtVtx ); connectBranch(tree,"JetFitter_mass" , &m_JetFitter_mass ); connectBranch(tree,"JetFitter_energyFraction", &m_JetFitter_energyFraction ); connectBranch(tree,"JetFitter_significance3d", &m_JetFitter_significance3d ); connectBranch(tree,"JetFitter_deltaeta" , &m_JetFitter_deltaeta ); connectBranch(tree,"JetFitter_deltaphi" , &m_JetFitter_deltaphi ); connectBranch(tree,"JetFitter_N2Tpair" , &m_JetFitter_N2Tpar ); } if( m_infoSwitch.m_svDetails){ connectBranch(tree, "SV0", &m_SV0); connectBranch(tree, "sv0_NGTinSvx", &m_sv0_NGTinSvx ); connectBranch(tree, "sv0_N2Tpair", &m_sv0_N2Tpair ); connectBranch(tree, "sv0_massvx", &m_sv0_massvx ); connectBranch(tree, "sv0_efracsvx", &m_sv0_efracsvx ); connectBranch(tree, "sv0_normdist", &m_sv0_normdist ); connectBranch(tree, "SV1", &m_SV1); connectBranch(tree, "SV1IP3D", &m_SV1IP3D); connectBranch(tree, "COMBx", &m_COMBx); connectBranch(tree, "sv1_pu", &m_sv1_pu ); connectBranch(tree, "sv1_pb", &m_sv1_pb ); connectBranch(tree, "sv1_pc", &m_sv1_pc ); connectBranch(tree, "sv1_c", &m_sv1_c ); connectBranch(tree, "sv1_cu", &m_sv1_cu ); connectBranch(tree, "sv1_NGTinSvx", &m_sv1_NGTinSvx ); connectBranch(tree, "sv1_N2Tpair", &m_sv1_N2Tpair ); connectBranch(tree, "sv1_massvx", &m_sv1_massvx ); connectBranch(tree, "sv1_efracsvx", &m_sv1_efracsvx ); connectBranch(tree, "sv1_normdist", &m_sv1_normdist ); connectBranch(tree, "sv1_Lxy", &m_sv1_Lxy ); connectBranch(tree, "sv1_sig3d", &m_sv1_sig3d ); connectBranch(tree, "sv1_L3d", &m_sv1_L3d ); connectBranch(tree, "sv1_distmatlay", &m_sv1_distmatlay); connectBranch(tree, "sv1_dR", &m_sv1_dR ); } if( m_infoSwitch.m_ipDetails){ connectBranch (tree, "IP2D_pu", &m_IP2D_pu ); connectBranch (tree, "IP2D_pb", &m_IP2D_pb ); connectBranch (tree, "IP2D_pc", &m_IP2D_pc ); connectBranch (tree, "IP2D", &m_IP2D ); connectBranch (tree, "IP2D_c", &m_IP2D_c ); connectBranch (tree, "IP2D_cu", &m_IP2D_cu ); connectBranch >(tree, "IP2D_gradeOfTracks" , &m_IP2D_gradeOfTracks ); connectBranch >(tree, "IP2D_flagFromV0ofTracks" , &m_IP2D_flagFromV0ofTracks ); connectBranch >(tree, "IP2D_valD0wrtPVofTracks" , &m_IP2D_valD0wrtPVofTracks ); connectBranch >(tree, "IP2D_sigD0wrtPVofTracks" , &m_IP2D_sigD0wrtPVofTracks ); connectBranch >(tree, "IP2D_weightBofTracks" , &m_IP2D_weightBofTracks ); connectBranch >(tree, "IP2D_weightCofTracks" , &m_IP2D_weightCofTracks ); connectBranch >(tree, "IP2D_weightUofTracks" , &m_IP2D_weightUofTracks ); connectBranch (tree, "IP3D", &m_IP3D); connectBranch (tree, "IP3D_pu", &m_IP3D_pu ); connectBranch (tree, "IP3D_pb", &m_IP3D_pb ); connectBranch (tree, "IP3D_pc", &m_IP3D_pc ); connectBranch (tree, "IP3D_c", &m_IP3D_c ); connectBranch (tree, "IP3D_cu", &m_IP3D_cu ); connectBranch >(tree, "IP3D_gradeOfTracks" , &m_IP3D_gradeOfTracks ); connectBranch >(tree, "IP3D_flagFromV0ofTracks" , &m_IP3D_flagFromV0ofTracks ); connectBranch >(tree, "IP3D_valD0wrtPVofTracks" , &m_IP3D_valD0wrtPVofTracks ); connectBranch >(tree, "IP3D_sigD0wrtPVofTracks" , &m_IP3D_sigD0wrtPVofTracks ); connectBranch >(tree, "IP3D_valZ0wrtPVofTracks" , &m_IP3D_valZ0wrtPVofTracks ); connectBranch >(tree, "IP3D_sigZ0wrtPVofTracks" , &m_IP3D_sigZ0wrtPVofTracks ); connectBranch >(tree, "IP3D_weightBofTracks" , &m_IP3D_weightBofTracks ); connectBranch >(tree, "IP3D_weightCofTracks" , &m_IP3D_weightCofTracks ); connectBranch >(tree, "IP3D_weightUofTracks" , &m_IP3D_weightUofTracks ); } for(auto btag : m_btags) btag->setTree(tree, m_name); // truth if(m_infoSwitch.m_truth) { connectBranch (tree,"ConeTruthLabelID", &m_ConeTruthLabelID); connectBranch (tree,"TruthCount", &m_TruthCount); connectBranch(tree,"TruthLabelDeltaR_B", &m_TruthLabelDeltaR_B); connectBranch(tree,"TruthLabelDeltaR_C", &m_TruthLabelDeltaR_C); connectBranch(tree,"TruthLabelDeltaR_T", &m_TruthLabelDeltaR_T); connectBranch (tree,"PartonTruthLabelID", &m_PartonTruthLabelID); connectBranch(tree,"GhostTruthAssociationFraction", &m_GhostTruthAssociationFraction); connectBranch(tree,"truth_E", &m_truth_E); connectBranch(tree,"truth_pt", &m_truth_pt); connectBranch(tree,"truth_phi", &m_truth_phi); connectBranch(tree,"truth_eta", &m_truth_eta); } // charge if(m_infoSwitch.m_charge) { connectBranch(tree,"charge", &m_charge); } // passSel if(m_infoSwitch.m_passSel) connectBranch(tree,"passSel", &m_passSel); // passOR if(m_infoSwitch.m_passOR) connectBranch(tree,"passOR", &m_passOR); } void JetContainer::updateParticle(uint idx, Jet& jet) { if(m_debug) std::cout << "in JetContainer::updateParticle " << std::endl; ParticleContainer::updateParticle(idx,jet); if(m_infoSwitch.m_rapidity) { jet.rapidity =m_rapidity ->at(idx); } // trigger if ( m_infoSwitch.m_trigger ) { jet.isTrigMatched = m_isTrigMatched ->at(idx); jet.isTrigMatchedToChain = m_isTrigMatchedToChain ->at(idx); jet.listTrigChains = m_listTrigChains ->at(idx); } if(m_infoSwitch.m_clean || m_infoSwitch.m_cleanLight || m_infoSwitch.m_cleanLLP) { if(m_debug) std::cout << "updating clean " << std::endl; if(m_infoSwitch.m_clean){ jet.Timing =m_Timing ->at(idx); jet.LArQuality =m_LArQuality ->at(idx); jet.HECQuality =m_HECQuality ->at(idx); jet.NegativeE =m_NegativeE ->at(idx); jet.AverageLArQF =m_AverageLArQF ->at(idx); jet.BchCorrCell =m_BchCorrCell ->at(idx); jet.N90Constituents =m_N90Constituents ->at(idx); jet.LArBadHVEFrac =m_LArBadHVEnergyFrac ->at(idx); jet.LArBadHVNCell =m_LArBadHVNCell ->at(idx); jet.ChargedFraction =m_ChargedFraction ->at(idx); jet.OotFracClusters5 =m_OotFracClusters5 ->at(idx); jet.OotFracClusters10 =m_OotFracClusters10 ->at(idx); jet.LeadingClusterPt =m_LeadingClusterPt ->at(idx); jet.LeadingClusterSecondLambda=m_LeadingClusterSecondLambda->at(idx); jet.LeadingClusterCenterLambda=m_LeadingClusterCenterLambda->at(idx); jet.LeadingClusterSecondR =m_LeadingClusterSecondR ->at(idx); if(m_infoSwitch.m_cleanTrig) { jet.clean_passLooseBadTriggerUgly =m_clean_passLooseBadTriggerUgly ->at(idx); } else { jet.clean_passLooseBadUgly =m_clean_passLooseBadUgly ->at(idx); jet.clean_passTightBadUgly =m_clean_passTightBadUgly ->at(idx); } } if(m_infoSwitch.m_cleanTrig) { jet.clean_passLooseBadTrigger =m_clean_passLooseBadTrigger ->at(idx); } else { jet.clean_passLooseBad =m_clean_passLooseBad ->at(idx); jet.clean_passTightBad =m_clean_passTightBad ->at(idx); } if(m_infoSwitch.m_cleanLLP) { jet.clean_passLooseBadLLP =m_clean_passLooseBadLLP ->at(idx); } } if(m_infoSwitch.m_timing && !m_infoSwitch.m_clean){ jet.Timing = m_Timing->at(idx); } if(m_infoSwitch.m_energy || m_infoSwitch.m_energyLight) { if(m_debug) std::cout << "updating energy " << std::endl; if ( m_infoSwitch.m_energy ){ jet.HECFrac =m_HECFrac ->at(idx); jet.CentroidR =m_CentroidR ->at(idx); jet.LowEtConstituentsFrac=m_LowEtConstituentsFrac->at(idx); } jet.EMFrac =m_EMFrac ->at(idx); jet.FracSamplingMax =m_FracSamplingMax ->at(idx); jet.FracSamplingMaxIndex =m_FracSamplingMaxIndex ->at(idx); jet.GhostMuonSegmentCount=m_GhostMuonSegmentCount->at(idx); jet.Width =m_Width ->at(idx); } if(m_infoSwitch.m_trackPV) { jet.NumTrkPt1000PV =m_NumTrkPt1000PV ->at(idx); jet.SumPtTrkPt1000PV =m_SumPtTrkPt1000PV ->at(idx); jet.TrackWidthPt1000PV=m_TrackWidthPt1000PV->at(idx); jet.NumTrkPt500PV =m_NumTrkPt500PV ->at(idx); jet.SumPtTrkPt500PV =m_SumPtTrkPt500PV ->at(idx); jet.TrackWidthPt500PV =m_TrackWidthPt500PV ->at(idx); jet.JVFPV =m_JVFPV ->at(idx); } if(m_infoSwitch.m_trackPV || m_infoSwitch.m_trackAll || m_infoSwitch.m_jvt) { if(m_infoSwitch.m_trackPV || m_infoSwitch.m_trackAll){ jet.JvtJvfcorr=m_JvtJvfcorr->at(idx); jet.JvtRpt =m_JvtRpt ->at(idx); } jet.Jvt =m_Jvt ->at(idx); } if ( m_infoSwitch.m_chargedPFOPV ) { jet.SumPtChargedPFOPt500PV=m_SumPtChargedPFOPt500PV->at(idx); jet.fCharged=m_fCharged->at(idx); } if( m_infoSwitch.m_JVC ) { if(m_debug) std::cout << "updating JVC " << std::endl; if(m_debug) std::cout << m_JetVertexCharge_discriminant->size() << std::endl; jet.JVC = m_JetVertexCharge_discriminant->at(idx); } if(m_infoSwitch.m_flavorTag || m_infoSwitch.m_flavorTagHLT || m_infoSwitch.m_flavorTagTLA) { if(m_HadronConeExclTruthLabelID) jet.HadronConeExclTruthLabelID =m_HadronConeExclTruthLabelID ->at(idx); if(m_HadronConeExclExtendedTruthLabelID) jet.HadronConeExclExtendedTruthLabelID=m_HadronConeExclExtendedTruthLabelID->at(idx); } if(m_infoSwitch.m_flavorTag || m_infoSwitch.m_flavorTagHLT) { if(m_debug) std::cout << "updating flavorTag " << std::endl; if(m_DL1r) jet.DL1r =m_DL1r ->at(idx); if(m_DL1r_pu) jet.DL1r_pu =m_DL1r_pu ->at(idx); if(m_DL1r_pc) jet.DL1r_pc =m_DL1r_pc ->at(idx); if(m_DL1r_pb) jet.DL1r_pb =m_DL1r_pb ->at(idx); if(m_DL1dv00) jet.DL1dv00 =m_DL1dv00 ->at(idx); if(m_DL1dv00_pu) jet.DL1dv00_pu =m_DL1dv00_pu ->at(idx); if(m_DL1dv00_pc) jet.DL1dv00_pc =m_DL1dv00_pc ->at(idx); if(m_DL1dv00_pb) jet.DL1dv00_pb =m_DL1dv00_pb ->at(idx); if(m_DL1dv01) jet.DL1dv01 =m_DL1dv01 ->at(idx); if(m_DL1dv01_pu) jet.DL1dv01_pu =m_DL1dv01_pu ->at(idx); if(m_DL1dv01_pc) jet.DL1dv01_pc =m_DL1dv01_pc ->at(idx); if(m_DL1dv01_pb) jet.DL1dv01_pb =m_DL1dv01_pb ->at(idx); if(m_GN1) jet.GN1 =m_GN1 ->at(idx); if(m_GN1_pu) jet.GN1_pu =m_GN1_pu ->at(idx); if(m_GN1_pc) jet.GN1_pc =m_GN1_pc ->at(idx); if(m_GN1_pb) jet.GN1_pb =m_GN1_pb ->at(idx); if(m_GN2v00LegacyWP) jet.GN2v00LegacyWP =m_GN2v00LegacyWP ->at(idx); if(m_GN2v00LegacyWP_pu) jet.GN2v00LegacyWP_pu =m_GN2v00LegacyWP_pu ->at(idx); if(m_GN2v00LegacyWP_pc) jet.GN2v00LegacyWP_pc =m_GN2v00LegacyWP_pc ->at(idx); if(m_GN2v00LegacyWP_pb) jet.GN2v00LegacyWP_pb =m_GN2v00LegacyWP_pb ->at(idx); if(m_GN2v00NewAliasWP) jet.GN2v00NewAliasWP =m_GN2v00NewAliasWP ->at(idx); if(m_GN2v00NewAliasWP_pu) jet.GN2v00NewAliasWP_pu =m_GN2v00NewAliasWP_pu ->at(idx); if(m_GN2v00NewAliasWP_pc) jet.GN2v00NewAliasWP_pc =m_GN2v00NewAliasWP_pc ->at(idx); if(m_GN2v00NewAliasWP_pb) jet.GN2v00NewAliasWP_pb =m_GN2v00NewAliasWP_pb ->at(idx); if(m_GN2v01) jet.GN2v01 =m_GN2v01 ->at(idx); if(m_GN2v01_pu) jet.GN2v01_pu =m_GN2v01_pu ->at(idx); if(m_GN2v01_pc) jet.GN2v01_pc =m_GN2v01_pc ->at(idx); if(m_GN2v01_pb) jet.GN2v01_pb =m_GN2v01_pb ->at(idx); if(m_GN2v01_ptau) jet.GN2v01_ptau =m_GN2v01_ptau ->at(idx); //std::cout << m_HadronConeExclTruthLabelID->size() << std::endl; if(m_debug) std::cout << "leave flavorTag " << std::endl; } if(m_infoSwitch.m_flavorTagHLT) { if(m_debug) std::cout << "updating flavorTagHLT " << std::endl; jet.bs_online_vx =m_bs_online_vx ->at(idx); jet.bs_online_vy =m_bs_online_vy ->at(idx); jet.bs_online_vz =m_bs_online_vz ->at(idx); jet.vtxHadDummy =m_vtxHadDummy ->at(idx); jet.vtx_offline_x0 =m_vtx_offline_x0 ->at(idx); jet.vtx_offline_y0 =m_vtx_offline_y0 ->at(idx); jet.vtx_offline_z0 =m_vtx_offline_z0 ->at(idx); jet.vtx_online_x0 =m_vtx_online_x0 ->at(idx); jet.vtx_online_y0 =m_vtx_online_y0 ->at(idx); jet.vtx_online_z0 =m_vtx_online_z0 ->at(idx); jet.vtx_online_bkg_x0 =m_vtx_online_bkg_x0 ->at(idx); jet.vtx_online_bkg_y0 =m_vtx_online_bkg_y0 ->at(idx); jet.vtx_online_bkg_z0 =m_vtx_online_bkg_z0 ->at(idx); } if(m_infoSwitch.m_jetFitterDetails) { jet.JetFitter_nVTX =m_JetFitter_nVTX ->at(idx); jet.JetFitter_nSingleTracks =m_JetFitter_nSingleTracks ->at(idx); jet.JetFitter_nTracksAtVtx =m_JetFitter_nTracksAtVtx ->at(idx); jet.JetFitter_mass =m_JetFitter_mass ->at(idx); jet.JetFitter_energyFraction =m_JetFitter_energyFraction ->at(idx); jet.JetFitter_significance3d =m_JetFitter_significance3d ->at(idx); jet.JetFitter_deltaeta =m_JetFitter_deltaeta ->at(idx); jet.JetFitter_deltaphi =m_JetFitter_deltaphi ->at(idx); jet.JetFitter_N2Tpar =m_JetFitter_N2Tpar ->at(idx); } if(m_infoSwitch.m_flavorTagTLA) { if(m_debug) std::cout << "updating flavorTagTLA " << std::endl; if(m_fastDIPS) jet.fastDIPS =m_fastDIPS ->at(idx); if(m_fastDIPS_pu) jet.fastDIPS_pu =m_fastDIPS_pu ->at(idx); if(m_fastDIPS_pc) jet.fastDIPS_pc =m_fastDIPS_pc ->at(idx); if(m_fastDIPS_pb) jet.fastDIPS_pb =m_fastDIPS_pb ->at(idx); if(m_debug) std::cout << "leave flavorTagTLA " << std::endl; } if(m_infoSwitch.m_svDetails){ jet.SV0 = m_SV0 ->at(idx); jet.sv0_NGTinSvx = m_sv0_NGTinSvx ->at(idx); jet.sv0_N2Tpair = m_sv0_N2Tpair ->at(idx); jet.sv0_massvx = m_sv0_massvx ->at(idx); jet.sv0_efracsvx = m_sv0_efracsvx ->at(idx); jet.sv0_normdist = m_sv0_normdist ->at(idx); jet.SV1 = m_SV1 ->at(idx); jet.SV1IP3D = m_SV1IP3D ->at(idx); jet.COMBx = m_COMBx ->at(idx); jet.sv1_pu = m_sv1_pu ->at(idx); jet.sv1_pb = m_sv1_pb ->at(idx); jet.sv1_pc = m_sv1_pc ->at(idx); jet.sv1_c = m_sv1_c ->at(idx); jet.sv1_cu = m_sv1_cu ->at(idx); jet.sv1_NGTinSvx = m_sv1_NGTinSvx ->at(idx); jet.sv1_N2Tpair = m_sv1_N2Tpair ->at(idx); jet.sv1_massvx = m_sv1_massvx ->at(idx); jet.sv1_efracsvx = m_sv1_efracsvx ->at(idx); jet.sv1_normdist = m_sv1_normdist ->at(idx); jet.sv1_Lxy = m_sv1_Lxy ->at(idx); if(m_sv1_sig3d->size()) jet.sv1_sig3d = m_sv1_sig3d ->at(idx); jet.sv1_L3d = m_sv1_L3d ->at(idx); jet.sv1_distmatlay = m_sv1_distmatlay->at(idx); jet.sv1_dR = m_sv1_dR ->at(idx); } if(m_infoSwitch.m_ipDetails){ jet.IP2D_pu = m_IP2D_pu ->at(idx); jet.IP2D_pb = m_IP2D_pb ->at(idx); jet.IP2D_pc = m_IP2D_pc ->at(idx); jet.IP2D = m_IP2D ->at(idx); jet.IP2D_c = m_IP2D_c ->at(idx); jet.IP2D_cu = m_IP2D_cu ->at(idx); jet.nIP2DTracks = m_IP2D_gradeOfTracks ->at(idx).size(); jet.IP2D_gradeOfTracks = m_IP2D_gradeOfTracks ->at(idx); jet.IP2D_flagFromV0ofTracks = m_IP2D_flagFromV0ofTracks ->at(idx); jet.IP2D_valD0wrtPVofTracks = m_IP2D_valD0wrtPVofTracks ->at(idx); jet.IP2D_sigD0wrtPVofTracks = m_IP2D_sigD0wrtPVofTracks ->at(idx); jet.IP2D_weightBofTracks = m_IP2D_weightBofTracks ->at(idx); jet.IP2D_weightCofTracks = m_IP2D_weightCofTracks ->at(idx); jet.IP2D_weightUofTracks = m_IP2D_weightUofTracks ->at(idx); jet.IP3D = m_IP3D ->at(idx); jet.IP3D_pu = m_IP3D_pu ->at(idx); jet.IP3D_pb = m_IP3D_pb ->at(idx); jet.IP3D_pc = m_IP3D_pc ->at(idx); jet.IP3D_c = m_IP3D_c ->at(idx); jet.IP3D_cu = m_IP3D_cu ->at(idx); jet.nIP3DTracks = m_IP3D_gradeOfTracks ->at(idx).size(); jet.IP3D_gradeOfTracks = m_IP3D_gradeOfTracks ->at(idx); jet.IP3D_flagFromV0ofTracks = m_IP3D_flagFromV0ofTracks ->at(idx); jet.IP3D_valD0wrtPVofTracks = m_IP3D_valD0wrtPVofTracks ->at(idx); jet.IP3D_sigD0wrtPVofTracks = m_IP3D_sigD0wrtPVofTracks ->at(idx); jet.IP3D_valZ0wrtPVofTracks = m_IP3D_valZ0wrtPVofTracks ->at(idx); jet.IP3D_sigZ0wrtPVofTracks = m_IP3D_sigZ0wrtPVofTracks ->at(idx); jet.IP3D_weightBofTracks = m_IP3D_weightBofTracks ->at(idx); jet.IP3D_weightCofTracks = m_IP3D_weightCofTracks ->at(idx); jet.IP3D_weightUofTracks = m_IP3D_weightUofTracks ->at(idx); } static const std::vector dummy1 = {1.}; for(btagOpPoint* btag : m_btags) { switch(btag->m_op) { case Jet::BTaggerOP::DL1r_FixedCutBEff_60: jet.is_DL1r_FixedCutBEff_60= btag->m_isTag->at(idx); jet.SF_DL1r_FixedCutBEff_60=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::DL1r_FixedCutBEff_70: jet.is_DL1r_FixedCutBEff_70= btag->m_isTag->at(idx); jet.SF_DL1r_FixedCutBEff_70=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::DL1r_FixedCutBEff_77: jet.is_DL1r_FixedCutBEff_77= btag->m_isTag->at(idx); jet.SF_DL1r_FixedCutBEff_77=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::DL1r_FixedCutBEff_85: jet.is_DL1r_FixedCutBEff_85= btag->m_isTag->at(idx); jet.SF_DL1r_FixedCutBEff_85=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::DL1r_Continuous: jet.is_DL1r_Continuous= btag->m_isTag->at(idx); jet.SF_DL1r_Continuous=(m_mc)?btag->m_sf ->at(idx):dummy1; break; //DL1dv01 has preliminary rel22 pre-rec SF uncertainties case Jet::BTaggerOP::DL1dv01_FixedCutBEff_60: jet.is_DL1dv01_FixedCutBEff_60= btag->m_isTag->at(idx); jet.SF_DL1dv01_FixedCutBEff_60=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::DL1dv01_FixedCutBEff_70: jet.is_DL1dv01_FixedCutBEff_70= btag->m_isTag->at(idx); jet.SF_DL1dv01_FixedCutBEff_70=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::DL1dv01_FixedCutBEff_77: jet.is_DL1dv01_FixedCutBEff_77= btag->m_isTag->at(idx); jet.SF_DL1dv01_FixedCutBEff_77=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::DL1dv01_FixedCutBEff_85: jet.is_DL1dv01_FixedCutBEff_85= btag->m_isTag->at(idx); jet.SF_DL1dv01_FixedCutBEff_85=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::DL1dv01_Continuous: jet.is_DL1dv01_Continuous= btag->m_isTag->at(idx); jet.SF_DL1dv01_Continuous=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::DL1dv00_FixedCutBEff_60: jet.is_DL1dv00_FixedCutBEff_60= btag->m_isTag->at(idx); jet.SF_DL1dv00_FixedCutBEff_60=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::DL1dv00_FixedCutBEff_70: jet.is_DL1dv00_FixedCutBEff_70= btag->m_isTag->at(idx); jet.SF_DL1dv00_FixedCutBEff_70=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::DL1dv00_FixedCutBEff_77: jet.is_DL1dv00_FixedCutBEff_77= btag->m_isTag->at(idx); jet.SF_DL1dv00_FixedCutBEff_77=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::DL1dv00_FixedCutBEff_85: jet.is_DL1dv00_FixedCutBEff_85= btag->m_isTag->at(idx); jet.SF_DL1dv00_FixedCutBEff_85=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::DL1dv00_Continuous: jet.is_DL1dv00_Continuous= btag->m_isTag->at(idx); jet.SF_DL1dv00_Continuous=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::GN120220509_FixedCutBEff_60: jet.is_GN120220509_FixedCutBEff_60= btag->m_isTag->at(idx); jet.SF_GN120220509_FixedCutBEff_60=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::GN120220509_FixedCutBEff_70: jet.is_GN120220509_FixedCutBEff_70= btag->m_isTag->at(idx); jet.SF_GN120220509_FixedCutBEff_70=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::GN120220509_FixedCutBEff_77: jet.is_GN120220509_FixedCutBEff_77= btag->m_isTag->at(idx); jet.SF_GN120220509_FixedCutBEff_77=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::GN120220509_FixedCutBEff_85: jet.is_GN120220509_FixedCutBEff_85= btag->m_isTag->at(idx); jet.SF_GN120220509_FixedCutBEff_85=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::GN120220509_Continuous: jet.is_GN120220509_Continuous= btag->m_isTag->at(idx); jet.SF_GN120220509_Continuous=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::GN2v00LegacyWP_FixedCutBEff_60: jet.is_GN2v00LegacyWP_FixedCutBEff_60= btag->m_isTag->at(idx); jet.SF_GN2v00LegacyWP_FixedCutBEff_60=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::GN2v00LegacyWP_FixedCutBEff_70: jet.is_GN2v00LegacyWP_FixedCutBEff_70= btag->m_isTag->at(idx); jet.SF_GN2v00LegacyWP_FixedCutBEff_70=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::GN2v00LegacyWP_FixedCutBEff_77: jet.is_GN2v00LegacyWP_FixedCutBEff_77= btag->m_isTag->at(idx); jet.SF_GN2v00LegacyWP_FixedCutBEff_77=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::GN2v00LegacyWP_FixedCutBEff_85: jet.is_GN2v00LegacyWP_FixedCutBEff_85= btag->m_isTag->at(idx); jet.SF_GN2v00LegacyWP_FixedCutBEff_85=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::GN2v00NewAliasWP_FixedCutBEff_60: jet.is_GN2v00NewAliasWP_FixedCutBEff_60= btag->m_isTag->at(idx); jet.SF_GN2v00NewAliasWP_FixedCutBEff_60=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::GN2v00NewAliasWP_FixedCutBEff_70: jet.is_GN2v00NewAliasWP_FixedCutBEff_70= btag->m_isTag->at(idx); jet.SF_GN2v00NewAliasWP_FixedCutBEff_70=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::GN2v00NewAliasWP_FixedCutBEff_77: jet.is_GN2v00NewAliasWP_FixedCutBEff_77= btag->m_isTag->at(idx); jet.SF_GN2v00NewAliasWP_FixedCutBEff_77=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::GN2v00NewAliasWP_FixedCutBEff_85: jet.is_GN2v00NewAliasWP_FixedCutBEff_85= btag->m_isTag->at(idx); jet.SF_GN2v00NewAliasWP_FixedCutBEff_85=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::GN2v01_FixedCutBEff_65: jet.is_GN2v01_FixedCutBEff_65= btag->m_isTag->at(idx); jet.SF_GN2v01_FixedCutBEff_65=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::GN2v01_FixedCutBEff_70: jet.is_GN2v01_FixedCutBEff_70= btag->m_isTag->at(idx); jet.SF_GN2v01_FixedCutBEff_70=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::GN2v01_FixedCutBEff_77: jet.is_GN2v01_FixedCutBEff_77= btag->m_isTag->at(idx); jet.SF_GN2v01_FixedCutBEff_77=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::GN2v01_FixedCutBEff_85: jet.is_GN2v01_FixedCutBEff_85= btag->m_isTag->at(idx); jet.SF_GN2v01_FixedCutBEff_85=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::GN2v01_FixedCutBEff_90: jet.is_GN2v01_FixedCutBEff_90= btag->m_isTag->at(idx); jet.SF_GN2v01_FixedCutBEff_90=(m_mc)?btag->m_sf ->at(idx):dummy1; break; case Jet::BTaggerOP::GN2v01_Continuous: jet.is_GN2v01_Continuous= btag->m_isTag->at(idx); jet.SF_GN2v01_Continuous=(m_mc)?btag->m_sf ->at(idx):dummy1; break; default: throw std::domain_error( __FILE__ + std::string(", in ") + __func__ + ": " + "unexpected value of btag->m_op (of type xAH::Jet::BTaggerOP)"); } } // truth if(m_infoSwitch.m_truth) { jet.ConeTruthLabelID =m_ConeTruthLabelID->at(idx); jet.TruthCount =m_TruthCount ->at(idx); jet.TruthLabelDeltaR_B=m_TruthLabelDeltaR_B->at(idx); jet.TruthLabelDeltaR_C=m_TruthLabelDeltaR_C->at(idx); jet.TruthLabelDeltaR_T=m_TruthLabelDeltaR_T->at(idx); jet.PartonTruthLabelID=m_PartonTruthLabelID->at(idx); jet.GhostTruthAssociationFraction= m_GhostTruthAssociationFraction->at(idx); jet.truth_p4.SetPtEtaPhiE(m_truth_pt ->at(idx), m_truth_eta->at(idx), m_truth_phi->at(idx), m_truth_E ->at(idx)); } // charge if(m_infoSwitch.m_charge) { jet.charge=m_charge->at(idx); } // passSel if(m_infoSwitch.m_passSel) jet.passSel=m_passSel->at(idx); // passOR if(m_infoSwitch.m_passOR) jet.passOR=m_passOR->at(idx); if(m_debug) std::cout << "leave JetContainer::updateParticle " << std::endl; return; } void JetContainer::setBranches(TTree *tree) { ParticleContainer::setBranches(tree); if ( m_infoSwitch.m_rapidity ) { setBranch(tree,"rapidity", m_rapidity ); } if ( m_infoSwitch.m_trigger ){ // this is true if there's a match for at least one trigger chain setBranch(tree,"isTrigMatched", m_isTrigMatched); // a vector of trigger match decision for each jet trigger chain setBranch >(tree,"isTrigMatchedToChain", m_isTrigMatchedToChain ); // a vector of strings for each jet trigger chain - 1:1 correspondence w/ vector above setBranch(tree, "listTrigChains", m_listTrigChains ); } if( m_infoSwitch.m_clean || m_infoSwitch.m_cleanLight || m_infoSwitch.m_cleanLLP) { if(m_infoSwitch.m_clean){ setBranch(tree,"Timing", m_Timing ); setBranch(tree,"LArQuality", m_LArQuality ); setBranch(tree,"HECQuality", m_HECQuality ); setBranch(tree,"NegativeE", m_NegativeE ); setBranch(tree,"AverageLArQF", m_AverageLArQF ); setBranch(tree,"BchCorrCell", m_BchCorrCell ); setBranch(tree,"N90Constituents", m_N90Constituents ); setBranch(tree,"LArBadHVEnergyFrac", m_LArBadHVEnergyFrac ); setBranch (tree,"LArBadHVNCell", m_LArBadHVNCell ); setBranch(tree,"ChargedFraction", m_ChargedFraction); setBranch(tree,"OotFracClusters5", m_OotFracClusters5 ); setBranch(tree,"OotFracClusters10", m_OotFracClusters10 ); setBranch(tree,"LeadingClusterPt", m_LeadingClusterPt ); setBranch(tree,"LeadingClusterSecondLambda", m_LeadingClusterSecondLambda ); setBranch(tree,"LeadingClusterCenterLambda", m_LeadingClusterCenterLambda ); setBranch(tree,"LeadingClusterSecondR", m_LeadingClusterSecondR ); if(m_infoSwitch.m_cleanTrig) { setBranch (tree,"clean_passLooseBadTriggerUgly", m_clean_passLooseBadTriggerUgly ); } else { setBranch (tree,"clean_passLooseBadUgly", m_clean_passLooseBadUgly ); setBranch (tree,"clean_passTightBadUgly", m_clean_passTightBadUgly ); } } if(m_infoSwitch.m_cleanTrig) { setBranch (tree,"clean_passLooseBadTrigger", m_clean_passLooseBadTrigger ); } else { setBranch (tree,"clean_passLooseBad", m_clean_passLooseBad ); setBranch (tree,"clean_passTightBad", m_clean_passTightBad ); } if(m_infoSwitch.m_cleanLLP) { setBranch (tree,"clean_passLooseBadLLP", m_clean_passLooseBadLLP ); } } if(m_infoSwitch.m_timing && !m_infoSwitch.m_clean){ setBranch(tree,"Timing",m_Timing); } if ( m_infoSwitch.m_energy || m_infoSwitch.m_energyLight ) { if ( m_infoSwitch.m_energy ){ setBranch(tree,"HECFrac", m_HECFrac ); setBranch(tree,"CentroidR", m_CentroidR ); setBranch(tree,"LowEtConstituentsFrac", m_LowEtConstituentsFrac ); } setBranch(tree,"EMFrac", m_EMFrac ); setBranch(tree,"FracSamplingMax", m_FracSamplingMax ); setBranch(tree,"FracSamplingMaxIndex", m_FracSamplingMaxIndex ); setBranch(tree,"GhostMuonSegmentCount", m_GhostMuonSegmentCount ); setBranch(tree,"Width", m_Width ); } if ( m_infoSwitch.m_scales ) { setBranch(tree,"emScalePt", m_emScalePt ); setBranch(tree,"constScalePt", m_constScalePt ); setBranch(tree,"pileupScalePt", m_pileupScalePt ); setBranch(tree,"originConstitScalePt", m_originConstitScalePt ); setBranch(tree,"etaJESScalePt", m_etaJESScalePt ); setBranch(tree,"gscScalePt", m_gscScalePt ); setBranch(tree,"jmsScalePt", m_jmsScalePt ); setBranch(tree,"insituScalePt", m_insituScalePt ); setBranch(tree,"emScaleM", m_emScaleM ); setBranch(tree,"constScaleM", m_constScaleM ); setBranch(tree,"pileupScaleM", m_pileupScaleM ); setBranch(tree,"originConstitScaleM", m_originConstitScaleM ); setBranch(tree,"etaJESScaleM", m_etaJESScaleM ); setBranch(tree,"gscScaleM", m_gscScaleM ); setBranch(tree,"jmsScaleM", m_jmsScaleM ); setBranch(tree,"insituScaleM", m_insituScaleM ); } if ( m_infoSwitch.m_constscaleEta ) { setBranch(tree,"constScaleEta", m_constScaleEta ); } if ( m_infoSwitch.m_detectorEta ) { setBranch(tree,"detectorEta", m_detectorEta ); } if ( m_infoSwitch.m_layer ) { setBranch >(tree,"EnergyPerSampling", m_EnergyPerSampling ); } if ( m_infoSwitch.m_trackAll ) { setBranch >(tree,"NumTrkPt1000", m_NumTrkPt1000 ); setBranch >(tree,"SumPtTrkPt1000", m_SumPtTrkPt1000 ); setBranch >(tree,"TrackWidthPt1000", m_TrackWidthPt1000 ); setBranch >(tree,"NumTrkPt500", m_NumTrkPt500 ); setBranch >(tree,"SumPtTrkPt500", m_SumPtTrkPt500 ); setBranch >(tree,"TrackWidthPt500", m_TrackWidthPt500 ); setBranch >(tree,"JVF", m_JVF ); } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_jvt ) { if ( m_infoSwitch.m_trackPV ) { setBranch(tree,"NumTrkPt1000PV", m_NumTrkPt1000PV ); setBranch(tree,"SumPtTrkPt1000PV", m_SumPtTrkPt1000PV ); setBranch(tree,"TrackWidthPt1000PV", m_TrackWidthPt1000PV ); setBranch(tree,"NumTrkPt500PV", m_NumTrkPt500PV ); setBranch(tree,"SumPtTrkPt500PV", m_SumPtTrkPt500PV ); setBranch(tree,"TrackWidthPt500PV", m_TrackWidthPt500PV ); setBranch(tree,"JVFPV", m_JVFPV ); setBranch(tree,"JvtJvfcorr", m_JvtJvfcorr ); setBranch(tree,"JvtRpt", m_JvtRpt ); } setBranch(tree,"Jvt", m_Jvt ); //setBranch(tree,"GhostTrackAssociationFraction", m_ghostTrackAssFrac); } if (m_infoSwitch.m_fJvt) { setBranch(tree, "fJvt", m_fJvt); } if (m_infoSwitch.m_NNJvt) { setBranch(tree, "NNJvt", m_NNJvt); setBranch(tree, "NNJvtPass", m_NNJvtPass); } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sfJVTName == "Loose" ) { setBranch(tree,"JvtPass_Loose", m_JvtPass_Loose ); if ( m_mc ) { setBranch >(tree,"JvtEff_SF_Loose", m_JvtEff_SF_Loose ); } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sfJVTName == "Medium" ) { setBranch(tree,"JvtPass_Medium", m_JvtPass_Medium ); if ( m_mc ) { setBranch >(tree,"JvtEff_SF_Medium", m_JvtEff_SF_Medium ); } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sfJVTName == "Tight" ) { setBranch(tree,"JvtPass_Tight", m_JvtPass_Tight ); if ( m_mc ) { setBranch >(tree,"JvtEff_SF_Tight", m_JvtEff_SF_Tight ); } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sfJVTName == "FixedEffPt" ) { setBranch(tree,"JvtPass_FixedEffPt", m_JvtPass_FixedEffPt ); if ( m_mc ) { setBranch >(tree,"JvtEff_SF_FixedEffPt", m_JvtEff_SF_FixedEffPt ); } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sfJVTName == "TightFwd" ) { setBranch(tree,"JvtPass_TightFwd", m_JvtPass_TightFwd ); if ( m_mc ) { setBranch >(tree,"JvtEff_SF_TightFwd", m_JvtEff_SF_TightFwd ); } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sffJVTName == "Loose" ) { setBranch(tree,"fJvtPass_Loose", m_fJvtPass_Loose ); if ( m_mc ) { setBranch >(tree,"fJvtEff_SF_Loose", m_fJvtEff_SF_Loose ); } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sffJVTName == "Medium" ) { setBranch(tree,"fJvtPass_Medium", m_fJvtPass_Medium ); if ( m_mc ) { setBranch >(tree,"fJvtEff_SF_Medium", m_fJvtEff_SF_Medium ); } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sffJVTName == "Tight" ) { setBranch(tree,"fJvtPass_Tight", m_fJvtPass_Tight ); if ( m_mc ) { setBranch >(tree,"fJvtEff_SF_Tight", m_fJvtEff_SF_Tight ); } } if ( m_infoSwitch.m_chargedPFOPV ) { setBranch(tree,"SumPtChargedPFOPt500PV", m_SumPtChargedPFOPt500PV); setBranch(tree,"fCharged", m_fCharged); } if ( m_infoSwitch.m_allTrack ) { // if want to apply the selection of the PV then need to setup track selection tool // this applies the JVF/JVT selection cuts // https://twiki.cern.ch/twiki/bin/view/AtlasProtected/JvtManualRecalculation if( m_infoSwitch.m_allTrackPVSel ) { m_trkSelTool = new InDet::InDetTrackSelectionTool( "JetTrackSelection"); m_trkSelTool->setProperty( "CutLevel", "Loose"); m_trkSelTool->initialize(); // to do this need to have AddJets return a status code //ANA_CHECK( m_trkSelTool->initialize()); } setBranch(tree,"GhostTrackCount", m_GhostTrackCount ); setBranch(tree,"GhostTrackPt", m_GhostTrackPt ); setBranch >(tree,"GhostTrack_pt", m_GhostTrack_pt ); setBranch >(tree,"GhostTrack_qOverP",m_GhostTrack_qOverP); setBranch >(tree,"GhostTrack_eta", m_GhostTrack_eta ); setBranch >(tree,"GhostTrack_phi", m_GhostTrack_phi ); setBranch >(tree,"GhostTrack_e", m_GhostTrack_e ); setBranch >(tree,"GhostTrack_d0", m_GhostTrack_d0 ); setBranch >(tree,"GhostTrack_z0", m_GhostTrack_z0 ); if ( m_infoSwitch.m_allTrackDetail ) { setBranch >(tree,"GhostTrack_nPixelHits", m_GhostTrack_nPixelHits); setBranch >(tree,"GhostTrack_nSCTHits", m_GhostTrack_nSCTHits); setBranch >(tree,"GhostTrack_nTRTHits", m_GhostTrack_nTRTHits); setBranch >(tree,"GhostTrack_nPixelSharedHits", m_GhostTrack_nPixelSharedHits); setBranch >(tree,"GhostTrack_nPixelSplitHits", m_GhostTrack_nPixelSplitHits); setBranch >(tree,"m_GhostTrack_nInnermostPixelLayerHits", m_GhostTrack_nInnermostPixelLayerHits); setBranch >(tree,"m_GhostTrack_nInnermostPixelLayerSharedHits", m_GhostTrack_nInnermostPixelLayerSharedHits); setBranch >(tree,"m_GhostTrack_nInnermostPixelLayerSplitHits", m_GhostTrack_nInnermostPixelLayerSplitHits); setBranch >(tree,"m_GhostTrack_nNextToInnermostPixelLayerHits", m_GhostTrack_nNextToInnermostPixelLayerHits); setBranch >(tree,"m_GhostTrack_nNextToInnermostPixelLayerSharedHits", m_GhostTrack_nNextToInnermostPixelLayerSharedHits); setBranch >(tree,"m_GhostTrack_nNextToInnermostPixelLayerSplitHits", m_GhostTrack_nNextToInnermostPixelLayerSplitHits); } } if ( m_infoSwitch.m_constituent ) { setBranch(tree,"numConstituents", m_numConstituents); } if ( m_infoSwitch.m_constituentAll ) { setBranch >(tree,"constituentWeights", m_constituentWeights); setBranch >(tree,"constituent_pt", m_constituent_pt ); setBranch >(tree,"constituent_eta", m_constituent_eta ); setBranch >(tree,"constituent_phi", m_constituent_phi ); setBranch >(tree,"constituent_e", m_constituent_e ); } if( m_infoSwitch.m_flavorTag || m_infoSwitch.m_flavorTagHLT || m_infoSwitch.m_flavorTagTLA ) { setBranch(tree,"HadronConeExclTruthLabelID", m_HadronConeExclTruthLabelID); setBranch(tree,"HadronConeExclExtendedTruthLabelID", m_HadronConeExclExtendedTruthLabelID); } if( m_infoSwitch.m_flavorTag || m_infoSwitch.m_flavorTagHLT ) { setBranch(tree,"DL1r", m_DL1r); setBranch(tree,"DL1r_pu", m_DL1r_pu); setBranch(tree,"DL1r_pc", m_DL1r_pc); setBranch(tree,"DL1r_pb", m_DL1r_pb); setBranch(tree,"DL1dv00", m_DL1dv00); setBranch(tree,"DL1dv00_pu", m_DL1dv00_pu); setBranch(tree,"DL1dv00_pc", m_DL1dv00_pc); setBranch(tree,"DL1dv00_pb", m_DL1dv00_pb); setBranch(tree,"DL1dv01", m_DL1dv01); setBranch(tree,"DL1dv01_pu", m_DL1dv01_pu); setBranch(tree,"DL1dv01_pc", m_DL1dv01_pc); setBranch(tree,"DL1dv01_pb", m_DL1dv01_pb); setBranch(tree,"GN1", m_GN1); setBranch(tree,"GN1_pu", m_GN1_pu); setBranch(tree,"GN1_pc", m_GN1_pc); setBranch(tree,"GN1_pb", m_GN1_pb); setBranch(tree,"GN2v00LegacyWP", m_GN2v00LegacyWP); setBranch(tree,"GN2v00LegacyWP_pu", m_GN2v00LegacyWP_pu); setBranch(tree,"GN2v00LegacyWP_pc", m_GN2v00LegacyWP_pc); setBranch(tree,"GN2v00LegacyWP_pb", m_GN2v00LegacyWP_pb); setBranch(tree,"GN2v00NewAliasWP", m_GN2v00NewAliasWP); setBranch(tree,"GN2v00NewAliasWP_pu", m_GN2v00NewAliasWP_pu); setBranch(tree,"GN2v00NewAliasWP_pc", m_GN2v00NewAliasWP_pc); setBranch(tree,"GN2v00NewAliasWP_pb", m_GN2v00NewAliasWP_pb); setBranch(tree,"GN2v01", m_GN2v01); setBranch(tree,"GN2v01_pu", m_GN2v01_pu); setBranch(tree,"GN2v01_pc", m_GN2v01_pc); setBranch(tree,"GN2v01_pb", m_GN2v01_pb); setBranch(tree,"GN2v01_ptau", m_GN2v01_ptau); if( m_infoSwitch.m_jetFitterDetails){ setBranch(tree, "JetFitter_nVTX" , m_JetFitter_nVTX ); setBranch(tree, "JetFitter_nSingleTracks" , m_JetFitter_nSingleTracks ); setBranch(tree, "JetFitter_nTracksAtVtx" , m_JetFitter_nTracksAtVtx ); setBranch(tree, "JetFitter_mass" , m_JetFitter_mass ); setBranch(tree, "JetFitter_energyFraction", m_JetFitter_energyFraction ); setBranch(tree, "JetFitter_significance3d", m_JetFitter_significance3d ); setBranch(tree, "JetFitter_deltaeta" , m_JetFitter_deltaeta ); setBranch(tree, "JetFitter_deltaphi" , m_JetFitter_deltaphi ); setBranch(tree, "JetFitter_N2Tpair" , m_JetFitter_N2Tpar ); //setBranch(tree, "JetFitter_pb" , m_JetFitter_pb ); //setBranch(tree, "JetFitter_pc" , m_JetFitter_pc ); //setBranch(tree, "JetFitter_pu" , m_JetFitter_pu ); } if( m_infoSwitch.m_svDetails){ setBranch(tree, "SV0", m_SV0); setBranch(tree, "sv0_NGTinSvx", m_sv0_NGTinSvx ); setBranch(tree, "sv0_N2Tpair", m_sv0_N2Tpair ); setBranch(tree, "sv0_massvx", m_sv0_massvx ); setBranch(tree, "sv0_efracsvx", m_sv0_efracsvx ); setBranch(tree, "sv0_normdist", m_sv0_normdist ); setBranch(tree, "SV1", m_SV1); setBranch(tree, "SV1IP3D", m_SV1IP3D); setBranch(tree, "COMBx", m_COMBx); setBranch(tree, "sv1_pu", m_sv1_pu ); setBranch(tree, "sv1_pb", m_sv1_pb ); setBranch(tree, "sv1_pc", m_sv1_pc ); setBranch(tree, "sv1_c", m_sv1_c ); setBranch(tree, "sv1_cu", m_sv1_cu ); setBranch(tree, "sv1_NGTinSvx", m_sv1_NGTinSvx ); setBranch(tree, "sv1_N2Tpair", m_sv1_N2Tpair ); setBranch(tree, "sv1_massvx", m_sv1_massvx ); setBranch(tree, "sv1_efracsvx", m_sv1_efracsvx ); setBranch(tree, "sv1_normdist", m_sv1_normdist ); setBranch(tree, "sv1_Lxy", m_sv1_Lxy ); setBranch(tree, "sv1_sig3d", m_sv1_sig3d ); setBranch(tree, "sv1_L3d", m_sv1_L3d ); setBranch(tree, "sv1_distmatlay", m_sv1_distmatlay); setBranch(tree, "sv1_dR", m_sv1_dR ); } if( m_infoSwitch.m_ipDetails){ setBranch(tree, "IP2D_pu", m_IP2D_pu ); setBranch(tree, "IP2D_pb", m_IP2D_pb ); setBranch(tree, "IP2D_pc", m_IP2D_pc ); setBranch(tree, "IP2D", m_IP2D ); setBranch(tree, "IP2D_c", m_IP2D_c ); setBranch(tree, "IP2D_cu", m_IP2D_cu ); setBranch(tree, "nIP2DTracks" , m_nIP2DTracks ); setBranch >(tree, "IP2D_gradeOfTracks" , m_IP2D_gradeOfTracks ); setBranch >(tree, "IP2D_flagFromV0ofTracks" , m_IP2D_flagFromV0ofTracks ); setBranch >(tree, "IP2D_valD0wrtPVofTracks" , m_IP2D_valD0wrtPVofTracks ); setBranch >(tree, "IP2D_sigD0wrtPVofTracks" , m_IP2D_sigD0wrtPVofTracks ); setBranch >(tree, "IP2D_weightBofTracks" , m_IP2D_weightBofTracks ); setBranch >(tree, "IP2D_weightCofTracks" , m_IP2D_weightCofTracks ); setBranch >(tree, "IP2D_weightUofTracks" , m_IP2D_weightUofTracks ); setBranch(tree, "IP3D", m_IP3D); setBranch(tree, "IP3D_pu", m_IP3D_pu ); setBranch(tree, "IP3D_pb", m_IP3D_pb ); setBranch(tree, "IP3D_pc", m_IP3D_pc ); setBranch(tree, "IP3D", m_IP3D ); setBranch(tree, "IP3D_c", m_IP3D_c ); setBranch(tree, "IP3D_cu", m_IP3D_cu ); setBranch(tree, "nIP3DTracks" , m_nIP3DTracks ); setBranch >(tree, "IP3D_gradeOfTracks" , m_IP3D_gradeOfTracks ); setBranch >(tree, "IP3D_flagFromV0ofTracks" , m_IP3D_flagFromV0ofTracks ); setBranch >(tree, "IP3D_valD0wrtPVofTracks" , m_IP3D_valD0wrtPVofTracks ); setBranch >(tree, "IP3D_sigD0wrtPVofTracks" , m_IP3D_sigD0wrtPVofTracks ); setBranch >(tree, "IP3D_valZ0wrtPVofTracks" , m_IP3D_valZ0wrtPVofTracks ); setBranch >(tree, "IP3D_sigZ0wrtPVofTracks" , m_IP3D_sigZ0wrtPVofTracks ); setBranch >(tree, "IP3D_weightBofTracks" , m_IP3D_weightBofTracks ); setBranch >(tree, "IP3D_weightCofTracks" , m_IP3D_weightCofTracks ); setBranch >(tree, "IP3D_weightUofTracks" , m_IP3D_weightUofTracks ); } if( m_infoSwitch.m_JVC ) { setBranch(tree,"JetVertexCharge_discriminant", m_JetVertexCharge_discriminant); } } if( m_infoSwitch.m_flavorTagHLT ) { setBranch(tree,"vtxOnlineValid",m_vtxOnlineValid); setBranch(tree,"vtxHadDummy" ,m_vtxHadDummy ); setBranch(tree,"bs_online_vx" ,m_bs_online_vx ); setBranch(tree,"bs_online_vy" ,m_bs_online_vy ); setBranch(tree,"bs_online_vz" ,m_bs_online_vz ); setBranch(tree,"vtx_offline_x0" ,m_vtx_offline_x0 ); setBranch(tree,"vtx_offline_y0" ,m_vtx_offline_y0 ); setBranch(tree,"vtx_offline_z0" ,m_vtx_offline_z0 ); setBranch(tree,"vtx_online_x0" ,m_vtx_online_x0 ); setBranch(tree,"vtx_online_y0" ,m_vtx_online_y0 ); setBranch(tree,"vtx_online_z0" ,m_vtx_online_z0 ); setBranch(tree,"vtx_online_bkg_x0" ,m_vtx_online_bkg_x0 ); setBranch(tree,"vtx_online_bkg_y0" ,m_vtx_online_bkg_y0 ); setBranch(tree,"vtx_online_bkg_z0" ,m_vtx_online_bkg_z0 ); } if( m_infoSwitch.m_flavorTagTLA ) { setBranch(tree,"fastDIPS", m_fastDIPS); setBranch(tree,"fastDIPS_pu", m_fastDIPS_pu); setBranch(tree,"fastDIPS_pc", m_fastDIPS_pc); setBranch(tree,"fastDIPS_pb", m_fastDIPS_pb); } if( !m_infoSwitch.m_jetBTag.empty() || !m_infoSwitch.m_jetBTagCts.empty() ) { for(auto btag : m_btags) btag->setBranch(tree, m_name); } if( m_infoSwitch.m_area ) { setBranch(tree,"GhostArea", m_GhostArea); setBranch(tree,"ActiveArea", m_ActiveArea); setBranch(tree,"VoronoiArea", m_VoronoiArea); setBranch(tree,"ActiveArea4vec_pt", m_ActiveArea4vec_pt); setBranch(tree,"ActiveArea4vec_eta", m_ActiveArea4vec_eta); setBranch(tree,"ActiveArea4vec_phi", m_ActiveArea4vec_phi); setBranch(tree,"ActiveArea4vec_m", m_ActiveArea4vec_m); } if ( m_infoSwitch.m_truth && m_mc ) { setBranch(tree,"ConeTruthLabelID", m_ConeTruthLabelID ); setBranch(tree,"TruthCount", m_TruthCount ); setBranch(tree,"TruthLabelDeltaR_B", m_TruthLabelDeltaR_B ); setBranch(tree,"TruthLabelDeltaR_C", m_TruthLabelDeltaR_C ); setBranch(tree,"TruthLabelDeltaR_T", m_TruthLabelDeltaR_T ); setBranch(tree,"PartonTruthLabelID", m_PartonTruthLabelID ); setBranch(tree,"GhostTruthAssociationFraction", m_GhostTruthAssociationFraction); setBranch(tree,"truth_E", m_truth_E); setBranch(tree,"truth_pt", m_truth_pt); setBranch(tree,"truth_phi", m_truth_phi); setBranch(tree,"truth_eta", m_truth_eta); } if ( m_infoSwitch.m_truthDetails ) { setBranch(tree,"GhostBHadronsFinalCount", m_GhostBHadronsFinalCount ); setBranch(tree,"GhostBHadronsInitialCount", m_GhostBHadronsInitialCount ); setBranch(tree,"GhostBQuarksFinalCount", m_GhostBQuarksFinalCount ); setBranch(tree,"GhostBHadronsFinalPt", m_GhostBHadronsFinalPt ); setBranch(tree,"GhostBHadronsInitialPt", m_GhostBHadronsInitialPt ); setBranch(tree,"GhostBQuarksFinalPt", m_GhostBQuarksFinalPt ); setBranch(tree,"GhostCHadronsFinalCount" , m_GhostCHadronsFinalCount ); setBranch(tree,"GhostCHadronsInitialCount", m_GhostCHadronsInitialCount); setBranch(tree,"GhostCQuarksFinalCount" , m_GhostCQuarksFinalCount ); setBranch(tree,"GhostCHadronsFinalPt" , m_GhostCHadronsFinalPt ); setBranch(tree,"GhostCHadronsInitialPt" , m_GhostCHadronsInitialPt ); setBranch(tree,"GhostCQuarksFinalPt" , m_GhostCQuarksFinalPt ); setBranch(tree,"GhostTausFinalCount", m_GhostTausFinalCount ); setBranch(tree,"GhostTausFinalPt" , m_GhostTausFinalPt ); setBranch(tree,"truth_pdgId" , m_truth_pdgId); setBranch(tree,"truth_partonPt", m_truth_partonPt); setBranch(tree,"truth_partonDR", m_truth_partonDR); } if ( m_infoSwitch.m_charge ) { setBranch(tree,"charge", m_charge); } if ( m_infoSwitch.m_passSel ) { setBranch(tree,"passSel", m_passSel); } if ( m_infoSwitch.m_passOR ) { setBranch(tree,"passOR", m_passOR); } return; } void JetContainer::clear() { ParticleContainer::clear(); // rapidity if( m_infoSwitch.m_rapidity ) { m_rapidity->clear(); } // trigger if ( m_infoSwitch.m_trigger ) { m_isTrigMatched->clear(); m_isTrigMatchedToChain->clear(); m_listTrigChains->clear(); } // clean if( m_infoSwitch.m_clean || m_infoSwitch.m_cleanLight || m_infoSwitch.m_cleanLLP) { if(m_infoSwitch.m_clean){ m_Timing ->clear(); m_LArQuality ->clear(); m_HECQuality ->clear(); m_NegativeE ->clear(); m_AverageLArQF ->clear(); m_BchCorrCell ->clear(); m_N90Constituents ->clear(); m_LArBadHVEnergyFrac ->clear(); m_LArBadHVNCell ->clear(); m_ChargedFraction ->clear(); m_OotFracClusters5 ->clear(); m_OotFracClusters10 ->clear(); m_LeadingClusterPt ->clear(); m_LeadingClusterSecondLambda->clear(); m_LeadingClusterCenterLambda->clear(); m_LeadingClusterSecondR ->clear(); if(m_infoSwitch.m_cleanTrig) { m_clean_passLooseBadTriggerUgly->clear(); } else { m_clean_passTightBadUgly ->clear(); m_clean_passLooseBadUgly ->clear(); } } if(m_infoSwitch.m_cleanTrig) { m_clean_passLooseBadTrigger ->clear(); } else { m_clean_passLooseBad ->clear(); m_clean_passTightBad ->clear(); } if(m_infoSwitch.m_cleanLLP) { m_clean_passLooseBadLLP ->clear(); } } if(m_infoSwitch.m_timing && !m_infoSwitch.m_clean){ m_Timing->clear(); } // energy if ( m_infoSwitch.m_energy || m_infoSwitch.m_energyLight ) { if ( m_infoSwitch.m_energy ){ m_HECFrac ->clear(); m_CentroidR ->clear(); m_LowEtConstituentsFrac ->clear(); } m_EMFrac ->clear(); m_FracSamplingMax ->clear(); m_FracSamplingMaxIndex ->clear(); m_GhostMuonSegmentCount ->clear(); m_Width ->clear(); } // each step of the calibration sequence if ( m_infoSwitch.m_scales ) { m_emScalePt ->clear(); m_constScalePt ->clear(); m_pileupScalePt ->clear(); m_originConstitScalePt ->clear(); m_etaJESScalePt ->clear(); m_gscScalePt ->clear(); m_jmsScalePt ->clear(); m_insituScalePt ->clear(); m_emScaleM ->clear(); m_constScaleM ->clear(); m_pileupScaleM ->clear(); m_originConstitScaleM ->clear(); m_etaJESScaleM ->clear(); m_gscScaleM ->clear(); m_jmsScaleM ->clear(); m_insituScaleM ->clear(); } // eta at constScale if ( m_infoSwitch.m_constscaleEta ) { m_constScaleEta ->clear(); } // detector eta if ( m_infoSwitch.m_detectorEta ) { m_detectorEta ->clear(); } // layer if ( m_infoSwitch.m_layer ) { m_EnergyPerSampling->clear(); } // trackAll if ( m_infoSwitch.m_trackAll ) { m_NumTrkPt1000 ->clear(); m_SumPtTrkPt1000 ->clear(); m_TrackWidthPt1000 ->clear(); m_NumTrkPt500 ->clear(); m_SumPtTrkPt500 ->clear(); m_TrackWidthPt500 ->clear(); m_JVF ->clear(); } // trackPV if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_jvt ) { if ( m_infoSwitch.m_trackPV ) { m_NumTrkPt1000PV ->clear(); m_SumPtTrkPt1000PV ->clear(); m_TrackWidthPt1000PV->clear(); m_NumTrkPt500PV ->clear(); m_SumPtTrkPt500PV ->clear(); m_TrackWidthPt500PV ->clear(); m_JVFPV ->clear(); m_JvtJvfcorr ->clear(); m_JvtRpt ->clear(); } m_Jvt ->clear(); } if (m_infoSwitch.m_fJvt){ m_fJvt->clear(); } if (m_infoSwitch.m_NNJvt){ m_NNJvt->clear(); m_NNJvtPass->clear(); } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sfJVTName == "Loose" ) { m_JvtPass_Loose ->clear(); if ( m_mc ) { m_JvtEff_SF_Loose ->clear(); } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sfJVTName == "Medium" ) { m_JvtPass_Medium ->clear(); if ( m_mc ) { m_JvtEff_SF_Medium->clear(); } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sfJVTName == "Tight" ) { m_JvtPass_Tight ->clear(); if ( m_mc ) { m_JvtEff_SF_Tight ->clear(); } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sfJVTName == "FixedEffPt" ) { m_JvtPass_FixedEffPt ->clear(); if ( m_mc ) { m_JvtEff_SF_FixedEffPt->clear(); } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sfJVTName == "TightFwd" ) { m_JvtPass_TightFwd ->clear(); if ( m_mc ) { m_JvtEff_SF_TightFwd ->clear(); } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sffJVTName == "Loose" ) { m_fJvtPass_Loose ->clear(); if ( m_mc ) { m_fJvtEff_SF_Loose->clear(); } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sffJVTName == "Medium" ) { m_fJvtPass_Medium ->clear(); if ( m_mc ) { m_fJvtEff_SF_Medium->clear(); } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sffJVTName == "Tight" ) { m_fJvtPass_Tight ->clear(); if ( m_mc ) { m_fJvtEff_SF_Tight ->clear(); } } // chargedPFOPV if ( m_infoSwitch.m_chargedPFOPV ) { m_SumPtChargedPFOPt500PV->clear(); m_fCharged->clear(); } if ( m_infoSwitch.m_allTrack ) { m_GhostTrackCount ->clear(); m_GhostTrackPt ->clear(); m_GhostTrack_pt ->clear(); m_GhostTrack_qOverP ->clear(); m_GhostTrack_eta ->clear(); m_GhostTrack_phi ->clear(); m_GhostTrack_e ->clear(); m_GhostTrack_d0 ->clear(); m_GhostTrack_z0 ->clear(); if ( m_infoSwitch.m_allTrackDetail ) { m_GhostTrack_nPixelHits ->clear(); m_GhostTrack_nSCTHits ->clear(); m_GhostTrack_nTRTHits ->clear(); m_GhostTrack_nPixelSharedHits ->clear(); m_GhostTrack_nPixelSplitHits ->clear(); m_GhostTrack_nInnermostPixelLayerHits ->clear(); m_GhostTrack_nInnermostPixelLayerSharedHits ->clear(); m_GhostTrack_nInnermostPixelLayerSplitHits ->clear(); m_GhostTrack_nNextToInnermostPixelLayerHits ->clear(); m_GhostTrack_nNextToInnermostPixelLayerSharedHits ->clear(); m_GhostTrack_nNextToInnermostPixelLayerSplitHits ->clear(); } } if( m_infoSwitch.m_constituent ) { m_numConstituents->clear(); } if( m_infoSwitch.m_constituentAll ) { m_constituentWeights ->clear(); m_constituent_pt ->clear(); m_constituent_eta ->clear(); m_constituent_phi ->clear(); m_constituent_e ->clear(); } if ( m_infoSwitch.m_flavorTag || m_infoSwitch.m_flavorTagHLT || m_infoSwitch.m_flavorTagTLA ) { m_HadronConeExclTruthLabelID ->clear(); m_HadronConeExclExtendedTruthLabelID->clear(); } // flavor tag if ( m_infoSwitch.m_flavorTag || m_infoSwitch.m_flavorTagHLT ) { m_DL1r ->clear(); m_DL1r_pu ->clear(); m_DL1r_pc ->clear(); m_DL1r_pb ->clear(); m_DL1dv00 ->clear(); m_DL1dv00_pu ->clear(); m_DL1dv00_pc ->clear(); m_DL1dv00_pb ->clear(); m_DL1dv01 ->clear(); m_DL1dv01_pu ->clear(); m_DL1dv01_pc ->clear(); m_DL1dv01_pb ->clear(); m_GN1 ->clear(); m_GN1_pu ->clear(); m_GN1_pc ->clear(); m_GN1_pb ->clear(); m_GN2v00LegacyWP ->clear(); m_GN2v00LegacyWP_pu ->clear(); m_GN2v00LegacyWP_pc ->clear(); m_GN2v00LegacyWP_pb ->clear(); m_GN2v00NewAliasWP ->clear(); m_GN2v00NewAliasWP_pu ->clear(); m_GN2v00NewAliasWP_pc ->clear(); m_GN2v00NewAliasWP_pb ->clear(); m_GN2v01 ->clear(); m_GN2v01_pu ->clear(); m_GN2v01_pc ->clear(); m_GN2v01_pb ->clear(); m_GN2v01_ptau ->clear(); if( m_infoSwitch.m_jetFitterDetails){ m_JetFitter_nVTX ->clear(); m_JetFitter_nSingleTracks ->clear(); m_JetFitter_nTracksAtVtx ->clear(); m_JetFitter_mass ->clear(); m_JetFitter_energyFraction ->clear(); m_JetFitter_significance3d ->clear(); m_JetFitter_deltaeta ->clear(); m_JetFitter_deltaphi ->clear(); m_JetFitter_N2Tpar ->clear(); } if( m_infoSwitch.m_svDetails){ m_SV0 ->clear(); m_sv0_NGTinSvx ->clear(); m_sv0_N2Tpair ->clear(); m_sv0_massvx ->clear(); m_sv0_efracsvx ->clear(); m_sv0_normdist ->clear(); m_SV1 ->clear(); m_SV1IP3D ->clear(); m_COMBx ->clear(); m_sv1_pu ->clear(); m_sv1_pb ->clear(); m_sv1_pc ->clear(); m_sv1_c ->clear(); m_sv1_cu ->clear(); m_sv1_NGTinSvx ->clear(); m_sv1_N2Tpair ->clear(); m_sv1_massvx ->clear(); m_sv1_efracsvx ->clear(); m_sv1_normdist ->clear(); m_sv1_Lxy ->clear(); m_sv1_sig3d ->clear(); m_sv1_L3d ->clear(); m_sv1_distmatlay ->clear(); m_sv1_dR ->clear(); } if( m_infoSwitch.m_ipDetails){ m_IP2D_pu ->clear(); m_IP2D_pb ->clear(); m_IP2D_pc ->clear(); m_IP2D ->clear(); m_IP2D_c ->clear(); m_IP2D_cu ->clear(); m_nIP2DTracks ->clear(); m_IP2D_gradeOfTracks ->clear(); m_IP2D_flagFromV0ofTracks ->clear(); m_IP2D_valD0wrtPVofTracks ->clear(); m_IP2D_sigD0wrtPVofTracks ->clear(); m_IP2D_weightBofTracks ->clear(); m_IP2D_weightCofTracks ->clear(); m_IP2D_weightUofTracks ->clear(); m_IP3D ->clear(); m_IP3D_pu ->clear(); m_IP3D_pb ->clear(); m_IP3D_pc ->clear(); m_IP3D ->clear(); m_IP3D_c ->clear(); m_IP3D_cu ->clear(); m_nIP3DTracks ->clear(); m_IP3D_gradeOfTracks ->clear(); m_IP3D_flagFromV0ofTracks ->clear(); m_IP3D_valD0wrtPVofTracks ->clear(); m_IP3D_sigD0wrtPVofTracks ->clear(); m_IP3D_valZ0wrtPVofTracks ->clear(); m_IP3D_sigZ0wrtPVofTracks ->clear(); m_IP3D_weightBofTracks ->clear(); m_IP3D_weightCofTracks ->clear(); m_IP3D_weightUofTracks ->clear(); } if( m_infoSwitch.m_JVC ){ m_JetVertexCharge_discriminant->clear(); } } if ( m_infoSwitch.m_flavorTagHLT ) { m_vtxOnlineValid->clear(); m_vtxHadDummy->clear(); m_bs_online_vx->clear(); m_bs_online_vy->clear(); m_bs_online_vz->clear(); m_vtx_offline_x0->clear(); m_vtx_offline_y0->clear(); m_vtx_offline_z0->clear(); m_vtx_online_x0->clear(); m_vtx_online_y0->clear(); m_vtx_online_z0->clear(); m_vtx_online_bkg_x0->clear(); m_vtx_online_bkg_y0->clear(); m_vtx_online_bkg_z0->clear(); } if ( m_infoSwitch.m_flavorTagTLA ) { m_fastDIPS ->clear(); m_fastDIPS_pu ->clear(); m_fastDIPS_pc ->clear(); m_fastDIPS_pb ->clear(); } if( !m_infoSwitch.m_jetBTag.empty() || !m_infoSwitch.m_jetBTagCts.empty()) { // just clear them all.... for(auto btag : m_btags) btag->clear(); } if ( m_infoSwitch.m_area ) { m_GhostArea ->clear(); m_ActiveArea ->clear(); m_VoronoiArea ->clear(); m_ActiveArea4vec_pt ->clear(); m_ActiveArea4vec_eta ->clear(); m_ActiveArea4vec_phi ->clear(); m_ActiveArea4vec_m ->clear(); } // truth if ( m_infoSwitch.m_truth && m_mc ) { m_ConeTruthLabelID ->clear(); m_TruthCount ->clear(); m_TruthLabelDeltaR_B->clear(); m_TruthLabelDeltaR_C->clear(); m_TruthLabelDeltaR_T->clear(); m_PartonTruthLabelID->clear(); m_GhostTruthAssociationFraction->clear(); m_truth_E ->clear(); m_truth_pt ->clear(); m_truth_phi->clear(); m_truth_eta->clear(); } // truth_detail if ( m_infoSwitch.m_truthDetails ) { m_GhostBHadronsFinalCount ->clear(); m_GhostBHadronsInitialCount ->clear(); m_GhostBQuarksFinalCount ->clear(); m_GhostBHadronsFinalPt ->clear(); m_GhostBHadronsInitialPt ->clear(); m_GhostBQuarksFinalPt ->clear(); m_GhostCHadronsFinalCount ->clear(); m_GhostCHadronsInitialCount ->clear(); m_GhostCQuarksFinalCount ->clear(); m_GhostCHadronsFinalPt ->clear(); m_GhostCHadronsInitialPt ->clear(); m_GhostCQuarksFinalPt ->clear(); m_GhostTausFinalCount ->clear(); m_GhostTausFinalPt ->clear(); m_truth_pdgId ->clear(); m_truth_partonPt ->clear(); m_truth_partonDR ->clear(); } if( m_infoSwitch.m_charge ) { m_charge->clear(); } if( m_infoSwitch.m_passSel ) { m_passSel->clear(); } if( m_infoSwitch.m_passOR ) { m_passOR->clear(); } return; } void JetContainer::FillJet( const xAOD::Jet* jet, const xAOD::Vertex* pv, int pvLocation ){ return FillJet(static_cast(jet), pv, pvLocation); } void JetContainer::FillJet( const xAOD::IParticle* particle, const xAOD::Vertex* pv, int pvLocation ){ if(m_debug) std::cout << "In JetContainer::FillJet " << std::endl; ParticleContainer::FillParticle(particle); const xAOD::Jet* jet=dynamic_cast(particle); if( m_infoSwitch.m_rapidity ){ m_rapidity->push_back( jet->rapidity() ); } if ( m_infoSwitch.m_trigger ) { // retrieve map w/ // static SG::AuxElement::Accessor< std::map > isTrigMatchedMapJetAcc("isTrigMatchedMapJet"); std::vector matches; if ( isTrigMatchedMapJetAcc.isAvailable( *jet ) ) { // loop over map and fill branches // for ( auto const &it : (isTrigMatchedMapJetAcc( *jet )) ) { matches.push_back( static_cast(it.second) ); m_listTrigChains->push_back( it.first ); } } else { matches.push_back( -1 ); m_listTrigChains->push_back("NONE"); } m_isTrigMatchedToChain->push_back(matches); // if at least one match among the chains is found, say this jet is trigger matched if ( std::find(matches.begin(), matches.end(), 1) != matches.end() ) { m_isTrigMatched->push_back(1); } else { m_isTrigMatched->push_back(0); } } if (m_infoSwitch.m_clean || m_infoSwitch.m_cleanLight || m_infoSwitch.m_cleanLLP) { if(m_infoSwitch.m_clean){ static SG::AuxElement::ConstAccessor jetTime ("Timing"); safeFill(jet, jetTime, m_Timing, -999); static SG::AuxElement::ConstAccessor LArQuality ("LArQuality"); safeFill(jet, LArQuality, m_LArQuality, -999); static SG::AuxElement::ConstAccessor hecq ("HECQuality"); safeFill(jet, hecq, m_HECQuality, -999); static SG::AuxElement::ConstAccessor negE ("NegativeE"); safeFill(jet, negE, m_NegativeE, -999, m_units); static SG::AuxElement::ConstAccessor avLArQF ("AverageLArQF"); safeFill(jet, avLArQF, m_AverageLArQF, -999); static SG::AuxElement::ConstAccessor bchCorrCell ("BchCorrCell"); safeFill(jet, bchCorrCell, m_BchCorrCell, -999); static SG::AuxElement::ConstAccessor N90Const ("N90Constituents"); safeFill(jet, N90Const, m_N90Constituents, -999); static SG::AuxElement::ConstAccessor LArBadHVEFrac ("LArBadHVEnergyFrac"); safeFill(jet, LArBadHVEFrac, m_LArBadHVEnergyFrac, -999); static SG::AuxElement::ConstAccessor LArBadHVNCell ("LArBadHVNCell"); safeFill(jet, LArBadHVNCell, m_LArBadHVNCell, -999); static SG::AuxElement::ConstAccessor OotFracClus5 ("OotFracClusters5"); safeFill(jet, OotFracClus5, m_OotFracClusters5, -999); static SG::AuxElement::ConstAccessor OotFracClus10 ("OotFracClusters10"); safeFill(jet, OotFracClus10, m_OotFracClusters10, -999); static SG::AuxElement::ConstAccessor leadClusPt ("LeadingClusterPt"); safeFill(jet, leadClusPt, m_LeadingClusterPt, -999); static SG::AuxElement::ConstAccessor leadClusSecondLambda ("LeadingClusterSecondLambda"); safeFill(jet, leadClusSecondLambda, m_LeadingClusterSecondLambda, -999); static SG::AuxElement::ConstAccessor leadClusCenterLambda ("LeadingClusterCenterLambda"); safeFill(jet, leadClusCenterLambda, m_LeadingClusterCenterLambda, -999); static SG::AuxElement::ConstAccessor leadClusSecondR ("LeadingClusterSecondR"); safeFill(jet, leadClusSecondR, m_LeadingClusterSecondR, -999); if(!m_infoSwitch.m_cleanTrig) { static SG::AuxElement::ConstAccessor clean_passLooseBadUgly ("clean_passLooseBadUgly"); safeFill(jet, clean_passLooseBadUgly, m_clean_passLooseBadUgly, -999); static SG::AuxElement::ConstAccessor clean_passTightBadUgly ("clean_passTightBadUgly"); safeFill(jet, clean_passTightBadUgly, m_clean_passTightBadUgly, -999); } else { static SG::AuxElement::ConstAccessor clean_passLooseBadTriggerUgly ("clean_passLooseBadTriggerUgly"); safeFill(jet, clean_passLooseBadTriggerUgly, m_clean_passLooseBadTriggerUgly, -999); } } if(!m_infoSwitch.m_cleanTrig) { static SG::AuxElement::ConstAccessor clean_passLooseBad ("clean_passLooseBad"); safeFill(jet, clean_passLooseBad, m_clean_passLooseBad, -999); static SG::AuxElement::ConstAccessor clean_passTightBad ("clean_passTightBad"); safeFill(jet, clean_passTightBad, m_clean_passTightBad, -999); } else { static SG::AuxElement::ConstAccessor clean_passLooseBadTrigger ("clean_passLooseBadTrigger"); safeFill(jet, clean_passLooseBadTrigger, m_clean_passLooseBadTrigger, -999); } if(m_infoSwitch.m_cleanLLP) { static SG::AuxElement::ConstAccessor clean_passLooseBadLLP ("clean_passLooseBadLLP"); safeFill(jet, clean_passLooseBadLLP, m_clean_passLooseBadLLP, -999); } } // clean if(m_infoSwitch.m_timing && !m_infoSwitch.m_clean){ static SG::AuxElement::ConstAccessor jetTime ("Timing"); safeFill(jet, jetTime, m_Timing, -999); } if ( m_infoSwitch.m_energy | m_infoSwitch.m_energyLight ) { if ( m_infoSwitch.m_energy ){ static SG::AuxElement::ConstAccessor HECf ("HECFrac"); safeFill(jet, HECf, m_HECFrac, -999); static SG::AuxElement::ConstAccessor centroidR ("CentroidR"); safeFill(jet, centroidR, m_CentroidR, -999); static SG::AuxElement::ConstAccessor lowEtFrac ("LowEtConstituentsFrac"); safeFill(jet, lowEtFrac, m_LowEtConstituentsFrac, -999); } static SG::AuxElement::ConstAccessor EMf ("EMFrac"); safeFill(jet, EMf, m_EMFrac, -999); static SG::AuxElement::ConstAccessor fracSampMax ("FracSamplingMax"); safeFill(jet, fracSampMax, m_FracSamplingMax, -999); static SG::AuxElement::ConstAccessor fracSampMaxIdx ("FracSamplingMaxIndex"); safeFill(jet, fracSampMaxIdx, m_FracSamplingMaxIndex, -999); static SG::AuxElement::ConstAccessor muonSegCount ("GhostMuonSegmentCount"); safeFill(jet, muonSegCount, m_GhostMuonSegmentCount, -999); static SG::AuxElement::ConstAccessor width ("Width"); safeFill(jet, width, m_Width, -999); } // energy // each step of the calibration sequence if ( m_infoSwitch.m_scales ) { xAOD::JetFourMom_t fourVec; bool status(false); // EM Scale status = jet->getAttribute( "JetEMScaleMomentum", fourVec ); if( status ) { m_emScalePt->push_back( fourVec.Pt() / m_units ); m_emScaleM->push_back( fourVec.M() / m_units ); } else { m_emScalePt->push_back( -999 ); m_emScaleM->push_back( -999 ); } // Constit Scale status = jet->getAttribute( "JetConstitScaleMomentum", fourVec ); if( status ) { m_constScalePt->push_back( fourVec.Pt() / m_units ); m_constScaleM->push_back( fourVec.M() / m_units ); } else { m_constScalePt->push_back( -999 ); m_constScaleM->push_back( -999 ); } // Pileup Scale status = jet->getAttribute( "JetPileupScaleMomentum", fourVec ); if( status ) { m_pileupScalePt->push_back( fourVec.Pt() / m_units ); m_pileupScaleM->push_back( fourVec.M() / m_units ); } else { m_pileupScalePt->push_back( -999 ); m_pileupScaleM->push_back( -999 ); } // OriginConstit Scale status = jet->getAttribute( "JetOriginConstitScaleMomentum", fourVec ); if( status ) { m_originConstitScalePt->push_back( fourVec.Pt() / m_units ); m_originConstitScaleM->push_back( fourVec.M() / m_units ); } else { m_originConstitScalePt->push_back( -999 ); m_originConstitScaleM->push_back( -999 ); } // EtaJES Scale status = jet->getAttribute( "JetEtaJESScaleMomentum", fourVec ); if( status ) { m_etaJESScalePt->push_back( fourVec.Pt() / m_units ); m_etaJESScaleM->push_back( fourVec.M() / m_units ); } else { m_etaJESScalePt->push_back( -999 ); m_etaJESScaleM->push_back( -999 ); } // GSC Scale status = jet->getAttribute( "JetGSCScaleMomentum", fourVec ); if( status ) { m_gscScalePt->push_back( fourVec.Pt() / m_units ); m_gscScaleM->push_back( fourVec.M() / m_units ); } else { m_gscScalePt->push_back( -999 ); m_gscScaleM->push_back( -999 ); } // EtaJES Scale status = jet->getAttribute( "JetJMSScaleMomentum", fourVec ); if( status ) { m_jmsScalePt->push_back( fourVec.Pt() / m_units ); m_jmsScaleM->push_back( fourVec.M() / m_units ); } else { m_jmsScalePt->push_back( -999 ); m_jmsScaleM->push_back( -999 ); } // only available in data status = jet->getAttribute( "JetInsituScaleMomentum", fourVec ); if(status) { m_insituScalePt->push_back( fourVec.Pt() / m_units ); m_insituScaleM->push_back( fourVec.M() / m_units ); } else { m_insituScalePt->push_back( -999 ); m_insituScaleM->push_back( -999 ); } } if ( m_infoSwitch.m_constscaleEta ) { xAOD::JetFourMom_t fourVec; bool status(false); status = jet->getAttribute( "JetConstitScaleMomentum", fourVec ); if( status ) { m_constScaleEta->push_back( fourVec.Eta() ); } else { m_constScaleEta->push_back( -999 ); } } if ( m_infoSwitch.m_detectorEta ) { static SG::AuxElement::ConstAccessor DetEta ("DetectorEta"); safeFill(jet, DetEta, m_detectorEta, -999); } if ( m_infoSwitch.m_layer ) { static SG::AuxElement::ConstAccessor< std::vector > ePerSamp ("EnergyPerSampling"); if ( ePerSamp.isAvailable( *jet ) ) { m_EnergyPerSampling->push_back( ePerSamp( *jet ) ); m_EnergyPerSampling->back(); std::transform((m_EnergyPerSampling->back()).begin(), (m_EnergyPerSampling->back()).end(), (m_EnergyPerSampling->back()).begin(), std::bind2nd(std::divides(), m_units)); } else { // could push back a vector of 24... // ... waste of space vs prevention of out of range down stream std::vector junk(1,-999); m_EnergyPerSampling->push_back( junk ); } } if ( m_infoSwitch.m_trackAll || m_infoSwitch.m_trackPV || m_infoSwitch.m_jvt || m_infoSwitch.m_clean || m_infoSwitch.m_chargedPFOPV ) { // several moments calculated from all verticies // one accessor for each and just use appropiately in the following static SG::AuxElement::ConstAccessor< std::vector > nTrk1000("NumTrkPt1000"); static SG::AuxElement::ConstAccessor< std::vector > sumPt1000("SumPtTrkPt1000"); static SG::AuxElement::ConstAccessor< std::vector > trkWidth1000("TrackWidthPt1000"); static SG::AuxElement::ConstAccessor< std::vector > nTrk500 ("NumTrkPt500"); static SG::AuxElement::ConstAccessor< std::vector > sumPt500 ("SumPtTrkPt500"); static SG::AuxElement::ConstAccessor< std::vector > trkWidth500 ("TrackWidthPt500"); static SG::AuxElement::ConstAccessor< std::vector > jvf("JVF"); static SG::AuxElement::ConstAccessor< std::vector > sumPtChargedPFO500 ("SumPtChargedPFOPt500"); if ( m_infoSwitch.m_trackAll ) { std::vector junkInt(1,-999); std::vector junkFlt(1,-999); if ( nTrk1000.isAvailable( *jet ) ) { m_NumTrkPt1000->push_back( nTrk1000( *jet ) ); } else { m_NumTrkPt1000->push_back( junkInt ); } if ( sumPt1000.isAvailable( *jet ) ) { m_SumPtTrkPt1000->push_back( sumPt1000( *jet ) ); std::transform((m_SumPtTrkPt1000->back()).begin(), (m_SumPtTrkPt1000->back()).end(), (m_SumPtTrkPt1000->back()).begin(), std::bind2nd(std::divides(), m_units)); } else { m_SumPtTrkPt1000->push_back( junkFlt ); } if ( trkWidth1000.isAvailable( *jet ) ) { m_TrackWidthPt1000->push_back( trkWidth1000( *jet ) ); } else { m_TrackWidthPt1000->push_back( junkFlt ); } if ( nTrk500.isAvailable( *jet ) ) { m_NumTrkPt500->push_back( nTrk500( *jet ) ); } else { m_NumTrkPt500->push_back( junkInt ); } if ( sumPt500.isAvailable( *jet ) ) { m_SumPtTrkPt500->push_back( sumPt500( *jet ) ); std::transform((m_SumPtTrkPt500->back()).begin(), (m_SumPtTrkPt500->back()).end(), (m_SumPtTrkPt500->back()).begin(), std::bind2nd(std::divides(), m_units)); } else { m_SumPtTrkPt500->push_back( junkFlt ); } if ( trkWidth500.isAvailable( *jet ) ) { m_TrackWidthPt500->push_back( trkWidth500( *jet ) ); } else { m_TrackWidthPt500->push_back( junkFlt ); } if ( jvf.isAvailable( *jet ) ) { m_JVF->push_back( jvf( *jet ) ); } else { m_JVF->push_back( junkFlt ); } } // trackAll if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_chargedPFOPV || m_infoSwitch.m_jvt ) { if ( m_infoSwitch.m_trackPV && pvLocation >= 0 ) { if ( nTrk1000.isAvailable( *jet ) ) { m_NumTrkPt1000PV->push_back( nTrk1000( *jet )[pvLocation] ); } else { m_NumTrkPt1000PV->push_back( -999 ); } if ( sumPt1000.isAvailable( *jet ) ) { m_SumPtTrkPt1000PV->push_back( sumPt1000( *jet )[pvLocation] / m_units ); } else { m_SumPtTrkPt1000PV->push_back( -999 ); } if ( trkWidth1000.isAvailable( *jet ) ) { m_TrackWidthPt1000PV->push_back( trkWidth1000( *jet )[pvLocation] ); } else { m_TrackWidthPt1000PV->push_back( -999 ); } if ( nTrk500.isAvailable( *jet ) ) { m_NumTrkPt500PV->push_back( nTrk500( *jet )[pvLocation] ); } else { m_NumTrkPt500PV->push_back( -999 ); } if ( sumPt500.isAvailable( *jet ) ) { m_SumPtTrkPt500PV->push_back( sumPt500( *jet )[pvLocation] / m_units ); } else { m_SumPtTrkPt500PV->push_back( -999 ); } if ( trkWidth500.isAvailable( *jet ) ) { m_TrackWidthPt500PV->push_back( trkWidth500( *jet )[pvLocation] ); } else { m_TrackWidthPt500PV->push_back( -999 ); } if ( jvf.isAvailable( *jet ) ) { m_JVFPV->push_back( jvf( *jet )[pvLocation] ); } else { m_JVFPV->push_back( -999 ); } static SG::AuxElement::ConstAccessor< float > jvtJvfcorr ("JVFCorr"); safeFill(jet, jvtJvfcorr, m_JvtJvfcorr, -999); static SG::AuxElement::ConstAccessor< float > jvtRpt ("JvtRpt"); safeFill(jet, jvtRpt, m_JvtRpt, -999); } // trackPV if ( m_infoSwitch.m_chargedPFOPV && pvLocation >= 0) { if ( sumPtChargedPFO500.isAvailable( *jet ) ) { m_SumPtChargedPFOPt500PV->push_back( sumPtChargedPFO500( *jet)[pvLocation] ); xAOD::JetFourMom_t jetconstitP4 = jet->jetP4("JetConstitScaleMomentum"); if (jetconstitP4.Pt()==0.0) { m_fCharged->push_back(-999); }else { m_fCharged->push_back( sumPtChargedPFO500( *jet)[pvLocation] / jetconstitP4.Pt()); } } else { m_SumPtChargedPFOPt500PV->push_back(-999); m_fCharged->push_back(-999); } } static SG::AuxElement::ConstAccessor< float > jvt ("Jvt"); safeFill(jet, jvt, m_Jvt, -999); // static SG::AuxElement::ConstAccessor ghostTrackAssFrac("GhostTrackAssociationFraction"); // if ( ghostTrackAssFrac.isAvailable( *jet) ) { // m_ghostTrackAssFrac->push_back( ghostTrackAssFrac( *jet) ); // } else { m_ghostTrackAssFrac->push_back( -999 ) ; } } // trackPV || chargedPFOPV || JVT if (m_infoSwitch.m_fJvt) { static SG::AuxElement::ConstAccessor< float > fJvt ("DFCommonJets_fJvt"); safeFill(jet, fJvt, m_fJvt, -999); } if (m_infoSwitch.m_NNJvt) { static SG::AuxElement::ConstAccessor< float > NNJvt ("NNJvt"); static SG::AuxElement::ConstAccessor< char > NNJvtPass ("NNJvtPass"); safeFill(jet, NNJvt, m_NNJvt, -999); safeFill(jet, NNJvtPass, m_NNJvtPass, 0); } if ( m_infoSwitch.m_clean && pvLocation >= 0 ) { static SG::AuxElement::ConstAccessor< float > ChargedFraction("ChargedFraction"); static SG::AuxElement::Decorator< float > chargedFractionDecor("ChargedFraction"); if ( !chargedFractionDecor.isAvailable( *jet ) ) { // calculate and decorate if ( sumPt500.isAvailable( *jet ) ) { m_ChargedFraction->push_back( sumPt500( *jet )[pvLocation] / jet->pt() ); // units cancel out } else { m_ChargedFraction->push_back( -999. ); } chargedFractionDecor( *jet ) = m_ChargedFraction->back(); } else { safeFill(jet, ChargedFraction, m_ChargedFraction, -999); } } // clean } // trackAll || trackPV || JVT static SG::AuxElement::ConstAccessor< char > jvtPass_Loose("JetJVT_Passed_Loose"); static SG::AuxElement::ConstAccessor< char > jvtPass_Medium("JetJVT_Passed_Medium"); static SG::AuxElement::ConstAccessor< char > jvtPass_Tight("JetJVT_Passed_Tight"); static SG::AuxElement::ConstAccessor< char > jvtPass_FixedEffPt("JetJVT_Passed_FixedEffPt"); static SG::AuxElement::ConstAccessor< char > jvtPass_TightFwd("JetJVT_Passed_TightFwd"); static SG::AuxElement::ConstAccessor< char > fjvtPass_Loose("JetfJVT_Passed_Loose"); static SG::AuxElement::ConstAccessor< char > fjvtPass_Medium("JetfJVT_Passed_Medium"); static SG::AuxElement::ConstAccessor< char > fjvtPass_Tight("JetfJVT_Passed_Tight"); static SG::AuxElement::ConstAccessor< std::vector< float > > jvtSF_Loose("JetJvtEfficiency_JVTSyst_JVT_Loose"); static SG::AuxElement::ConstAccessor< std::vector< float > > jvtSF_Medium("JetJvtEfficiency_JVTSyst_JVT_Medium"); static SG::AuxElement::ConstAccessor< std::vector< float > > jvtSF_Tight("JetJvtEfficiency_JVTSyst_JVT_Tight"); static SG::AuxElement::ConstAccessor< std::vector< float > > jvtSF_FixedEffPt("JetJvtEfficiency_JVTSyst_JVT_FixedEffPt"); static SG::AuxElement::ConstAccessor< std::vector< float > > jvtSF_TightFwd("JetJvtEfficiency_JVTSyst_JVT_TightFwd"); static SG::AuxElement::ConstAccessor< std::vector< float > > fjvtSF_Loose("JetJvtEfficiency_fJVTSyst_fJVT_Loose"); static SG::AuxElement::ConstAccessor< std::vector< float > > fjvtSF_Medium("JetJvtEfficiency_fJVTSyst_fJVT_Medium"); static SG::AuxElement::ConstAccessor< std::vector< float > > fjvtSF_Tight("JetJvtEfficiency_fJVTSyst_fJVT_Tight"); std::vector junkSF(1,1.0); if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sfJVTName == "Loose" ) { safeFill(jet, jvtPass_Loose, m_JvtPass_Loose, -1); if ( m_mc ) { if ( jvtSF_Loose.isAvailable( *jet ) ) { m_JvtEff_SF_Loose->push_back( jvtSF_Loose( *jet ) ); } else { m_JvtEff_SF_Loose->push_back( junkSF ); } } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sfJVTName == "Medium" ) { safeFill(jet, jvtPass_Medium, m_JvtPass_Medium, -1); if ( m_mc ) { if ( jvtSF_Medium.isAvailable( *jet ) ) { m_JvtEff_SF_Medium->push_back( jvtSF_Medium( *jet ) ); } else { m_JvtEff_SF_Medium->push_back( junkSF ); } } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sfJVTName == "Tight" ) { safeFill(jet, jvtPass_Tight, m_JvtPass_Tight, -1); if ( m_mc ) { if ( jvtSF_Tight.isAvailable( *jet ) ) { m_JvtEff_SF_Tight->push_back( jvtSF_Tight( *jet ) ); } else { m_JvtEff_SF_Tight->push_back( junkSF ); } } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sfJVTName == "FixedEffPt" ) { safeFill(jet, jvtPass_FixedEffPt, m_JvtPass_FixedEffPt, -1); if ( m_mc ) { if ( jvtSF_FixedEffPt.isAvailable( *jet ) ) { m_JvtEff_SF_FixedEffPt->push_back( jvtSF_FixedEffPt( *jet ) ); } else { m_JvtEff_SF_FixedEffPt->push_back( junkSF ); } } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sfJVTName == "TightFwd" ) { safeFill(jet, jvtPass_TightFwd, m_JvtPass_TightFwd, -1); if ( m_mc ) { if ( jvtSF_TightFwd.isAvailable( *jet ) ) { m_JvtEff_SF_TightFwd->push_back( jvtSF_TightFwd( *jet ) ); } else { m_JvtEff_SF_TightFwd->push_back( junkSF ); } } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sffJVTName == "Loose" ) { safeFill(jet, fjvtPass_Loose, m_fJvtPass_Loose, -1); if ( m_mc ) { if ( fjvtSF_Loose.isAvailable( *jet ) ) { m_fJvtEff_SF_Loose->push_back( fjvtSF_Loose( *jet ) ); } else { m_fJvtEff_SF_Loose->push_back( junkSF ); } } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sffJVTName == "Medium" ) { safeFill(jet, fjvtPass_Medium, m_fJvtPass_Medium, -1); if ( m_mc ) { if ( fjvtSF_Medium.isAvailable( *jet ) ) { m_fJvtEff_SF_Medium->push_back( fjvtSF_Medium( *jet ) ); } else { m_fJvtEff_SF_Medium->push_back( junkSF ); } } } if ( m_infoSwitch.m_trackPV || m_infoSwitch.m_sffJVTName == "Tight" ) { safeFill(jet, fjvtPass_Tight, m_fJvtPass_Tight, -1); if ( m_mc ) { if ( fjvtSF_Tight.isAvailable( *jet ) ) { m_fJvtEff_SF_Tight->push_back( fjvtSF_Tight( *jet ) ); } else { m_fJvtEff_SF_Tight->push_back( junkSF ); } } } if ( m_infoSwitch.m_allTrack ) { static SG::AuxElement::ConstAccessor< int > ghostTrackCount("GhostTrackCount"); safeFill(jet, ghostTrackCount, m_GhostTrackCount, -999); static SG::AuxElement::ConstAccessor< float > ghostTrackPt ("GhostTrackPt"); safeFill(jet, ghostTrackPt, m_GhostTrackPt, -999, m_units); std::vector pt; std::vector qOverP; std::vector eta; std::vector phi; std::vector e; std::vector d0; std::vector z0; std::vector nPixHits; std::vector nSCTHits; std::vector nTRTHits; std::vector nPixSharedHits; std::vector nPixSplitHits; std::vector nIMLPixHits; std::vector nIMLPixSharedHits; std::vector nIMLPixSplitHits; std::vector nNIMLPixHits; std::vector nNIMLPixSharedHits; std::vector nNIMLPixSplitHits; static SG::AuxElement::ConstAccessor< std::vector > > >ghostTrack ("GhostTrack"); if ( ghostTrack.isAvailable( *jet ) ) { std::vector > > trackLinks = ghostTrack( *jet ); //std::vector pt(trackLinks.size(),-999); for ( auto link_itr : trackLinks ) { if( !link_itr.isValid() ) { continue; } const xAOD::TrackParticle* track = dynamic_cast( *link_itr ); // if asking for tracks passing PV selection ( i.e. JVF JVT tracks ) if( m_infoSwitch.m_allTrackPVSel ) { // PV selection from // https://twiki.cern.ch/twiki/bin/view/AtlasProtected/JvtManualRecalculation if( track->pt() < 500 ) { continue; } // pT cut if( !m_trkSelTool->accept(*track,pv) ) { continue; } // ID quality cut // if( track->vertex() != pv ) { // if not in PV vertex fit // if( track->vertex() != 0 ) { continue; } // make sure in no vertex fits // if( fabs((track->z0()+track->vz()-pv->z())*sin(track->theta())) > 3.0 ) { continue; } // make sure close to PV in z // } } pt. push_back( track->pt() / m_units ); qOverP.push_back( track->qOverP() * m_units ); eta.push_back( track->eta() ); phi.push_back( track->phi() ); e. push_back( track->e() / m_units ); d0. push_back( track->d0() ); z0. push_back( track->z0() + track->vz() - pv->z() ); // store z0 wrt PV...most useful if( m_infoSwitch.m_allTrackDetail ) { uint8_t getInt(0); // n pix, sct, trt track->summaryValue( getInt, xAOD::numberOfPixelHits ); nPixHits.push_back( getInt ); track->summaryValue( getInt, xAOD::numberOfSCTHits ); nSCTHits.push_back( getInt ); track->summaryValue( getInt, xAOD::numberOfTRTHits ); nTRTHits.push_back( getInt ); // pixel split shared track->summaryValue( getInt, xAOD::numberOfPixelSharedHits ); nPixSharedHits.push_back( getInt ); track->summaryValue( getInt, xAOD::numberOfPixelSplitHits ); nPixSplitHits.push_back( getInt ); // n ibl, split, shared track->summaryValue( getInt, xAOD::numberOfInnermostPixelLayerHits ); nIMLPixHits.push_back( getInt ); track->summaryValue( getInt, xAOD::numberOfInnermostPixelLayerSharedHits ); nIMLPixSharedHits.push_back( getInt ); track->summaryValue( getInt, xAOD::numberOfInnermostPixelLayerSplitHits ); nIMLPixSplitHits.push_back( getInt ); // n bl, split, shared track->summaryValue( getInt, xAOD::numberOfNextToInnermostPixelLayerHits ); nNIMLPixHits.push_back( getInt ); track->summaryValue( getInt, xAOD::numberOfNextToInnermostPixelLayerSharedHits ); nNIMLPixSharedHits.push_back( getInt ); track->summaryValue( getInt, xAOD::numberOfNextToInnermostPixelLayerSplitHits ); nNIMLPixSplitHits.push_back( getInt ); } } } // if ghostTrack available m_GhostTrack_pt-> push_back( pt ); m_GhostTrack_qOverP-> push_back( qOverP ); m_GhostTrack_eta->push_back( eta ); m_GhostTrack_phi->push_back( phi ); m_GhostTrack_e-> push_back( e ); m_GhostTrack_d0-> push_back( d0 ); m_GhostTrack_z0-> push_back( z0 ); if( m_infoSwitch.m_allTrackDetail ) { m_GhostTrack_nPixelHits->push_back( nPixHits ); m_GhostTrack_nSCTHits->push_back( nSCTHits ); m_GhostTrack_nTRTHits->push_back( nTRTHits ); m_GhostTrack_nPixelSharedHits->push_back( nPixSharedHits ); m_GhostTrack_nPixelSplitHits->push_back( nPixSplitHits ); m_GhostTrack_nInnermostPixelLayerHits->push_back( nIMLPixHits ); m_GhostTrack_nInnermostPixelLayerSharedHits->push_back( nIMLPixSharedHits ); m_GhostTrack_nInnermostPixelLayerSplitHits->push_back( nIMLPixSplitHits ); m_GhostTrack_nNextToInnermostPixelLayerHits->push_back( nNIMLPixHits ); m_GhostTrack_nNextToInnermostPixelLayerSharedHits->push_back( nNIMLPixSharedHits ); m_GhostTrack_nNextToInnermostPixelLayerSplitHits->push_back( nNIMLPixSplitHits ); } } // allTrack switch if( m_infoSwitch.m_constituent ) { m_numConstituents->push_back( jet->numConstituents() ); } if( m_infoSwitch.m_constituentAll ) { m_constituentWeights->push_back( jet->getAttribute< std::vector >( "constituentWeights" ) ); std::vector pt; std::vector eta; std::vector phi; std::vector e; xAOD::JetConstituentVector consVec = jet->getConstituents(); if( consVec.isValid() ) { // don't use auto since iterator can also set the scale ... // not sure what that does with auto - probably default but just incase // use the example provided in // http://acode-browser.usatlas.bnl.gov/lxr/source/atlas/Event/xAOD/xAODJet/xAODJet/JetConstituentVector.h xAOD::JetConstituentVector::iterator constit = consVec.begin(); xAOD::JetConstituentVector::iterator constitE = consVec.end(); for( ; constit != constitE; constit++){ pt. push_back( constit->pt() / m_units ); eta.push_back( constit->eta() ); phi.push_back( constit->phi() ); e. push_back( constit->e() / m_units ); } } m_constituent_pt-> push_back( pt ); m_constituent_eta->push_back( eta ); m_constituent_phi->push_back( phi ); m_constituent_e-> push_back( e ); } if ( m_infoSwitch.m_flavorTag || m_infoSwitch.m_flavorTagHLT || m_infoSwitch.m_flavorTagTLA ) { // flavor groups truth definition static SG::AuxElement::ConstAccessor hadConeExclTruthLabel("HadronConeExclTruthLabelID"); safeFill(jet, hadConeExclTruthLabel, m_HadronConeExclTruthLabelID, -999); static SG::AuxElement::ConstAccessor hadConeExclExtendedTruthLabel("HadronConeExclExtendedTruthLabelID"); safeFill(jet, hadConeExclExtendedTruthLabel, m_HadronConeExclExtendedTruthLabelID, -999); } if ( m_infoSwitch.m_flavorTag || m_infoSwitch.m_flavorTagHLT ) { const xAOD::BTagging * myBTag(0); if(m_infoSwitch.m_flavorTag){ myBTag = xAOD::BTaggingUtilities::getBTagging(*jet); }else if(m_infoSwitch.m_flavorTagHLT){ myBTag = jet->auxdata< const xAOD::BTagging* >("HLTBTag"); } if(m_infoSwitch.m_JVC ) { static SG::AuxElement::ConstAccessor JetVertexCharge_discriminant("JetVertexCharge_discriminant"); safeFill(myBTag, JetVertexCharge_discriminant, m_JetVertexCharge_discriminant, -999); } float pu, pb, pc, ptau, score; pu=0; pb=0; pc=0; myBTag->variable("DL1r" , "pu", pu); myBTag->variable("DL1r" , "pc", pc); myBTag->variable("DL1r" , "pb", pb); //FixMe: Retrieve the correct f_c value from the CDI file would be the best approach score=log( pb / (0.018*pc+0.982*pu) ); m_DL1r_pu->push_back(pu); m_DL1r_pc->push_back(pc); m_DL1r_pb->push_back(pb); m_DL1r->push_back( score ); pu=0; pb=0; pc=0; myBTag->variable("DL1dv00" , "pu", pu); myBTag->variable("DL1dv00" , "pc", pc); myBTag->variable("DL1dv00" , "pb", pb); //FixMe: Retrieve the correct f_c value from the CDI file would be the best approach score=log( pb / (0.018*pc+0.982*pu) ); m_DL1dv00_pu->push_back(pu); m_DL1dv00_pc->push_back(pc); m_DL1dv00_pb->push_back(pb); m_DL1dv00->push_back( score ); pu=0; pb=0; pc=0; myBTag->variable("DL1dv01" , "pu", pu); myBTag->variable("DL1dv01" , "pc", pc); myBTag->variable("DL1dv01" , "pb", pb); //FixMe: Retrieve the correct f_c value from the CDI file would be the best approach score=log( pb / (0.018*pc+0.982*pu) ); m_DL1dv01_pu->push_back(pu); m_DL1dv01_pc->push_back(pc); m_DL1dv01_pb->push_back(pb); m_DL1dv01->push_back( score ); pu=0; pb=0; pc=0; myBTag->variable("GN120220509" , "pu", pu); myBTag->variable("GN120220509" , "pc", pc); myBTag->variable("GN120220509" , "pb", pb); //FixMe: Retrieve the correct f_c value from the CDI file would be the best approach score=log( pb / (0.05*pc+0.95*pu) ); // GN1 uses a different f_c value than DL1d which is 0.05 m_GN1_pu->push_back(pu); m_GN1_pc->push_back(pc); m_GN1_pb->push_back(pb); m_GN1->push_back( score ); pu=0; pb=0; pc=0; myBTag->variable("GN2v00LegacyWP" , "pu", pu); myBTag->variable("GN2v00LegacyWP" , "pc", pc); myBTag->variable("GN2v00LegacyWP" , "pb", pb); //FixMe: Retrieve the correct f_c value from the CDI file would be the best approach score=log( pb / (0.10*pc+0.90*pu) ); // GN2 uses a different f_c value than DL1d which is 0.01 m_GN2v00LegacyWP_pu->push_back(pu); m_GN2v00LegacyWP_pc->push_back(pc); m_GN2v00LegacyWP_pb->push_back(pb); m_GN2v00LegacyWP->push_back( score ); pu=0; pb=0; pc=0; myBTag->variable("GN2v00NewAliasWP" , "pu", pu); myBTag->variable("GN2v00NewAliasWP" , "pc", pc); myBTag->variable("GN2v00NewAliasWP" , "pb", pb); //FixMe: Retrieve the correct f_c value from the CDI file would be the best approach score=log( pb / (0.10*pc+0.90*pu) ); // GN2 uses a different f_c value than DL1d which is 0.01 m_GN2v00NewAliasWP_pu->push_back(pu); m_GN2v00NewAliasWP_pc->push_back(pc); m_GN2v00NewAliasWP_pb->push_back(pb); m_GN2v00NewAliasWP->push_back( score ); pu=0; pb=0; pc=0; ptau=0; myBTag->variable("GN2v01" , "pu", pu); myBTag->variable("GN2v01" , "pc", pc); myBTag->variable("GN2v01" , "pb", pb); myBTag->variable("GN2v01" , "ptau", ptau); //FixMe: Retrieve the correct f_c value from the CDI file would be the best approach score=log( pb / (0.20*pc+0.01*ptau+0.79*pu) ); // GN2v01 uses a different f_c value than DL1dv01 which is 0.018 m_GN2v01_pu->push_back(pu); m_GN2v01_pc->push_back(pc); m_GN2v01_pb->push_back(pb); m_GN2v01_ptau->push_back(ptau); m_GN2v01->push_back( score ); if(m_infoSwitch.m_jetFitterDetails ) { static SG::AuxElement::ConstAccessor< int > jf_nVTXAcc ("JetFitter_nVTX"); safeFill(myBTag, jf_nVTXAcc, m_JetFitter_nVTX, -999); static SG::AuxElement::ConstAccessor< int > jf_nSingleTracks ("JetFitter_nSingleTracks"); safeFill(myBTag, jf_nSingleTracks, m_JetFitter_nSingleTracks, -999); static SG::AuxElement::ConstAccessor< int > jf_nTracksAtVtx ("JetFitter_nTracksAtVtx"); safeFill(myBTag, jf_nTracksAtVtx, m_JetFitter_nTracksAtVtx, -999); static SG::AuxElement::ConstAccessor< float > jf_mass ("JetFitter_mass"); safeFill(myBTag, jf_mass, m_JetFitter_mass, -999); static SG::AuxElement::ConstAccessor< float > jf_energyFraction("JetFitter_energyFraction"); safeFill(myBTag, jf_energyFraction, m_JetFitter_energyFraction, -999); static SG::AuxElement::ConstAccessor< float > jf_significance3d("JetFitter_significance3d"); safeFill(myBTag, jf_significance3d, m_JetFitter_significance3d, -999); static SG::AuxElement::ConstAccessor< float > jf_deltaeta ("JetFitter_deltaeta"); safeFill(myBTag, jf_deltaeta, m_JetFitter_deltaeta, -999); static SG::AuxElement::ConstAccessor< float > jf_deltaphi ("JetFitter_deltaphi"); safeFill(myBTag, jf_deltaphi, m_JetFitter_deltaphi, -999); static SG::AuxElement::ConstAccessor< int > jf_N2Tpar ("JetFitter_N2Tpair"); safeFill(myBTag, jf_N2Tpar, m_JetFitter_N2Tpar, -999); //static SG::AuxElement::ConstAccessor< double > jf_pb ("JetFitterCombNN_pb"); //safeFill(myBTag, jf_pb, m_JetFitter_pb, -999); // //static SG::AuxElement::ConstAccessor< double > jf_pc ("JetFitterCombNN_pc"); //safeFill(myBTag, jf_pc, m_JetFitter_pc, -999); // //static SG::AuxElement::ConstAccessor< double > jf_pu ("JetFitterCombNN_pu"); //safeFill(myBTag, jf_pu, m_JetFitter_pu, -999); } if(m_infoSwitch.m_svDetails ) { if(m_debug) std::cout << "Filling m_svDetails " << std::endl; static SG::AuxElement::ConstAccessor< int > sv0_NGTinSvxAcc ("SV0_NGTinSvx"); safeFill(myBTag, sv0_NGTinSvxAcc, m_sv0_NGTinSvx, -999); // @brief SV0 : Number of 2-track pairs static SG::AuxElement::ConstAccessor< int > sv0_N2TpairAcc ("SV0_N2Tpair"); safeFill(myBTag, sv0_N2TpairAcc, m_sv0_N2Tpair, -999); static SG::AuxElement::ConstAccessor< float > sv0_masssvxAcc ("SV0_masssvx"); safeFill(myBTag, sv0_masssvxAcc, m_sv0_massvx, -999); static SG::AuxElement::ConstAccessor< float > sv0_efracsvxAcc ("SV0_efracsvx"); safeFill(myBTag, sv0_efracsvxAcc, m_sv0_efracsvx, -999); static SG::AuxElement::ConstAccessor< float > sv0_normdistAcc ("SV0_normdist"); safeFill(myBTag, sv0_normdistAcc, m_sv0_normdist, -999); double sv0; myBTag->variable("SV0", "significance3D", sv0); m_SV0->push_back(sv0); m_SV1IP3D->push_back( myBTag -> SV1plusIP3D_discriminant() ); double w=(myBTag->IP3D_pb()/myBTag->IP3D_pu()) * (myBTag->SV1_pb()/myBTag->SV1_pu()); double x=50; if(w/(1+w)<1) x=-1.0*TMath::Log10(1-(w/(1+w))); m_COMBx->push_back(x); static SG::AuxElement::ConstAccessor< int > sv1_NGTinSvxAcc ("SV1_NGTinSvx"); safeFill(myBTag, sv1_NGTinSvxAcc, m_sv1_NGTinSvx, -999); // @brief SV1 : Number of 2-track pairs static SG::AuxElement::ConstAccessor< int > sv1_N2TpairAcc ("SV1_N2Tpair"); safeFill(myBTag, sv1_N2TpairAcc, m_sv1_N2Tpair, -999); static SG::AuxElement::ConstAccessor< float > sv1_masssvxAcc ("SV1_masssvx"); safeFill(myBTag, sv1_masssvxAcc, m_sv1_massvx, -999); static SG::AuxElement::ConstAccessor< float > sv1_efracsvxAcc ("SV1_efracsvx"); safeFill(myBTag, sv1_efracsvxAcc, m_sv1_efracsvx, -999); static SG::AuxElement::ConstAccessor< float > sv1_normdistAcc ("SV1_normdist"); safeFill(myBTag, sv1_normdistAcc, m_sv1_normdist, -999); double sv1_pu = -30; myBTag->variable("SV1", "pu", sv1_pu); double sv1_pb = -30; myBTag->variable("SV1", "pb", sv1_pb); double sv1_pc = -30; myBTag->variable("SV1", "pc", sv1_pc); m_sv1_pu ->push_back(sv1_pu); m_sv1_pb ->push_back(sv1_pb); m_sv1_pc ->push_back(sv1_pc); m_SV1 ->push_back( myBTag->calcLLR(sv1_pb,sv1_pu) ); m_sv1_c ->push_back( myBTag->calcLLR(sv1_pb,sv1_pc) ); m_sv1_cu ->push_back( myBTag->calcLLR(sv1_pc,sv1_pu) ); float sv1_Lxy; myBTag->variable("SV1", "Lxy" , sv1_Lxy); float sv1_sig3d; myBTag->variable("SV1", "significance3d" , sv1_sig3d); float sv1_L3d; myBTag->variable("SV1", "L3d" , sv1_L3d); float sv1_distmatlay; myBTag->variable("SV1", "dstToMatLay" , sv1_distmatlay); float sv1_dR; myBTag->variable("SV1", "deltaR" , sv1_dR ); m_sv1_Lxy ->push_back(sv1_Lxy ); m_sv1_sig3d ->push_back(sv1_sig3d ); m_sv1_L3d ->push_back(sv1_L3d ); m_sv1_distmatlay ->push_back(sv1_distmatlay ); m_sv1_dR ->push_back(sv1_dR ); } if(m_infoSwitch.m_ipDetails ) { if(m_debug) std::cout << "Filling m_ipDetails " << std::endl; // // IP2D // static SG::AuxElement::ConstAccessor< std::vector > IP2D_gradeOfTracksAcc ("IP2D_gradeOfTracks"); safeVecFill(myBTag, IP2D_gradeOfTracksAcc, m_IP2D_gradeOfTracks); static SG::AuxElement::ConstAccessor< std::vector > IP2D_flagFromV0ofTracksAcc("IP2D_flagFromV0ofTracks"); safeVecFill(myBTag, IP2D_flagFromV0ofTracksAcc, m_IP2D_flagFromV0ofTracks); static SG::AuxElement::ConstAccessor< std::vector > IP2D_valD0wrtPVofTracksAcc("IP2D_valD0wrtPVofTracks"); safeVecFill(myBTag, IP2D_valD0wrtPVofTracksAcc, m_IP2D_valD0wrtPVofTracks); static SG::AuxElement::ConstAccessor< std::vector > IP2D_sigD0wrtPVofTracksAcc("IP2D_sigD0wrtPVofTracks"); safeVecFill(myBTag, IP2D_sigD0wrtPVofTracksAcc, m_IP2D_sigD0wrtPVofTracks); static SG::AuxElement::ConstAccessor< std::vector > IP2D_weightBofTracksAcc ("IP2D_weightBofTracks"); safeVecFill(myBTag, IP2D_weightBofTracksAcc, m_IP2D_weightBofTracks); static SG::AuxElement::ConstAccessor< std::vector > IP2D_weightCofTracksAcc ("IP2D_weightCofTracks"); safeVecFill(myBTag, IP2D_weightCofTracksAcc, m_IP2D_weightCofTracks); static SG::AuxElement::ConstAccessor< std::vector > IP2D_weightUofTracksAcc ("IP2D_weightUofTracks"); safeVecFill(myBTag, IP2D_weightUofTracksAcc, m_IP2D_weightUofTracks); double ip2_pu = -99; myBTag->variable("IP2D", "pu", ip2_pu); double ip2_pb = -99; myBTag->variable("IP2D", "pb", ip2_pb); double ip2_pc = -99; myBTag->variable("IP2D", "pc", ip2_pc); m_IP2D_pu ->push_back(ip2_pu); m_IP2D_pb ->push_back(ip2_pb); m_IP2D_pc ->push_back(ip2_pc); m_IP2D ->push_back( myBTag->calcLLR(ip2_pb,ip2_pu) ); m_IP2D_c ->push_back( myBTag->calcLLR(ip2_pb,ip2_pc) ); m_IP2D_cu ->push_back( myBTag->calcLLR(ip2_pc,ip2_pu) ); // // IP3D // static SG::AuxElement::ConstAccessor< std::vector > IP3D_gradeOfTracksAcc ("IP3D_gradeOfTracks"); safeVecFill(myBTag, IP3D_gradeOfTracksAcc, m_IP3D_gradeOfTracks); static SG::AuxElement::ConstAccessor< std::vector > IP3D_flagFromV0ofTracksAcc("IP3D_flagFromV0ofTracks"); safeVecFill(myBTag, IP3D_flagFromV0ofTracksAcc, m_IP3D_flagFromV0ofTracks); static SG::AuxElement::ConstAccessor< std::vector > IP3D_valD0wrtPVofTracksAcc("IP3D_valD0wrtPVofTracks"); safeVecFill(myBTag, IP3D_valD0wrtPVofTracksAcc, m_IP3D_valD0wrtPVofTracks); static SG::AuxElement::ConstAccessor< std::vector > IP3D_sigD0wrtPVofTracksAcc("IP3D_sigD0wrtPVofTracks"); safeVecFill(myBTag, IP3D_sigD0wrtPVofTracksAcc, m_IP3D_sigD0wrtPVofTracks); static SG::AuxElement::ConstAccessor< std::vector > IP3D_valZ0wrtPVofTracksAcc("IP3D_valZ0wrtPVofTracks"); safeVecFill(myBTag, IP3D_valZ0wrtPVofTracksAcc, m_IP3D_valZ0wrtPVofTracks); static SG::AuxElement::ConstAccessor< std::vector > IP3D_sigZ0wrtPVofTracksAcc("IP3D_sigZ0wrtPVofTracks"); safeVecFill(myBTag, IP3D_sigZ0wrtPVofTracksAcc, m_IP3D_sigZ0wrtPVofTracks); static SG::AuxElement::ConstAccessor< std::vector > IP3D_weightBofTracksAcc ("IP3D_weightBofTracks"); safeVecFill(myBTag, IP3D_weightBofTracksAcc, m_IP3D_weightBofTracks); static SG::AuxElement::ConstAccessor< std::vector > IP3D_weightCofTracksAcc ("IP3D_weightCofTracks"); safeVecFill(myBTag, IP3D_weightCofTracksAcc, m_IP3D_weightCofTracks); static SG::AuxElement::ConstAccessor< std::vector > IP3D_weightUofTracksAcc ("IP3D_weightUofTracks"); safeVecFill(myBTag, IP3D_weightUofTracksAcc, m_IP3D_weightUofTracks); double ip3_pu = -30; myBTag->variable("IP3D", "pu", ip3_pu); double ip3_pb = -30; myBTag->variable("IP3D", "pb", ip3_pb); double ip3_pc = -30; myBTag->variable("IP3D", "pc", ip3_pc); m_IP3D_pu ->push_back(ip3_pu ); m_IP3D_pb ->push_back(ip3_pb ); m_IP3D_pc ->push_back(ip3_pc ); m_IP3D ->push_back( myBTag->calcLLR(ip3_pb,ip3_pu) ); m_IP3D_c ->push_back( myBTag->calcLLR(ip3_pb,ip3_pc) ); m_IP3D_cu ->push_back( myBTag->calcLLR(ip3_pc,ip3_pu) ); } if(m_infoSwitch.m_flavorTagHLT ) { if(m_debug) std::cout << "Filling m_flavorTagHLT " << std::endl; const xAOD::Vertex *online_pvx = jet->auxdata("HLTBJetTracks_vtx"); const xAOD::Vertex *online_pvx_bkg = jet->auxdata("HLTBJetTracks_vtx_bkg"); const xAOD::Vertex *offline_pvx = jet->auxdata("offline_vtx"); if(online_pvx) m_vtxOnlineValid->push_back(1.0); else m_vtxOnlineValid->push_back(0.0); char hadDummyPV = jet->auxdata< char >("hadDummyPV"); if( hadDummyPV == '0') m_vtxHadDummy->push_back(0.0); if( hadDummyPV == '1') m_vtxHadDummy->push_back(1.0); if( hadDummyPV == '2') m_vtxHadDummy->push_back(2.0); static SG::AuxElement::ConstAccessor< float > acc_bs_online_vs ("bs_online_vz"); if(acc_bs_online_vs.isAvailable( *jet) ){ if(m_debug) std::cout << "Have bs_online_vz " << std::endl; float bs_online_vz = jet->auxdata< float >("bs_online_vz"); //std::cout << "**bs_online_vz " << bs_online_vz << std::endl; m_bs_online_vz->push_back( bs_online_vz ); float bs_online_vx = jet->auxdata< float >("bs_online_vx"); //std::cout << "**bs_online_vx " << bs_online_vx << std::endl; m_bs_online_vx->push_back( bs_online_vx ); float bs_online_vy = jet->auxdata< float >("bs_online_vy"); //std::cout << "**bs_online_vy " << bs_online_vy << std::endl; m_bs_online_vy->push_back( bs_online_vy ); }else{ m_bs_online_vz->push_back( -999 ); m_bs_online_vx->push_back( -999 ); m_bs_online_vy->push_back( -999 ); } if(m_debug) std::cout << "Filling m_vtx_offline " << std::endl; if(offline_pvx){ m_vtx_offline_x0->push_back( offline_pvx->x() ); m_vtx_offline_y0->push_back( offline_pvx->y() ); m_vtx_offline_z0->push_back( offline_pvx->z() ); }else{ m_vtx_offline_x0->push_back( -999 ); m_vtx_offline_y0->push_back( -999 ); m_vtx_offline_z0->push_back( -999 ); } if(m_debug) std::cout << "Done Filling m_vtx_offline " << std::endl; if(m_debug) std::cout << "Filling m_vtx_online... " << std::endl; if(online_pvx){ if(m_debug) std::cout << " ... online_pvx valid " << std::endl; m_vtx_online_x0->push_back( online_pvx->x() ); m_vtx_online_y0->push_back( online_pvx->y() ); m_vtx_online_z0->push_back( online_pvx->z() ); }else{ m_vtx_online_x0->push_back( -999 ); m_vtx_online_y0->push_back( -999 ); m_vtx_online_z0->push_back( -999 ); } if(m_debug) std::cout << "Filling m_vtx_online... " << std::endl; if(online_pvx_bkg){ if(m_debug) std::cout << " ...online_pvx_bkg valid " << std::endl; m_vtx_online_bkg_x0->push_back( online_pvx_bkg->x() ); m_vtx_online_bkg_y0->push_back( online_pvx_bkg->y() ); m_vtx_online_bkg_z0->push_back( online_pvx_bkg->z() ); }else{ m_vtx_online_bkg_x0->push_back( -999 ); m_vtx_online_bkg_y0->push_back( -999 ); m_vtx_online_bkg_z0->push_back( -999 ); } }// m_flavorTagHLT if(m_debug) std::cout << "Done m_flavorTagHLT " << std::endl; } if (m_infoSwitch.m_flavorTagTLA){ if(m_debug) std::cout << "Filling m_flavorTagHLT " << std::endl; float pu=0, pb=0, pc=0, score=0; pu = jet->auxdata( "fastDIPS20211215_pu" ); pc = jet->auxdata( "fastDIPS20211215_pc" ); pb = jet->auxdata( "fastDIPS20211215_pb" ); //FixMe: Retrieve the correct f_c value from the CDI file would be the best approach score=log( pb / (0.018*pc+0.982*pu) ); m_fastDIPS_pu->push_back( pu ); m_fastDIPS_pc->push_back( pc ); m_fastDIPS_pb->push_back( pb ); m_fastDIPS->push_back( score ); if(m_debug) std::cout << "Done m_flavorTagTLA " << std::endl; } if( !m_infoSwitch.m_jetBTag.empty() || !m_infoSwitch.m_jetBTagCts.empty() ) { for(auto btag : m_btags) btag->Fill( jet ); } // jetBTag if ( m_infoSwitch.m_area ) { static SG::AuxElement::ConstAccessor ghostArea("JetGhostArea"); safeFill(jet, ghostArea, m_GhostArea, -999); static SG::AuxElement::ConstAccessor activeArea("ActiveArea"); safeFill(jet, activeArea, m_ActiveArea, -999); static SG::AuxElement::ConstAccessor voronoiArea("VoronoiArea"); safeFill(jet, voronoiArea, m_VoronoiArea, -999); static SG::AuxElement::ConstAccessor activeArea_pt("ActiveArea4vec_pt"); safeFill(jet, activeArea_pt, m_ActiveArea4vec_pt, -999); static SG::AuxElement::ConstAccessor activeArea_eta("ActiveArea4vec_eta"); safeFill(jet, activeArea_eta, m_ActiveArea4vec_eta, -999); static SG::AuxElement::ConstAccessor activeArea_phi("ActiveArea4vec_phi"); safeFill(jet, activeArea_phi, m_ActiveArea4vec_phi, -999); static SG::AuxElement::ConstAccessor activeArea_m("ActiveArea4vec_m"); safeFill(jet, activeArea_m, m_ActiveArea4vec_m, -999); } if ( m_infoSwitch.m_truth && m_mc ) { static SG::AuxElement::ConstAccessor ConeTruthLabelID ("ConeTruthLabelID"); safeFill(jet, ConeTruthLabelID, m_ConeTruthLabelID, -999); static SG::AuxElement::ConstAccessor TruthCount ("TruthCount"); safeFill(jet, TruthCount, m_TruthCount, -999); // seems to be empty // static SG::AuxElement::ConstAccessor TruthPt ("TruthPt"); // if ( TruthPt.isAvailable( *jet) ) { // m_truthPt->push_back( TruthPt( *jet)/1000 ); // } else { m_truthPt->push_back( -999 ); } static SG::AuxElement::ConstAccessor TruthLabelDeltaR_B ("TruthLabelDeltaR_B"); safeFill(jet, TruthLabelDeltaR_B, m_TruthLabelDeltaR_B, -999); static SG::AuxElement::ConstAccessor TruthLabelDeltaR_C ("TruthLabelDeltaR_C"); safeFill(jet, TruthLabelDeltaR_C, m_TruthLabelDeltaR_C, -999); static SG::AuxElement::ConstAccessor TruthLabelDeltaR_T ("TruthLabelDeltaR_T"); safeFill(jet, TruthLabelDeltaR_T, m_TruthLabelDeltaR_T, -999); static SG::AuxElement::ConstAccessor partonLabel("PartonTruthLabelID"); safeFill(jet, partonLabel, m_PartonTruthLabelID, -999); static SG::AuxElement::ConstAccessor ghostTruthAssFrac("GhostTruthAssociationFraction"); safeFill(jet, ghostTruthAssFrac, m_GhostTruthAssociationFraction, -999); const xAOD::Jet* truthJet = HelperFunctions::getLink( jet, "GhostTruthAssociationLink" ); if(truthJet) { m_truth_pt->push_back ( truthJet->pt() / m_units ); m_truth_eta->push_back( truthJet->eta() ); m_truth_phi->push_back( truthJet->phi() ); m_truth_E->push_back ( truthJet->e() / m_units ); } else { m_truth_pt->push_back ( -999 ); m_truth_eta->push_back( -999 ); m_truth_phi->push_back( -999 ); m_truth_E->push_back ( -999 ); } } if ( m_infoSwitch.m_truthDetails ) { // // B-Hadron Details // static SG::AuxElement::ConstAccessor GhostBHadronsFinalCount ("GhostBHadronsFinalCount"); safeFill(jet, GhostBHadronsFinalCount, m_GhostBHadronsFinalCount, -999); static SG::AuxElement::ConstAccessor GhostBHadronsInitialCount ("GhostBHadronsInitialCount"); safeFill(jet, GhostBHadronsInitialCount, m_GhostBHadronsInitialCount, -999); static SG::AuxElement::ConstAccessor GhostBQuarksFinalCount ("GhostBQuarksFinalCount"); safeFill(jet, GhostBQuarksFinalCount, m_GhostBQuarksFinalCount, -999); static SG::AuxElement::ConstAccessor GhostBHadronsFinalPt ("GhostBHadronsFinalPt"); safeFill(jet, GhostBHadronsFinalPt, m_GhostBHadronsFinalPt, -999); static SG::AuxElement::ConstAccessor GhostBHadronsInitialPt ("GhostBHadronsInitialPt"); safeFill(jet, GhostBHadronsInitialPt, m_GhostBHadronsInitialPt, -999); static SG::AuxElement::ConstAccessor GhostBQuarksFinalPt ("GhostBQuarksFinalPt"); safeFill(jet, GhostBQuarksFinalPt, m_GhostBQuarksFinalPt, -999); // // C-Hadron Details // static SG::AuxElement::ConstAccessor GhostCHadronsFinalCount ("GhostCHadronsFinalCount"); safeFill(jet, GhostCHadronsFinalCount, m_GhostCHadronsFinalCount, -999); static SG::AuxElement::ConstAccessor GhostCHadronsInitialCount ("GhostCHadronsInitialCount"); safeFill(jet, GhostCHadronsInitialCount, m_GhostCHadronsInitialCount, -999); static SG::AuxElement::ConstAccessor GhostCQuarksFinalCount ("GhostCQuarksFinalCount"); safeFill(jet, GhostCQuarksFinalCount, m_GhostCQuarksFinalCount, -999); static SG::AuxElement::ConstAccessor GhostCHadronsFinalPt ("GhostCHadronsFinalPt"); safeFill(jet, GhostCHadronsFinalPt, m_GhostCHadronsFinalPt, -999); static SG::AuxElement::ConstAccessor GhostCHadronsInitialPt ("GhostCHadronsInitialPt"); safeFill(jet, GhostCHadronsInitialPt, m_GhostCHadronsInitialPt, -999); static SG::AuxElement::ConstAccessor GhostCQuarksFinalPt ("GhostCQuarksFinalPt"); safeFill(jet, GhostCQuarksFinalPt, m_GhostCQuarksFinalPt, -999); // // Tau Details // static SG::AuxElement::ConstAccessor GhostTausFinalCount ("GhostTausFinalCount"); safeFill(jet, GhostTausFinalCount, m_GhostTausFinalCount, -999); // THE ONLY UN-OFFICIAL PIECE OF CODE HERE USE WITH CAUTION static SG::AuxElement::ConstAccessor GhostTausFinalPt ("GhostTausFinalPt"); safeFill(jet, GhostTausFinalPt, m_GhostTausFinalPt, -999); // light quark(1,2,3) , gluon (21 or 9), charm(4) and b(5) // GhostPartons should select for these pdgIds only // static SG::AuxElement::ConstAccessor< std::vector > ghostPartons("GhostPartons"); // if( ghostPartons.isAvailable( *jet )) { // std::vector truthPartons = ghostPartons( *jet ); std::vector truthPartons = jet->getAssociatedObjects("GhostPartons"); if( truthPartons.size() == 0){ m_truth_pdgId->push_back(-999); } else { int iParent = 0; for(unsigned int i=1; i < truthPartons.size(); ++i){ if( (truthPartons.at(i)->pt() > 0.001) && (truthPartons.at(i)->e() > truthPartons.at(iParent)->e()) ) iParent = i; } m_truth_pdgId->push_back(truthPartons.at(iParent)->pdgId()); m_truth_partonPt->push_back(truthPartons.at(iParent)->pt() / m_units); m_truth_partonDR->push_back(truthPartons.at(iParent)->p4().DeltaR( jet->p4() )); } } if ( m_infoSwitch.m_charge ) { xAOD::JetFourMom_t p4UsedInJetCharge; bool status = jet->getAttribute( "JetPileupScaleMomentum", p4UsedInJetCharge ); static SG::AuxElement::ConstAccessor uncalibratedJetCharge ("Charge"); if(status){ float ptUsedInJetCharge = p4UsedInJetCharge.Pt(); float calibratedJetCharge = jet->pt() ? (ptUsedInJetCharge * uncalibratedJetCharge(*jet) / jet->pt()) : -99; m_charge->push_back(calibratedJetCharge); }else{ m_charge->push_back(-99); } } if ( m_infoSwitch.m_passSel ) { char passSel; bool status = jet->getAttribute( "passSel", passSel ); if(status){ m_passSel->push_back(passSel); }else{ m_passSel->push_back(-99); } } if ( m_infoSwitch.m_passOR ) { char passOR; bool status = jet->getAttribute( "passOR", passOR ); if(status){ m_passOR->push_back(passOR); }else{ m_passOR->push_back(-99); } } return; }