diff --git a/Reconstruction/Jet/JetMonitoring/Root/JetKinematicHistos.cxx b/Reconstruction/Jet/JetMonitoring/Root/JetKinematicHistos.cxx index 9e0b766c9141189402806e8af160c016fee36614..7ea1e32dee6dd68f412887d50c05f9a82457e34d 100644 --- a/Reconstruction/Jet/JetMonitoring/Root/JetKinematicHistos.cxx +++ b/Reconstruction/Jet/JetMonitoring/Root/JetKinematicHistos.cxx @@ -107,26 +107,27 @@ int JetKinematicHistos::fillHistosFromContainer(const xAOD::JetContainer & cont) int JetKinematicHistos::fillHistosFromJet(const xAOD::Jet &j){ - // m_jetScale is a property of the base tool - const xAOD::JetFourMom_t p4 = j.jetP4( (xAOD::JetScale) m_jetScale); - m_pt->Fill( p4.Pt()*toGeV ); - m_eta->Fill( p4.Eta() ); - m_phi->Fill( p4.Phi() ); - if (p4.Pt()*toGeV > 200.0){ // high eta - m_pt_high->Fill( p4.Pt()*toGeV ); - m_eta_high->Fill( p4.Eta() ); - if(m_doE) m_e_high->Fill( p4.E()*toGeV ); - if(m_doM) m_m_high->Fill( p4.M()*toGeV ); - if(m_doNConstit) m_nConstit_high->Fill( j.numConstituents() ); - } - - - if(m_doE) m_e->Fill( p4.E()*toGeV ); - if(m_doM) m_m->Fill( p4.M()*toGeV ); + if(j.isAvailable<float>((m_jetScale)+"_pt")){ + // m_jetScale is a property of the base tool + const xAOD::JetFourMom_t p4 = j.jetP4( (xAOD::JetScale) m_jetScale); + m_pt->Fill( p4.Pt()*toGeV ); + m_eta->Fill( p4.Eta() ); + m_phi->Fill( p4.Phi() ); + if (p4.Pt()*toGeV > 200.0){ // high eta + m_pt_high->Fill( p4.Pt()*toGeV ); + m_eta_high->Fill( p4.Eta() ); + if(m_doE) m_e_high->Fill( p4.E()*toGeV ); + if(m_doM) m_m_high->Fill( p4.M()*toGeV ); + if(m_doNConstit) m_nConstit_high->Fill( j.numConstituents() ); + } + + if(m_doE) m_e->Fill( p4.E()*toGeV ); + if(m_doM) m_m->Fill( p4.M()*toGeV ); - if(m_doOccupancy) m_occupancyEtaPhi->Fill( p4.Eta(), p4.Phi() ); - if(m_doAveragePt) m_averagePtEtaPhi->Fill( p4.Eta(), p4.Phi() , p4.Pt()*toGeV); - if(m_doAverageE) m_averageE_EtaPhi->Fill( p4.Eta(), p4.Phi() , p4.E()*toGeV); + if(m_doOccupancy) m_occupancyEtaPhi->Fill( p4.Eta(), p4.Phi() ); + if(m_doAveragePt) m_averagePtEtaPhi->Fill( p4.Eta(), p4.Phi() , p4.Pt()*toGeV); + if(m_doAverageE) m_averageE_EtaPhi->Fill( p4.Eta(), p4.Phi() , p4.E()*toGeV); + } if(m_doNConstit) m_nConstit->Fill( j.numConstituents() ); return 0;