From 2342f304039bc9f95d42b10dd76bf25909eb7610 Mon Sep 17 00:00:00 2001 From: "A.R.Sahasransu" Date: Fri, 10 Mar 2023 17:53:43 +0100 Subject: [PATCH] Add additional track variables to the Run 3 scouting electron collection for low pT electrons. Co-authored-by: Marino Missiroli --- .../Scouting/interface/Run3ScoutingElectron.h | 50 +++++++++++++------ DataFormats/Scouting/src/classes_def.xml | 32 +++++++++++- .../plugins/HLTScoutingEgammaProducer.cc | 42 ++++++++++++---- 3 files changed, 97 insertions(+), 27 deletions(-) diff --git a/DataFormats/Scouting/interface/Run3ScoutingElectron.h b/DataFormats/Scouting/interface/Run3ScoutingElectron.h index 58857a0e0ac6f..6076b09882f8d 100644 --- a/DataFormats/Scouting/interface/Run3ScoutingElectron.h +++ b/DataFormats/Scouting/interface/Run3ScoutingElectron.h @@ -13,15 +13,19 @@ class Run3ScoutingElectron { float eta, float phi, float m, - float d0, - float dz, + std::vector trkd0, + std::vector trkdz, + std::vector trkpt, + std::vector trketa, + std::vector trkphi, + std::vector trkchi2overndf, float dEtaIn, float dPhiIn, float sigmaIetaIeta, float hOverE, float ooEMOop, int missingHits, - int charge, + std::vector trkcharge, float ecalIso, float hcalIso, float trackIso, @@ -37,15 +41,19 @@ class Run3ScoutingElectron { eta_(eta), phi_(phi), m_(m), - d0_(d0), - dz_(dz), + trkd0_(std::move(trkd0)), + trkdz_(std::move(trkdz)), + trkpt_(std::move(trkpt)), + trketa_(std::move(trketa)), + trkphi_(std::move(trkphi)), + trkchi2overndf_(std::move(trkchi2overndf)), dEtaIn_(dEtaIn), dPhiIn_(dPhiIn), sigmaIetaIeta_(sigmaIetaIeta), hOverE_(hOverE), ooEMOop_(ooEMOop), missingHits_(missingHits), - charge_(charge), + trkcharge_(std::move(trkcharge)), ecalIso_(ecalIso), hcalIso_(hcalIso), trackIso_(trackIso), @@ -63,15 +71,19 @@ class Run3ScoutingElectron { eta_(0), phi_(0), m_(0), - d0_(0), - dz_(0), + trkd0_(0), + trkdz_(0), + trkpt_(0), + trketa_(0), + trkphi_(0), + trkchi2overndf_(0), dEtaIn_(0), dPhiIn_(0), sigmaIetaIeta_(0), hOverE_(0), ooEMOop_(0), missingHits_(0), - charge_(0), + trkcharge_(0), ecalIso_(0), hcalIso_(0), trackIso_(0), @@ -86,15 +98,19 @@ class Run3ScoutingElectron { float eta() const { return eta_; } float phi() const { return phi_; } float m() const { return m_; } - float d0() const { return d0_; } - float dz() const { return dz_; } + std::vector const& trkd0() const { return trkd0_; } + std::vector const& trkdz() const { return trkdz_; } + std::vector const& trkpt() const { return trkpt_; } + std::vector const& trketa() const { return trketa_; } + std::vector const& trkphi() const { return trkphi_; } + std::vector const& trkchi2overndf() const { return trkchi2overndf_; } float dEtaIn() const { return dEtaIn_; } float dPhiIn() const { return dPhiIn_; } float sigmaIetaIeta() const { return sigmaIetaIeta_; } float hOverE() const { return hOverE_; } float ooEMOop() const { return ooEMOop_; } int missingHits() const { return missingHits_; } - int charge() const { return charge_; } + std::vector const& trkcharge() const { return trkcharge_; } float ecalIso() const { return ecalIso_; } float hcalIso() const { return hcalIso_; } float trackIso() const { return trackIso_; } @@ -112,15 +128,19 @@ class Run3ScoutingElectron { float eta_; float phi_; float m_; - float d0_; - float dz_; + std::vector trkd0_; + std::vector trkdz_; + std::vector trkpt_; + std::vector trketa_; + std::vector trkphi_; + std::vector trkchi2overndf_; float dEtaIn_; float dPhiIn_; float sigmaIetaIeta_; float hOverE_; float ooEMOop_; int missingHits_; - int charge_; + std::vector trkcharge_; float ecalIso_; float hcalIso_; float trackIso_; diff --git a/DataFormats/Scouting/src/classes_def.xml b/DataFormats/Scouting/src/classes_def.xml index 7be86ecd8abfd..4e3a114edef24 100644 --- a/DataFormats/Scouting/src/classes_def.xml +++ b/DataFormats/Scouting/src/classes_def.xml @@ -41,11 +41,39 @@ - + - + + + + + + + + + + + + + + + + + diff --git a/HLTrigger/Egamma/plugins/HLTScoutingEgammaProducer.cc b/HLTrigger/Egamma/plugins/HLTScoutingEgammaProducer.cc index ceac229b76328..63562e2f99f2c 100644 --- a/HLTrigger/Egamma/plugins/HLTScoutingEgammaProducer.cc +++ b/HLTrigger/Egamma/plugins/HLTScoutingEgammaProducer.cc @@ -273,21 +273,39 @@ void HLTScoutingEgammaProducer::produce(edm::StreamID sid, edm::Event& iEvent, e continue; } - float d0 = 0.0; - float dz = 0.0; - int charge = -999; + unsigned int const maxTrkSize = EgammaGsfTrackCollection->size(); + std::vector trkd0; + std::vector trkdz; + std::vector trkpt; + std::vector trketa; + std::vector trkphi; + std::vector trkchi2overndf; + std::vector trkcharge; + trkd0.reserve(maxTrkSize); + trkdz.reserve(maxTrkSize); + trkpt.reserve(maxTrkSize); + trketa.reserve(maxTrkSize); + trkphi.reserve(maxTrkSize); + trkchi2overndf.reserve(maxTrkSize); + trkcharge.reserve(maxTrkSize); + for (auto& track : *EgammaGsfTrackCollection) { RefToBase seed = track.extra()->seedRef(); reco::ElectronSeedRef elseed = seed.castTo(); RefToBase caloCluster = elseed->caloCluster(); reco::SuperClusterRef scRefFromTrk = caloCluster.castTo(); if (scRefFromTrk == scRef) { - d0 = track.d0(); - dz = track.dz(); - charge = track.charge(); + trkd0.push_back(track.d0()); + trkdz.push_back(track.dz()); + trkpt.push_back(track.pt()); + trketa.push_back(track.eta()); + trkphi.push_back(track.phi()); + auto const trackndof = track.ndof(); + trkchi2overndf.push_back(((trackndof == 0) ? -1 : (track.chi2() / trackndof))); + trkcharge.push_back(track.charge()); } } - if (charge == -999) { // No associated track. Candidate is a scouting photon + if (trkcharge.empty()) { // No associated track. Candidate is a scouting photon outPhotons->emplace_back(candidate.pt(), candidate.eta(), candidate.phi(), @@ -310,15 +328,19 @@ void HLTScoutingEgammaProducer::produce(edm::StreamID sid, edm::Event& iEvent, e candidate.eta(), candidate.phi(), candidate.mass(), - d0, - dz, + trkd0, + trkdz, + trkpt, + trketa, + trkphi, + trkchi2overndf, (*DetaMap)[candidateRef], (*DphiMap)[candidateRef], (*SigmaIEtaIEtaMap)[candidateRef], HoE, (*OneOEMinusOneOPMap)[candidateRef], (*MissingHitsMap)[candidateRef], - charge, + trkcharge, (*EcalPFClusterIsoMap)[candidateRef], (*HcalPFClusterIsoMap)[candidateRef], (*EleGsfTrackIsoMap)[candidateRef],