ATLAS Offline Software
Loading...
Searching...
No Matches
Prompt::DecoratePLIT Class Reference

#include <DecoratePLIT.h>

Inheritance diagram for Prompt::DecoratePLIT:

Public Member Functions

 DecoratePLIT (const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &) const override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvc > StoreGateSvc_t

Private Member Functions

StatusCode initializeAccessors ()
StatusCode predictElec (SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > &dec_trk_dr_lepton, SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > &dec_trk_dr_leptontrack, SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > &dec_trk_electron_track, SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > &dec_trk_muon_track, const xAOD::Electron &electron, const xAOD::TrackParticleContainer &tracks, const xAOD::CaloClusterContainer &caloclusters, std::vector< SG::WriteDecorHandle< xAOD::ElectronContainer, float > > &dec_el_plit_output, const EventContext &ctx) const
StatusCode predictMuon (SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > &dec_trk_dr_lepton, SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > &dec_trk_dr_leptontrack, SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > &dec_trk_electron_track, SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > &dec_trk_muon_track, const xAOD::Muon &muon, const xAOD::TrackParticleContainer &tracks, std::vector< SG::WriteDecorHandle< xAOD::MuonContainer, float > > &dec_mu_plit_output, const EventContext &ctx) const
bool passed_r22tracking_cuts (const xAOD::TrackParticle &tp, const EventContext &ctx) const
StatusCode decorateTrack (SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > &dec_trk_dr_lepton, SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > &dec_trk_dr_leptontrack, SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > &dec_trk_electron_track, SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > &dec_trk_muon_track, const xAOD::TrackParticle &track, float dr_lepton, bool isUsedForElectron, bool isUsedForMuon, const xAOD::TrackParticle *trackLep) const
StatusCode fillParticles (SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > &dec_trk_dr_lepton, SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > &dec_trk_dr_leptontrack, SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > &dec_trk_electron_track, SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > &dec_trk_muon_track, std::vector< const xAOD::IParticle * > &parts, const xAOD::IParticle &lepton, const xAOD::TrackParticle *trackLep, const xAOD::TrackParticleContainer &trackContainer, const EventContext &ctx) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

std::shared_ptr< const FlavorTagInference::SaltModel > m_saltModel {}
std::shared_ptr< const FlavorTagInference::SaltModel > m_saltModel_endcap {}
int m_num_lepton_features {}
int m_num_track_features {}
Gaudi::Property< std::string > m_leptonsName
Gaudi::Property< std::string > m_configPath {this, "ConfigPath", "", "Path of the directory containing the onnx files"}
Gaudi::Property< std::string > m_configFileVersion {this, "ConfigFileVersion", "", "Vector of tagger score files"}
Gaudi::Property< std::string > m_configFileVersion_endcap {this, "ConfigFileVersion_endcap", "", "Vector of tagger score files for endcap"}
Gaudi::Property< std::string > m_TaggerName {this, "TaggerName", "", "Tagger name"}
Gaudi::Property< float > m_maxLepTrackdR
Gaudi::Property< float > m_lepCalErelConeSize
Gaudi::Property< std::string > m_btagIp_prefix
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronsKey
SG::ReadHandleKey< xAOD::MuonContainer > m_muonsKey
SG::ReadHandleKey< xAOD::JetContainer > m_trackjetsKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_tracksKey
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_caloclustersKey
SG::ReadDecorHandleKey< xAOD::MuonContainer > m_acc_mu_ptvarcone30TTVA {this, "acc_mu_ptvarcone30TTVA",m_muonsKey, "ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt500"}
SG::ReadDecorHandleKey< xAOD::MuonContainer > m_acc_mu_topoetcone30 {this, "acc_mu_topoetcone30",m_muonsKey, "topoetcone30"}
SG::ReadDecorHandleKey< xAOD::ElectronContainer > m_acc_el_ptvarcone30 {this,"acc_el_ptvarcone30",m_electronsKey, "ptvarcone30"}
SG::ReadDecorHandleKey< xAOD::ElectronContainer > m_acc_el_topoetcone30 {this,"acc_el_topoetcone30",m_electronsKey, "topoetcone30"}
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_dr_lepton {this, "acc_trk_dr_lepton",m_tracksKey, "dr_lepton"}
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_dr_leptontrack {this, "acc_trk_dr_leptontrack",m_tracksKey, "dr_leptontrack"}
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_d0 {this,"acc_trk_d0", m_tracksKey, m_btagIp_prefix + "d0"}
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_z0SinTheta {this, "acc_trk_z0SinTheta", m_tracksKey, m_btagIp_prefix + "z0SinTheta"}
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_d0Uncertainty {this, "acc_trk_d0Uncertainty", m_tracksKey, m_btagIp_prefix + "d0Uncertainty"}
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_z0SinThetaUncertainty {this, "acc_trk_z0SinThetaUncertainty", m_tracksKey, m_btagIp_prefix + "z0SinThetaUncertainty"}
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_muon_track {this, "acc_trk_muon_track", m_tracksKey, "muon_track"}
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_electron_track {this,"acc_trk_electron_track", m_tracksKey, "electron_track"}
SG::WriteDecorHandleKeyArray< xAOD::ElectronContainer > m_dec_el_plit_output {this, "PLITelOutput", {}}
SG::WriteDecorHandleKeyArray< xAOD::MuonContainer > m_dec_mu_plit_output {this, "PLITmuOutput", {}}
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_dec_trk_dr_lepton {this, "dec_trk_dr_lepton", m_tracksKey, "dr_lepton"}
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_dec_trk_electron_track {this, "dec_trk_electron_track", m_tracksKey, "electron_track"}
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_dec_trk_muon_track {this, "dec_trk_muon_track", m_tracksKey, "muon_track"}
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_dec_trk_dr_leptontrack {this, "dec_trk_dr_leptontrack", m_tracksKey, "dr_leptontrack"}
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 34 of file DecoratePLIT.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 376 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ DecoratePLIT()

Prompt::DecoratePLIT::DecoratePLIT ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 14 of file DecoratePLIT.cxx.

15 : AthReentrantAlgorithm(name, pSvcLocator)
16 {}

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ decorateTrack()

StatusCode Prompt::DecoratePLIT::decorateTrack ( SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > & dec_trk_dr_lepton,
SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > & dec_trk_dr_leptontrack,
SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > & dec_trk_electron_track,
SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > & dec_trk_muon_track,
const xAOD::TrackParticle & track,
float dr_lepton,
bool isUsedForElectron,
bool isUsedForMuon,
const xAOD::TrackParticle * trackLep ) const
private

Definition at line 835 of file DecoratePLIT.cxx.

845 {
846 // Apply values to decorators
847 dec_trk_dr_lepton(track) = dr_lepton;
848 dec_trk_electron_track(track) = static_cast<char>(isUsedForElectron);
849 dec_trk_muon_track(track) = static_cast<char>(isUsedForMuon);
850
851 float dr_leptontrack = -99;
852 if (trackLep) {
853 if (trackLep->pt() > 0.) {
854 dr_leptontrack = track.p4().DeltaR(trackLep->p4());
855 }
856 }
857 dec_trk_dr_leptontrack(track) = dr_leptontrack;
858
859 return StatusCode::SUCCESS;
860 }
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
virtual double pt() const override final
The transverse momentum ( ) of the particle.

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode Prompt::DecoratePLIT::execute ( const EventContext & ctx) const
overridevirtual

Definition at line 115 of file DecoratePLIT.cxx.

115 {
116 SG::ReadHandle<xAOD::TrackParticleContainer> tracks(m_tracksKey, ctx);
117 SG::ReadHandle<xAOD::CaloClusterContainer> caloclusters(m_caloclustersKey, ctx);
118
119 // Define decorators
120 SG::WriteDecorHandle<xAOD::TrackParticleContainer, float> dec_trk_dr_lepton{m_dec_trk_dr_lepton, ctx};
121 SG::WriteDecorHandle<xAOD::TrackParticleContainer, char> dec_trk_electron_track{m_dec_trk_electron_track, ctx};
122 SG::WriteDecorHandle<xAOD::TrackParticleContainer, char> dec_trk_muon_track{m_dec_trk_muon_track, ctx};
123 SG::WriteDecorHandle<xAOD::TrackParticleContainer, float> dec_trk_dr_leptontrack{m_dec_trk_dr_leptontrack, ctx};
124
125 // Make sure the decorations are filled for every track
126 for (const xAOD::TrackParticle* track : *tracks) {
127 dec_trk_dr_lepton(*track) = -999.0;
128 dec_trk_dr_leptontrack(*track) = -999.0;
129 dec_trk_electron_track(*track) = static_cast<char>(false);
130 dec_trk_muon_track(*track) = static_cast<char>(false);
131 }
132
133 if (!m_electronsKey.empty()) {
134 // prepare decorators
135 // ------------------
136 std::vector<SG::WriteDecorHandle<xAOD::ElectronContainer, float>> dec_el_plit_output;
137 for (const auto& wdhk: m_dec_el_plit_output) {
138 dec_el_plit_output.emplace_back(wdhk, ctx);
139 }
140 SG::ReadHandle<xAOD::ElectronContainer> electrons(m_electronsKey, ctx);
141 for (const xAOD::Electron* elec : *electrons) {
142 if (!predictElec(dec_trk_dr_lepton, dec_trk_dr_leptontrack, dec_trk_electron_track, dec_trk_muon_track,
143 *elec, *tracks, *caloclusters, dec_el_plit_output, ctx)) {
144 ATH_MSG_ERROR("DecoratePLIT::execute - failed to predict electron");
145 return StatusCode::FAILURE;
146 }
147 }
148 } else if (!m_muonsKey.empty()) {
149 // prepare decorators
150 // ------------------
151 std::vector<SG::WriteDecorHandle<xAOD::MuonContainer, float>> dec_mu_plit_output;
152 for (const auto& wdhk: m_dec_mu_plit_output) {
153 dec_mu_plit_output.emplace_back(wdhk, ctx);
154 }
155 SG::ReadHandle<xAOD::MuonContainer> muons(m_muonsKey, ctx);
156 for (const xAOD::Muon* muon : *muons) {
157 if (!predictMuon(dec_trk_dr_lepton, dec_trk_dr_leptontrack, dec_trk_electron_track, dec_trk_muon_track,
158 *muon, *tracks, dec_mu_plit_output, ctx)) {
159 ATH_MSG_ERROR("DecoratePLIT::execute - failed to predict muon");
160 return StatusCode::FAILURE;
161 }
162 }
163 }
164
165 return StatusCode::SUCCESS;
166 }
#define ATH_MSG_ERROR(x,...)
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_dec_trk_dr_leptontrack
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_caloclustersKey
SG::WriteDecorHandleKeyArray< xAOD::ElectronContainer > m_dec_el_plit_output
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_tracksKey
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_dec_trk_muon_track
StatusCode predictElec(SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > &dec_trk_dr_lepton, SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > &dec_trk_dr_leptontrack, SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > &dec_trk_electron_track, SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > &dec_trk_muon_track, const xAOD::Electron &electron, const xAOD::TrackParticleContainer &tracks, const xAOD::CaloClusterContainer &caloclusters, std::vector< SG::WriteDecorHandle< xAOD::ElectronContainer, float > > &dec_el_plit_output, const EventContext &ctx) const
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_dec_trk_dr_lepton
SG::WriteDecorHandleKeyArray< xAOD::MuonContainer > m_dec_mu_plit_output
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_dec_trk_electron_track
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronsKey
StatusCode predictMuon(SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > &dec_trk_dr_lepton, SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > &dec_trk_dr_leptontrack, SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > &dec_trk_electron_track, SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > &dec_trk_muon_track, const xAOD::Muon &muon, const xAOD::TrackParticleContainer &tracks, std::vector< SG::WriteDecorHandle< xAOD::MuonContainer, float > > &dec_mu_plit_output, const EventContext &ctx) const
SG::ReadHandleKey< xAOD::MuonContainer > m_muonsKey
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Muon_v1 Muon
Reference the current persistent version:
Definition Muon.h:13
Electron_v1 Electron
Definition of the current "egamma version".
Definition Electron.h:17

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ fillParticles()

StatusCode Prompt::DecoratePLIT::fillParticles ( SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > & dec_trk_dr_lepton,
SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > & dec_trk_dr_leptontrack,
SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > & dec_trk_electron_track,
SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > & dec_trk_muon_track,
std::vector< const xAOD::IParticle * > & parts,
const xAOD::IParticle & lepton,
const xAOD::TrackParticle * trackLep,
const xAOD::TrackParticleContainer & trackContainer,
const EventContext & ctx ) const
private

Definition at line 773 of file DecoratePLIT.cxx.

783 {
784 // get lepton four momentum
785 const FourMom_t lepton_p4 = lepton.p4();
786
787 // Precompute tracks used for reconstruction
788 std::set<const xAOD::TrackParticle*> tracksUsedForElectron;
789 std::set<const xAOD::TrackParticle*> tracksUsedForMuon;
790 if (const auto* elec = dynamic_cast<const xAOD::Electron*>(&lepton)) {
791 tracksUsedForElectron = xAOD::EgammaHelpers::getTrackParticles(elec, true); // useBremAssoc = true
792 } else if (const auto* muon = dynamic_cast<const xAOD::Muon*>(&lepton)) {
793 if (muon->muonType() == xAOD::Muon::MuonType::Combined &&
794 muon->trackParticle(xAOD::Muon::TrackParticleType::InnerDetectorTrackParticle)) {
795 tracksUsedForMuon.insert(muon->trackParticle(xAOD::Muon::TrackParticleType::InnerDetectorTrackParticle)); // even if the primary track should be a combined track, we still use the id for the match
796 }
797 }
798
799 // Loop over tracks and store them
800 for (const xAOD::TrackParticle *track: trackContainer) {
801 if (!track) {
802 ATH_MSG_ERROR("DecoratePLIT::fillParticles - null track pointer");
803 return StatusCode::FAILURE;
804 }
805 // check if track passed selection
806 if (!passed_r22tracking_cuts(*track, ctx)) continue;
807
808 // decorate track
809 float dr_lepton = (lepton.p4().Pt() > 0.) ? track->p4().DeltaR(lepton.p4()) : -99;
810
811 // do not even waste time to decorate something which is not used
812 if (dr_lepton > m_maxLepTrackdR && m_maxLepTrackdR>=0) {continue;}
813
814 bool isUsedForElectron = tracksUsedForElectron.count(track);
815 bool isUsedForMuon = tracksUsedForMuon.count(track);
816
817 if (!decorateTrack(dec_trk_dr_lepton, dec_trk_dr_leptontrack, dec_trk_electron_track, dec_trk_muon_track,
818 *track, dr_lepton, isUsedForElectron, isUsedForMuon, trackLep)) {
819 ATH_MSG_ERROR("DecoratePLIT::fillParticles - failed to decorate track");
820 return StatusCode::FAILURE;
821 }
822
823 parts.push_back(track);
824 }
825
826 // Sort tracks by dR distance to lepton
827 auto SORT_TRACKLEP = [&lepton_p4](const xAOD::IParticle* a, const xAOD::IParticle* b) {
828 return a->p4().DeltaR(lepton_p4) < b->p4().DeltaR(lepton_p4);
829 };
830 std::sort(parts.begin(), parts.end(), SORT_TRACKLEP);
831
832 return StatusCode::SUCCESS;
833 }
static Double_t a
StatusCode decorateTrack(SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > &dec_trk_dr_lepton, SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > &dec_trk_dr_leptontrack, SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > &dec_trk_electron_track, SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > &dec_trk_muon_track, const xAOD::TrackParticle &track, float dr_lepton, bool isUsedForElectron, bool isUsedForMuon, const xAOD::TrackParticle *trackLep) const
bool passed_r22tracking_cuts(const xAOD::TrackParticle &tp, const EventContext &ctx) const
Gaudi::Property< float > m_maxLepTrackdR
virtual FourMom_t p4() const =0
The full 4-momentum of the particle.
TLorentzVector FourMom_t
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
std::set< const xAOD::TrackParticle * > getTrackParticles(const xAOD::Egamma *eg, bool useBremAssoc=true, bool allParticles=true)
Return a list of all or only the best TrackParticle associated to the object.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ initialize()

StatusCode Prompt::DecoratePLIT::initialize ( )
overridevirtual

Definition at line 18 of file DecoratePLIT.cxx.

18 {
19 ATH_MSG_DEBUG("Initializing DecoratePLIT " << name() );
20 ATH_MSG_DEBUG("m_leptonsName = " << m_leptonsName);
21
22 ATH_MSG_DEBUG("Initializing " << m_electronsKey);
23 ATH_MSG_DEBUG("Initializing " << m_muonsKey);
24 ATH_MSG_DEBUG("Initializing " << m_trackjetsKey);
25 ATH_MSG_DEBUG("Initializing " << m_tracksKey);
26 ATH_MSG_DEBUG("Initializing " << m_caloclustersKey);
27
28 ATH_CHECK(m_electronsKey.initialize(m_leptonsName == "Electrons"));
29 ATH_CHECK(m_muonsKey.initialize(m_leptonsName == "Muons"));
30 ATH_CHECK(m_trackjetsKey.initialize());
31 ATH_CHECK(m_tracksKey.initialize());
32 ATH_CHECK(m_caloclustersKey.initialize());
33
34 // initialise accessors
36
37 // Load and initialize the neural network model from the given file path.
38 if(m_leptonsName == "Electrons") {
39 std::string fullPathToOnnxFile = PathResolverFindCalibFile(m_configPath.value() + m_configFileVersion.value());
40 m_saltModel = std::make_shared<FlavorTagInference::SaltModel>(fullPathToOnnxFile);
41
42 std::string fullPathToOnnxFile_endcap = PathResolverFindCalibFile(m_configPath.value() + m_configFileVersion_endcap.value());
43 m_saltModel_endcap = std::make_shared<FlavorTagInference::SaltModel>(fullPathToOnnxFile_endcap);
44
47
48 // set up decorators using a dummy query of the onnx model
50
51 std::vector<float> elec_feat(m_num_lepton_features, 0.);
52 std::vector<int64_t> elec_feat_dim = {1, static_cast<int64_t>(elec_feat.size())};
53 FlavorTagInference::Inputs elec_info (elec_feat, elec_feat_dim);
54 gnn_input.insert({"jet_features", elec_info}); // need to use the "jet_features" keyword as we are borrowing flavour tagging code
55
56 std::vector<float> track_feat(m_num_track_features, 0.);
57 std::vector<int64_t> track_feat_dim = {1, m_num_track_features};
58 FlavorTagInference::Inputs track_info(track_feat, track_feat_dim);
59 gnn_input.insert({"track_features", track_info});
60
61 auto [out_f, out_vc, out_vf] = m_saltModel->runInference(gnn_input); // the dummy evaluation
62
63 std::vector<std::string> output_names;
64 for (auto& singlefloat : out_f){
65 ATH_MSG_DEBUG("Found Electron output: "+singlefloat.first);
66 std::string outname = m_electronsKey.key()+"." + m_TaggerName + "_" + (singlefloat.first.find("elxpromp") != std::string::npos ? "PLITel_pelxpromp" : "PLITel_pnpxall" );
67 ATH_MSG_DEBUG("Decorating as "+outname);
68 output_names.push_back(outname);
69 }
70 ATH_CHECK(m_dec_el_plit_output.assign(output_names));
71 ATH_CHECK(m_dec_el_plit_output.initialize());
72 }
73 else if (m_leptonsName == "Muons") {
74 std::string fullPathToOnnxFile = PathResolverFindCalibFile(m_configPath.value() + m_configFileVersion.value());
75 m_saltModel = std::make_shared<FlavorTagInference::SaltModel>(fullPathToOnnxFile);
76
79
80 // set up decorators using a dummy query of the onnx model
82
83 std::vector<float> muon_feat(m_num_lepton_features, 0.);
84 std::vector<int64_t> muon_feat_dim = {1, static_cast<int64_t>(muon_feat.size())};
85 FlavorTagInference::Inputs muon_info (muon_feat, muon_feat_dim);
86 gnn_input.insert({"jet_features", muon_info}); // need to use the "jet_features" keyword as we are borrowing flavour tagging code
87
88 std::vector<float> track_feat(m_num_track_features, 0.);
89 std::vector<int64_t> track_feat_dim = {1, m_num_track_features};
90 FlavorTagInference::Inputs track_info(track_feat, track_feat_dim);
91 gnn_input.insert({"track_features", track_info});
92
93 auto [out_f, out_vc, out_vf] = m_saltModel->runInference(gnn_input); // the dummy evaluation
94
95 std::vector<std::string> output_names;
96 for (auto& singlefloat : out_f){
97 ATH_MSG_DEBUG("Found Muon output: "+singlefloat.first);
98 std::string outname = m_muonsKey.key()+"." + m_TaggerName + "_" + (singlefloat.first.find("muxpromp") != std::string::npos ? "TPLTmu_pmuxpromp" : "TPLTmu_pnpxall" );
99 ATH_MSG_DEBUG("Decorating as "+outname);
100 output_names.push_back(outname);
101 }
102 ATH_CHECK(m_dec_mu_plit_output.assign(output_names));
103 ATH_CHECK(m_dec_mu_plit_output.initialize());
104 }
105 else {
106 ATH_MSG_ERROR(" ==> topology is not recognised! aborting.");
107 return StatusCode::FAILURE;
108 }
109
110 ATH_MSG_INFO("DecoratePLIT " << name() << " initialization done." );
111
112 return StatusCode::SUCCESS;
113 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_INFO(x,...)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
SG::ReadHandleKey< xAOD::JetContainer > m_trackjetsKey
StatusCode initializeAccessors()
Gaudi::Property< std::string > m_leptonsName
std::shared_ptr< const FlavorTagInference::SaltModel > m_saltModel_endcap
Gaudi::Property< std::string > m_configPath
std::shared_ptr< const FlavorTagInference::SaltModel > m_saltModel
Gaudi::Property< std::string > m_TaggerName
Gaudi::Property< std::string > m_configFileVersion_endcap
Gaudi::Property< std::string > m_configFileVersion
std::map< std::string, Inputs, std::less<> > InputMap
Definition ISaltModel.h:37

◆ initializeAccessors()

StatusCode Prompt::DecoratePLIT::initializeAccessors ( )
private

Definition at line 168 of file DecoratePLIT.cxx.

168 {
169
170 ATH_CHECK(m_acc_mu_ptvarcone30TTVA.initialize(!m_muonsKey.empty()));
171 ATH_CHECK(m_acc_mu_topoetcone30.initialize(!m_muonsKey.empty()));
172
173 ATH_CHECK(m_acc_el_ptvarcone30.initialize(!m_electronsKey.empty()));
174 ATH_CHECK(m_acc_el_topoetcone30.initialize(!m_electronsKey.empty()));
175
176 ATH_CHECK(m_acc_trk_dr_lepton.initialize());
178 ATH_CHECK(m_acc_trk_d0.initialize());
179 ATH_CHECK(m_acc_trk_z0SinTheta.initialize());
182 ATH_CHECK(m_acc_trk_muon_track.initialize());
184
185 ATH_CHECK(m_dec_trk_dr_lepton.initialize());
187 ATH_CHECK(m_dec_trk_muon_track.initialize());
189
194
195 return StatusCode::SUCCESS;
196
197 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
SG::ReadDecorHandleKey< xAOD::ElectronContainer > m_acc_el_ptvarcone30
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_d0
SG::ReadDecorHandleKey< xAOD::MuonContainer > m_acc_mu_topoetcone30
SG::ReadDecorHandleKey< xAOD::MuonContainer > m_acc_mu_ptvarcone30TTVA
SG::ReadDecorHandleKey< xAOD::ElectronContainer > m_acc_el_topoetcone30
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_z0SinThetaUncertainty
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_d0Uncertainty
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_z0SinTheta
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_dr_lepton
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_electron_track
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_dr_leptontrack
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_muon_track

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ passed_r22tracking_cuts()

bool Prompt::DecoratePLIT::passed_r22tracking_cuts ( const xAOD::TrackParticle & tp,
const EventContext & ctx ) const
private

Definition at line 693 of file DecoratePLIT.cxx.

694 {
695 // r22 default track selection for flavour tagging GN2 algorithm
696 constexpr float pt_minimum = 500; // MeV
697 constexpr float abs_eta_maximum = 2.5;
698 constexpr float d0_maximum = 3.5;
699 constexpr float z0_maximum= 5.0;
700 constexpr unsigned char si_hits_minimum = 8;
701 constexpr unsigned char si_shared_maximum = 1;
702 constexpr unsigned char si_holes_maximum = 2;
703 constexpr unsigned char pix_holes_maximum = 1;
704
705 // accessors
706 SG::ReadDecorHandle<xAOD::TrackParticleContainer, float> acc_d0{m_acc_trk_d0, ctx};
707 SG::ReadDecorHandle<xAOD::TrackParticleContainer, float> acc_z0SinTheta{m_acc_trk_z0SinTheta, ctx};
708
709 // get hit pixel info
710 uint8_t pix_shared = 0;
712 ATH_MSG_ERROR("DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfPixelSharedHits");
713 return false;
714 }
715 uint8_t sct_shared = 0;
716 if(!tp.summaryValue(sct_shared,xAOD::numberOfSCTSharedHits)){
717 ATH_MSG_ERROR("DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfSCTSharedHits");
718 return false;
719 }
720 uint8_t pix_hits = 0;
721 if(!tp.summaryValue(pix_hits,xAOD::numberOfPixelHits)){
722 ATH_MSG_ERROR("DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfPixelHits");
723 return false;
724 }
725 uint8_t sct_hits = 0;
726 if(!tp.summaryValue(sct_hits,xAOD::numberOfSCTHits)){
727 ATH_MSG_ERROR("DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfSCTHits");
728 return false;
729 }
730 uint8_t pix_dead = 0;
732 ATH_MSG_ERROR("DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfPixelDeadSensors");
733 return false;
734 }
735 uint8_t sct_dead = 0;
737 ATH_MSG_ERROR("DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfSCTDeadSensors");
738 return false;
739 }
740 uint8_t pix_holes = 0;
741 if(!tp.summaryValue(pix_holes,xAOD::numberOfPixelHoles)){
742 ATH_MSG_ERROR("DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfPixelHoles");
743 return false;
744 }
745 uint8_t sct_holes = 0;
746 if(!tp.summaryValue(sct_holes,xAOD::numberOfSCTHoles)){
747 ATH_MSG_ERROR("DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfSCTHoles");
748 return false;
749 }
750
751 if (std::abs(tp.eta()) > abs_eta_maximum)
752 return false;
753 double n_module_shared = (pix_shared + sct_shared / 2);
754 if (n_module_shared > si_shared_maximum)
755 return false;
756 if (tp.pt() <= pt_minimum)
757 return false;
758 if (std::isfinite(d0_maximum) &&
759 std::abs(acc_d0(tp)) >= d0_maximum)
760 return false;
761 if (std::isfinite(z0_maximum) &&
762 std::abs(acc_z0SinTheta(tp)) >= z0_maximum)
763 return false;
764 if (pix_hits + pix_dead + sct_hits + sct_dead < si_hits_minimum)
765 return false;
766 if ((pix_holes + sct_holes) > si_holes_maximum)
767 return false;
768 if (pix_holes > pix_holes_maximum)
769 return false;
770 return true;
771 }
bool summaryValue(uint8_t &value, const SummaryType &information) const
Accessor for TrackSummary values.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
@ numberOfPixelHoles
number of pixel layers on track with absence of hits [unit8_t].
@ numberOfSCTDeadSensors
number of dead SCT sensors crossed [unit8_t].
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].
@ numberOfPixelDeadSensors
number of dead pixel sensors crossed [unit8_t].
@ numberOfSCTHoles
number of SCT holes [unit8_t].

◆ predictElec()

StatusCode Prompt::DecoratePLIT::predictElec ( SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > & dec_trk_dr_lepton,
SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > & dec_trk_dr_leptontrack,
SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > & dec_trk_electron_track,
SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > & dec_trk_muon_track,
const xAOD::Electron & electron,
const xAOD::TrackParticleContainer & tracks,
const xAOD::CaloClusterContainer & caloclusters,
std::vector< SG::WriteDecorHandle< xAOD::ElectronContainer, float > > & dec_el_plit_output,
const EventContext & ctx ) const
private

Definition at line 436 of file DecoratePLIT.cxx.

445 {
446 // prepare input
447 // -------------
449
450 // accessors
451 // ---------
452 SG::ReadDecorHandle<xAOD::ElectronContainer, float> acc_ptvarcone30{m_acc_el_ptvarcone30, ctx};
453 SG::ReadDecorHandle<xAOD::ElectronContainer, float> acc_topoetcone30{m_acc_el_topoetcone30, ctx};
454
455 SG::ReadDecorHandle<xAOD::TrackParticleContainer, float> acc_dr_lepton{m_acc_trk_dr_lepton, ctx};
456 SG::ReadDecorHandle<xAOD::TrackParticleContainer, float> acc_dr_leptontrack{m_acc_trk_dr_leptontrack, ctx};
457 SG::ReadDecorHandle<xAOD::TrackParticleContainer, float> acc_d0{m_acc_trk_d0, ctx};
458 SG::ReadDecorHandle<xAOD::TrackParticleContainer, float> acc_z0SinTheta{m_acc_trk_z0SinTheta, ctx};
459 SG::ReadDecorHandle<xAOD::TrackParticleContainer, float> acc_d0Uncertainty{m_acc_trk_d0Uncertainty, ctx};
460 SG::ReadDecorHandle<xAOD::TrackParticleContainer, float> acc_z0SinThetaUncertainty{m_acc_trk_z0SinThetaUncertainty, ctx};
461 SG::ReadDecorHandle<xAOD::TrackParticleContainer, char> acc_electron_track{m_acc_trk_electron_track, ctx};
462
463 // collect electron features
464 float elec_pt = electron.pt();
465 float elec_eta = electron.eta();
466 float elec_phi = electron.phi();
467 float elec_ptvarcone30Rel = acc_ptvarcone30(electron) / elec_pt;
468 float elec_topoetcone30Rel = acc_topoetcone30(electron) / elec_pt;
469
470 // compute electron calorimeter cluster information
471 float elec_caloClusterSumEtRel = 0.0;
472 float sumCoreEt_large = 0.0;
473 if (electron.caloCluster()) {
474 float elec_calEta = electron.caloCluster()->eta();
475 float elec_calPhi = electron.caloCluster()->phi();
476
477 for (const xAOD::CaloCluster *cluster: caloclusters) {
478 float deta = elec_calEta - cluster->eta();
479 float dphi = TVector2::Phi_mpi_pi(elec_calPhi - cluster->phi());
480 float dr = std::sqrt(deta*deta + dphi*dphi);
481
482 if (dr < m_lepCalErelConeSize) {
483 sumCoreEt_large += cluster->pt();
484 }
485 }
486 }
487 elec_caloClusterSumEtRel = sumCoreEt_large / elec_pt;
488
489 // collect best matched GSF electron track kinematics
490 const xAOD::TrackParticle *electronTrack = nullptr;
491 const xAOD::TrackParticle *bestmatchedGSFElTrack = electron.trackParticle(0);
492 if (bestmatchedGSFElTrack) {
493 electronTrack = xAOD::EgammaHelpers::getOriginalTrackParticleFromGSF(bestmatchedGSFElTrack);
494 }
495
496 //float elec_pt_track = -99;
497 //float elec_eta_track = -99;
498 //float elec_phi_track = -99;
499 //if (electronTrack) {
500 // elec_pt_track = electronTrack->pt();
501 // elec_eta_track = electronTrack->eta();
502 // elec_phi_track = electronTrack->phi();
503 //}
504
505 std::vector<float> electron_feat = {
506 elec_pt,
507 elec_eta,
508 elec_phi,
509 elec_ptvarcone30Rel,
510 elec_topoetcone30Rel,
511 elec_caloClusterSumEtRel};
512 std::vector<int64_t> electron_feat_dim = {1, static_cast<int64_t>(electron_feat.size())};
513
514 // need to use the "jet_features" keyword as we are borrowing flavour tagging code
515 FlavorTagInference::Inputs electron_info (electron_feat, electron_feat_dim);
516 gnn_input.insert({"jet_features", electron_info});
517
518 // decorate and fill track particles around the electron
519 std::vector<const xAOD::IParticle *> parts;
520 if (!fillParticles(dec_trk_dr_lepton, dec_trk_dr_leptontrack, dec_trk_electron_track, dec_trk_muon_track,
521 parts, electron, electronTrack, tracks, ctx)) {
522 ATH_MSG_ERROR("DecoratePLIT::execute - failed to fill particles");
523 return StatusCode::FAILURE;
524 }
525
526 // collect track features from track particles
527 std::vector<float> track_feat;
528 track_feat.reserve(parts.size() * static_cast<int64_t>(electron_feat.size()));
529
530 for (const xAOD::IParticle *part: parts) {
531 const xAOD::TrackParticle *track = dynamic_cast<const xAOD::TrackParticle*>(part);
532 if (!track) {
533 ATH_MSG_ERROR("DecoratePLIT::execute - null track pointer");
534 return StatusCode::FAILURE;
535 }
536
537 // dr_lepton
538 // float dr_lepton = acc_dr_lepton(*track);
539 // deta_lepton
540 float deta_lepton = track->p4().Eta() - electron.eta();
541 // dphi_lepton
542 float dphi_lepton = track->p4().DeltaPhi(electron.p4());
543 // qOverP
544 float qoverp = track->qOverP();
545 // btagIp_d0
546 float d0 = acc_d0(*track);
547 // btagIp_z0SinTheta
548 float z0SinTheta = acc_z0SinTheta(*track);
549 // btagIp_d0_significance
550 float d0Uncertainty = acc_d0Uncertainty(*track);
551 float d0_significance = -99;
552 if (std::abs(d0Uncertainty) > 0) d0_significance = d0 / d0Uncertainty;
553 // btagIp_z0SinTheta_significance
554 float z0SinThetaUncertainty = acc_z0SinThetaUncertainty(*track);
555 float z0SinTheta_significance = -99;
556 if (std::abs(z0SinThetaUncertainty) > 0) z0SinTheta_significance = z0SinTheta / z0SinThetaUncertainty;
557 // numberOfInnermostPixelLayerHits
558 uint8_t pix_innermosthits = 0;
559 if(!track->summaryValue(pix_innermosthits,xAOD::numberOfInnermostPixelLayerHits)){
560 ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfInnermostPixelLayerHits");
561 return StatusCode::FAILURE;
562 }
563 // numberOfNextToInnermostPixelLayerHits
564 uint8_t pix_nextinnermosthits = 0;
565 if(!track->summaryValue(pix_nextinnermosthits,xAOD::numberOfNextToInnermostPixelLayerHits)){
566 ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfNextToInnermostPixelLayerHits");
567 return StatusCode::FAILURE;
568 }
569 // numberOfInnermostPixelLayerSharedHits
570 uint8_t pix_innermostsharedhits = 0;
571 if(!track->summaryValue(pix_innermostsharedhits,xAOD::numberOfInnermostPixelLayerSharedHits)){
572 ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfInnermostPixelLayerSharedHits");
573 return StatusCode::FAILURE;
574 }
575 // numberOfInnermostPixelLayerSplitHits
576 uint8_t pix_innermostsplithits = 0;
577 if(!track->summaryValue(pix_innermostsplithits,xAOD::numberOfInnermostPixelLayerSplitHits)){
578 ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfInnermostPixelLayerSplitHits");
579 return StatusCode::FAILURE;
580 }
581 // numberOfPixelHits
582 uint8_t pix_hits = 0;
583 if(!track->summaryValue(pix_hits,xAOD::numberOfPixelHits)){
584 ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfPixelHits");
585 return StatusCode::FAILURE;
586 }
587 // numberOfPixelSharedHits
588 uint8_t pix_shared = 0;
589 if(!track->summaryValue(pix_shared,xAOD::numberOfPixelSharedHits)){
590 ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfPixelSharedHits");
591 return StatusCode::FAILURE;
592 }
593 // numberOfPixelSplitHits
594 uint8_t pix_split = 0;
595 if(!track->summaryValue(pix_split,xAOD::numberOfPixelSplitHits)){
596 ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfPixelSplitHits");
597 return StatusCode::FAILURE;
598 }
599 // numberOfSCTHits
600 uint8_t sct_hits = 0;
601 if(!track->summaryValue(sct_hits,xAOD::numberOfSCTHits)){
602 ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfSCTHits");
603 return StatusCode::FAILURE;
604 }
605 // numberOfSCTSharedHits
606 uint8_t sct_shared = 0;
607 if(!track->summaryValue(sct_shared,xAOD::numberOfSCTSharedHits)){
608 ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfSCTSharedHits");
609 return StatusCode::FAILURE;
610 }
611 // electron_track
612 char electron_track = acc_electron_track(*track);
613
614
615 //track_feat.push_back(dr_lepton); // removed in the latest trainings, redundan
616 track_feat.push_back(deta_lepton);
617 track_feat.push_back(dphi_lepton);
618 track_feat.push_back(qoverp);
619 track_feat.push_back(d0);
620 track_feat.push_back(z0SinTheta);
621 track_feat.push_back(d0_significance);
622 track_feat.push_back(z0SinTheta_significance);
623 track_feat.push_back(pix_innermosthits);
624 track_feat.push_back(pix_nextinnermosthits);
625 track_feat.push_back(pix_innermostsharedhits);
626 track_feat.push_back(pix_innermostsplithits);
627 track_feat.push_back(pix_hits);
628 track_feat.push_back(pix_shared);
629 track_feat.push_back(pix_split);
630 track_feat.push_back(sct_hits);
631 track_feat.push_back(sct_shared);
632 track_feat.push_back(electron_track);
633 }
634
635 // prepare track features for inference
636 int num_cnsts = parts.size();
637 std::vector<int64_t> track_feat_dim = {num_cnsts, m_num_track_features};
638
639 FlavorTagInference::Inputs track_info (track_feat, track_feat_dim);
640 gnn_input.insert({"track_features", track_info});
641
642 if (msgLvl(MSG::VERBOSE)) {
643 ATH_MSG_VERBOSE("gnn_input size = " << gnn_input.size());
644 for (auto& inp : gnn_input){
645 ATH_MSG_VERBOSE(" " + inp.first + " dim = ");
646 for (auto & dim: inp.second.second) {
647 ATH_MSG_VERBOSE(" " + std::to_string(dim));
648 }
649 ATH_MSG_VERBOSE(" " + inp.first + " content = ");
650 for (auto & con: inp.second.first) {
651 ATH_MSG_VERBOSE(" " + std::to_string(con));
652 }
653 }
654 }
655
656 // run inference
657 // -------------
658 // use different model for endcap electrons
659 auto [out_f, out_vc, out_vf] = (std::abs(elec_eta) < 1.37) ? m_saltModel->runInference(gnn_input) : m_saltModel_endcap->runInference(gnn_input);
660 if (msgLvl(MSG::VERBOSE)) {
661 ATH_MSG_VERBOSE("runInference done.");
662
663 ATH_MSG_VERBOSE("Output Float(s):");
664 for (auto& singlefloat : out_f){
665 ATH_MSG_VERBOSE(singlefloat.first + " = " << singlefloat.second);
666 }
667 ATH_MSG_VERBOSE("Output vector char(s):");
668 for (auto& vecchar : out_vc){
669 ATH_MSG_VERBOSE(vecchar.first + " = ");
670 for (auto& cc : vecchar.second){
671 ATH_MSG_VERBOSE(cc);
672 }
673 }
674 ATH_MSG_VERBOSE("Output vector float(s):");
675 for (auto& vecfloat : out_vf){
676 ATH_MSG_VERBOSE(vecfloat.first + " = ");
677 for (auto& ff : vecfloat.second){
678 ATH_MSG_VERBOSE(ff);
679 }
680 }
681 }
682 // filling the tagger scores
683 auto it_dec_el_plit_output = dec_el_plit_output.begin();
684 for (auto& singlefloat : out_f){
685 ATH_MSG_DEBUG("DecoratePLIT::execute - Electron output: " + singlefloat.first + " = " + std::to_string(singlefloat.second));
686 (*it_dec_el_plit_output)(electron) = singlefloat.second;
687 ++it_dec_el_plit_output;
688 }
689
690 return StatusCode::SUCCESS;
691 }
#define ATH_MSG_VERBOSE(x,...)
bool msgLvl(const MSG::Level lvl) const
Gaudi::Property< float > m_lepCalErelConeSize
StatusCode fillParticles(SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > &dec_trk_dr_lepton, SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > &dec_trk_dr_leptontrack, SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > &dec_trk_electron_track, SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > &dec_trk_muon_track, std::vector< const xAOD::IParticle * > &parts, const xAOD::IParticle &lepton, const xAOD::TrackParticle *trackLep, const xAOD::TrackParticleContainer &trackContainer, const EventContext &ctx) const
float z0SinTheta(const U &p)
const std::string d0Uncertainty
const std::string z0SinThetaUncertainty
const xAOD::TrackParticle * getOriginalTrackParticleFromGSF(const xAOD::TrackParticle *trkPar)
Helper function for getting the "Original" Track Particle (i.e before GSF) via the GSF Track Particle...
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
@ numberOfPixelSplitHits
number of Pixel all-layer hits split by cluster splitting [unit8_t].
@ numberOfInnermostPixelLayerSharedHits
number of Pixel 0th layer barrel hits shared by several tracks.
@ numberOfNextToInnermostPixelLayerHits
these are the hits in the 1st pixel barrel layer
@ numberOfInnermostPixelLayerSplitHits
number of Pixel 0th layer barrel hits split by cluster splitting
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer

◆ predictMuon()

StatusCode Prompt::DecoratePLIT::predictMuon ( SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > & dec_trk_dr_lepton,
SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > & dec_trk_dr_leptontrack,
SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > & dec_trk_electron_track,
SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > & dec_trk_muon_track,
const xAOD::Muon & muon,
const xAOD::TrackParticleContainer & tracks,
std::vector< SG::WriteDecorHandle< xAOD::MuonContainer, float > > & dec_mu_plit_output,
const EventContext & ctx ) const
private

Definition at line 199 of file DecoratePLIT.cxx.

207 {
208 // set up accessors
209 // ---------------
210 SG::ReadDecorHandle<xAOD::MuonContainer, float> acc_ptvarcone30TTVA{m_acc_mu_ptvarcone30TTVA, ctx};
211 SG::ReadDecorHandle<xAOD::MuonContainer, float> acc_topoetcone30{m_acc_mu_topoetcone30, ctx};
212
213 SG::ReadDecorHandle<xAOD::TrackParticleContainer, float> acc_dr_lepton{m_acc_trk_dr_lepton, ctx};
214 SG::ReadDecorHandle<xAOD::TrackParticleContainer, float> acc_dr_leptontrack{m_acc_trk_dr_leptontrack, ctx};
215 SG::ReadDecorHandle<xAOD::TrackParticleContainer, float> acc_d0{m_acc_trk_d0, ctx};
216 SG::ReadDecorHandle<xAOD::TrackParticleContainer, float> acc_z0SinTheta{m_acc_trk_z0SinTheta, ctx};
217 SG::ReadDecorHandle<xAOD::TrackParticleContainer, float> acc_d0Uncertainty{m_acc_trk_d0Uncertainty, ctx};
218 SG::ReadDecorHandle<xAOD::TrackParticleContainer, float> acc_z0SinThetaUncertainty{m_acc_trk_z0SinThetaUncertainty, ctx};
219 SG::ReadDecorHandle<xAOD::TrackParticleContainer, char> acc_muon_track{m_acc_trk_muon_track, ctx};
220
221 // prepare input
222 // -------------
224
225 // collect muon features
226 float muon_pt = muon.pt();
227 float muon_eta = muon.eta();
228 float muon_phi = muon.phi();
229
230 float muon_ptvarcone30TTVARel = acc_ptvarcone30TTVA(muon) / muon_pt;
231 float muon_topoetcone30Rel = acc_topoetcone30(muon) / muon_pt;
232
233 float muon_caloClusterERel = -99;
234 const xAOD::CaloCluster* cluster = muon.cluster();
235 if (cluster) {
236 float energyloss = 0;
237 if (!muon.parameter(energyloss,xAOD::Muon::ParamDef::EnergyLoss)) {
238 ATH_MSG_WARNING("DecoratePLIT::execute - failed to retrieve energy loss");
239 return StatusCode::FAILURE;
240 }
241 float calE = cluster->calE();
242 // TODO: in future trainings, we need to prevent negative energy loss values
243 // keeping it as is for now, since latest trainings have been done without this check
244 // only protecting against zero energy loss
245 if (std::abs(energyloss) != 0)
246 muon_caloClusterERel = calE / energyloss;
247 }
248
249 // package muon features for inference
250 std::vector<float> muon_feat = {
251 muon_pt,
252 muon_eta,
253 muon_phi,
254 muon_ptvarcone30TTVARel,
255 muon_topoetcone30Rel,
256 muon_caloClusterERel};
257 std::vector<int64_t> muon_feat_dim = {1, static_cast<int64_t>(muon_feat.size())};
258
259 // need to use the "jet_features" keyword as we are borrowing flavour tagging code
260 FlavorTagInference::Inputs muon_info (muon_feat, muon_feat_dim);
261 gnn_input.insert({"jet_features", muon_info});
262
263 // decorate and fill track particles around the muon
264 const xAOD::TrackParticle *muonTrack = muon.trackParticle(xAOD::Muon::TrackParticleType::Primary);
265 std::vector<const xAOD::IParticle *> parts;
266
267 if(!fillParticles(dec_trk_dr_lepton, dec_trk_dr_leptontrack, dec_trk_electron_track, dec_trk_muon_track,
268 parts, muon, muonTrack, tracks, ctx)) {
269 ATH_MSG_ERROR("DecoratePLIT::execute - failed to fill particles");
270 return StatusCode::FAILURE;
271 }
272
273 // extract track features from track particles
274 std::vector<float> track_feat;
275 track_feat.reserve(parts.size() * static_cast<int64_t>(muon_feat.size()));
276
277 // loop over parts and fill track_feat vector
278 for (const xAOD::IParticle *part: parts) {
279 const xAOD::TrackParticle *track = dynamic_cast<const xAOD::TrackParticle*>(part);
280
281 // deta_lepton
282 float deta_lepton = track->p4().Eta() - muon.eta();
283 // dphi_lepton
284 float dphi_lepton = track->p4().DeltaPhi(muon.p4());
285 // qOverP
286 float qoverp = track->qOverP();
287 // btagIp_d0
288 float d0 = acc_d0(*track);
289 // btagIp_z0SinTheta
290 float z0SinTheta = acc_z0SinTheta(*track);
291 // btagIp_d0Uncertainty
292 float d0Uncertainty = acc_d0Uncertainty(*track);
293 // btagIp_z0SinThetaUncertainty
294 float z0SinThetaUncertainty = acc_z0SinThetaUncertainty(*track);
295 // btagIp_d0_significance
296 float d0_significance = -99;
297 if (abs(d0Uncertainty) > 0) d0_significance = d0 / d0Uncertainty;
298 // btagIp_z0SinTheta_significance
299 float z0SinTheta_significance = -99;
300 if (std::abs(z0SinThetaUncertainty) > 0) z0SinTheta_significance = z0SinTheta / z0SinThetaUncertainty;
301 // numberOfPixelHits
302 uint8_t pix_hits = 0;
303 if(!track->summaryValue(pix_hits,xAOD::numberOfPixelHits)){
304 ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfPixelHits");
305 return StatusCode::FAILURE;
306 }
307 // numberOfInnermostPixelLayerHits
308 uint8_t pix_innermosthits = 0;
309 if(!track->summaryValue(pix_innermosthits,xAOD::numberOfInnermostPixelLayerHits)){
310 ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfInnermostPixelLayerHits");
311 return StatusCode::FAILURE;
312 }
313 // numberOfNextToInnermostPixelLayerHits
314 uint8_t pix_nextinnermosthits = 0;
315 if(!track->summaryValue(pix_nextinnermosthits,xAOD::numberOfNextToInnermostPixelLayerHits)){
316 ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfNextToInnermostPixelLayerHits");
317 return StatusCode::FAILURE;
318 }
319 // numberOfInnermostPixelLayerSharedHits
320 uint8_t pix_innermostsharedhits = 0;
321 if(!track->summaryValue(pix_innermostsharedhits,xAOD::numberOfInnermostPixelLayerSharedHits)){
322 ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfInnermostPixelLayerSharedHits");
323 return StatusCode::FAILURE;
324 }
325 // numberOfInnermostPixelLayerSplitHits
326 uint8_t pix_innermostsplithits = 0;
327 if(!track->summaryValue(pix_innermostsplithits,xAOD::numberOfInnermostPixelLayerSplitHits)){
328 ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfInnermostPixelLayerSplitHits");
329 return StatusCode::FAILURE;
330 }
331 // numberOfPixelSharedHits
332 uint8_t pix_shared = 0;
333 if(!track->summaryValue(pix_shared,xAOD::numberOfPixelSharedHits)){
334 ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfPixelSharedHits");
335 return StatusCode::FAILURE;
336 }
337 // numberOfPixelSplitHits
338 uint8_t pix_split = 0;
339 if(!track->summaryValue(pix_split,xAOD::numberOfPixelSplitHits)){
340 ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfPixelSplitHits");
341 return StatusCode::FAILURE;
342 }
343 // numberOfSCTHits
344 uint8_t sct_hits = 0;
345 if(!track->summaryValue(sct_hits,xAOD::numberOfSCTHits)){
346 ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfSCTHits");
347 return StatusCode::FAILURE;
348 }
349 // numberOfSCTSharedHits
350 uint8_t sct_shared = 0;
351 if(!track->summaryValue(sct_shared,xAOD::numberOfSCTSharedHits)){
352 ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfSCTSharedHits");
353 return StatusCode::FAILURE;
354 }
355 // muon_track
356 char muon_track = acc_muon_track(*track);
357
358 track_feat.push_back(deta_lepton);
359 track_feat.push_back(dphi_lepton);
360 track_feat.push_back(qoverp);
361 track_feat.push_back(d0);
362 track_feat.push_back(z0SinTheta);
363 //track_feat.push_back(d0Uncertainty); // removed in the latest trainings, redundant
364 //track_feat.push_back(z0SinThetaUncertainty); // removed in the latest trainings, redundant
365 track_feat.push_back(d0_significance);
366 track_feat.push_back(z0SinTheta_significance);
367 track_feat.push_back(pix_hits);
368 track_feat.push_back(pix_innermosthits);
369 track_feat.push_back(pix_nextinnermosthits);
370 track_feat.push_back(pix_innermostsharedhits);
371 track_feat.push_back(pix_innermostsplithits);
372 track_feat.push_back(pix_shared);
373 track_feat.push_back(pix_split);
374 track_feat.push_back(sct_hits);
375 track_feat.push_back(sct_shared);
376 track_feat.push_back(muon_track);
377 }
378
379 // prepare track features for inference
380 int num_cnsts = parts.size();
381 std::vector<int64_t> track_feat_dim = {num_cnsts, m_num_track_features};
382
383 FlavorTagInference::Inputs track_info(track_feat, track_feat_dim);
384 gnn_input.insert({"track_features", track_info});
385
386 if (msgLvl(MSG::VERBOSE)) {
387 ATH_MSG_VERBOSE("gnn_input size = " << gnn_input.size());
388 for (auto& inp : gnn_input){
389 ATH_MSG_VERBOSE(" " + inp.first + " dim = ");
390 for (auto & dim: inp.second.second) {
391 ATH_MSG_VERBOSE(" " + std::to_string(dim));
392 }
393 ATH_MSG_VERBOSE(" " + inp.first + " content = ");
394 for (auto & con: inp.second.first) {
395 ATH_MSG_VERBOSE(" " + std::to_string(con));
396 }
397 }
398 }
399
400 // run inference
401 // -------------
402 auto [out_f, out_vc, out_vf] = m_saltModel->runInference(gnn_input);
403 if (msgLvl(MSG::VERBOSE)) {
404 ATH_MSG_VERBOSE("runInference done.");
405
406 ATH_MSG_VERBOSE("Output Float(s):");
407 for (auto& singlefloat : out_f){
408 ATH_MSG_VERBOSE(singlefloat.first + " = " << singlefloat.second);
409 }
410 ATH_MSG_VERBOSE("Output vector char(s):");
411 for (auto& vecchar : out_vc){
412 ATH_MSG_VERBOSE(vecchar.first + " = ");
413 for (auto& cc : vecchar.second){
414 ATH_MSG_VERBOSE(cc);
415 }
416 }
417 ATH_MSG_VERBOSE("Output vector float(s):");
418 for (auto& vecfloat : out_vf){
419 ATH_MSG_VERBOSE(vecfloat.first + " = ");
420 for (auto& ff : vecfloat.second){
421 ATH_MSG_VERBOSE(ff);
422 }
423 }
424 }
425 // filling the tagger scores
426 auto it_dec_mu_plit_output = dec_mu_plit_output.begin();
427 for (auto& singlefloat : out_f){
428 ATH_MSG_DEBUG("DecoratePLIT::execute - Muon output: " + singlefloat.first + " = " + std::to_string(singlefloat.second));
429 (*it_dec_mu_plit_output)(muon) = singlefloat.second;
430 ++it_dec_mu_plit_output;
431 }
432
433 return StatusCode::SUCCESS;
434 }
#define ATH_MSG_WARNING(x,...)
flt_t calE() const
Geet Energy in signal state CALIBRATED.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 352 of file AthCommonDataStore.h.

352 {
354 }

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }

Member Data Documentation

◆ m_acc_el_ptvarcone30

SG::ReadDecorHandleKey<xAOD::ElectronContainer> Prompt::DecoratePLIT::m_acc_el_ptvarcone30 {this,"acc_el_ptvarcone30",m_electronsKey, "ptvarcone30"}
private

Definition at line 134 of file DecoratePLIT.h.

134{this,"acc_el_ptvarcone30",m_electronsKey, "ptvarcone30"};

◆ m_acc_el_topoetcone30

SG::ReadDecorHandleKey<xAOD::ElectronContainer> Prompt::DecoratePLIT::m_acc_el_topoetcone30 {this,"acc_el_topoetcone30",m_electronsKey, "topoetcone30"}
private

Definition at line 135 of file DecoratePLIT.h.

135{this,"acc_el_topoetcone30",m_electronsKey, "topoetcone30"};

◆ m_acc_mu_ptvarcone30TTVA

SG::ReadDecorHandleKey<xAOD::MuonContainer> Prompt::DecoratePLIT::m_acc_mu_ptvarcone30TTVA {this, "acc_mu_ptvarcone30TTVA",m_muonsKey, "ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt500"}
private

Definition at line 131 of file DecoratePLIT.h.

131{this, "acc_mu_ptvarcone30TTVA",m_muonsKey, "ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt500"};

◆ m_acc_mu_topoetcone30

SG::ReadDecorHandleKey<xAOD::MuonContainer> Prompt::DecoratePLIT::m_acc_mu_topoetcone30 {this, "acc_mu_topoetcone30",m_muonsKey, "topoetcone30"}
private

Definition at line 132 of file DecoratePLIT.h.

132{this, "acc_mu_topoetcone30",m_muonsKey, "topoetcone30"};

◆ m_acc_trk_d0

SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> Prompt::DecoratePLIT::m_acc_trk_d0 {this,"acc_trk_d0", m_tracksKey, m_btagIp_prefix + "d0"}
private

Definition at line 139 of file DecoratePLIT.h.

139{this,"acc_trk_d0", m_tracksKey, m_btagIp_prefix + "d0"};
Gaudi::Property< std::string > m_btagIp_prefix

◆ m_acc_trk_d0Uncertainty

SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> Prompt::DecoratePLIT::m_acc_trk_d0Uncertainty {this, "acc_trk_d0Uncertainty", m_tracksKey, m_btagIp_prefix + "d0Uncertainty"}
private

Definition at line 141 of file DecoratePLIT.h.

141{this, "acc_trk_d0Uncertainty", m_tracksKey, m_btagIp_prefix + "d0Uncertainty"};

◆ m_acc_trk_dr_lepton

SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> Prompt::DecoratePLIT::m_acc_trk_dr_lepton {this, "acc_trk_dr_lepton",m_tracksKey, "dr_lepton"}
private

Definition at line 137 of file DecoratePLIT.h.

137{this, "acc_trk_dr_lepton",m_tracksKey, "dr_lepton"};

◆ m_acc_trk_dr_leptontrack

SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> Prompt::DecoratePLIT::m_acc_trk_dr_leptontrack {this, "acc_trk_dr_leptontrack",m_tracksKey, "dr_leptontrack"}
private

Definition at line 138 of file DecoratePLIT.h.

138{this, "acc_trk_dr_leptontrack",m_tracksKey, "dr_leptontrack"};

◆ m_acc_trk_electron_track

SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> Prompt::DecoratePLIT::m_acc_trk_electron_track {this,"acc_trk_electron_track", m_tracksKey, "electron_track"}
private

Definition at line 144 of file DecoratePLIT.h.

144{this,"acc_trk_electron_track", m_tracksKey, "electron_track"};

◆ m_acc_trk_muon_track

SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> Prompt::DecoratePLIT::m_acc_trk_muon_track {this, "acc_trk_muon_track", m_tracksKey, "muon_track"}
private

Definition at line 143 of file DecoratePLIT.h.

143{this, "acc_trk_muon_track", m_tracksKey, "muon_track"};

◆ m_acc_trk_z0SinTheta

SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> Prompt::DecoratePLIT::m_acc_trk_z0SinTheta {this, "acc_trk_z0SinTheta", m_tracksKey, m_btagIp_prefix + "z0SinTheta"}
private

Definition at line 140 of file DecoratePLIT.h.

140{this, "acc_trk_z0SinTheta", m_tracksKey, m_btagIp_prefix + "z0SinTheta"};

◆ m_acc_trk_z0SinThetaUncertainty

SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> Prompt::DecoratePLIT::m_acc_trk_z0SinThetaUncertainty {this, "acc_trk_z0SinThetaUncertainty", m_tracksKey, m_btagIp_prefix + "z0SinThetaUncertainty"}
private

Definition at line 142 of file DecoratePLIT.h.

142{this, "acc_trk_z0SinThetaUncertainty", m_tracksKey, m_btagIp_prefix + "z0SinThetaUncertainty"};

◆ m_btagIp_prefix

Gaudi::Property<std::string> Prompt::DecoratePLIT::m_btagIp_prefix
private
Initial value:
{
this, "btagIp_prefix", "btagIp_", "Prefix of b-tagging impact parameter variables (w.r.t. primary vertex)"}

Definition at line 105 of file DecoratePLIT.h.

105 {
106 this, "btagIp_prefix", "btagIp_", "Prefix of b-tagging impact parameter variables (w.r.t. primary vertex)"};

◆ m_caloclustersKey

SG::ReadHandleKey<xAOD::CaloClusterContainer> Prompt::DecoratePLIT::m_caloclustersKey
private
Initial value:
{
this, "CaloClusterContainerKey", "egammaClusters",
"Calo cluster container name"
}

Definition at line 125 of file DecoratePLIT.h.

125 {
126 this, "CaloClusterContainerKey", "egammaClusters",
127 "Calo cluster container name"
128 };

◆ m_configFileVersion

Gaudi::Property<std::string> Prompt::DecoratePLIT::m_configFileVersion {this, "ConfigFileVersion", "", "Vector of tagger score files"}
private

Definition at line 98 of file DecoratePLIT.h.

98{this, "ConfigFileVersion", "", "Vector of tagger score files"};

◆ m_configFileVersion_endcap

Gaudi::Property<std::string> Prompt::DecoratePLIT::m_configFileVersion_endcap {this, "ConfigFileVersion_endcap", "", "Vector of tagger score files for endcap"}
private

Definition at line 99 of file DecoratePLIT.h.

99{this, "ConfigFileVersion_endcap", "", "Vector of tagger score files for endcap"};

◆ m_configPath

Gaudi::Property<std::string> Prompt::DecoratePLIT::m_configPath {this, "ConfigPath", "", "Path of the directory containing the onnx files"}
private

Definition at line 97 of file DecoratePLIT.h.

97{this, "ConfigPath", "", "Path of the directory containing the onnx files"};

◆ m_dec_el_plit_output

SG::WriteDecorHandleKeyArray<xAOD::ElectronContainer> Prompt::DecoratePLIT::m_dec_el_plit_output {this, "PLITelOutput", {}}
private

Definition at line 146 of file DecoratePLIT.h.

146{this, "PLITelOutput", {}};

◆ m_dec_mu_plit_output

SG::WriteDecorHandleKeyArray<xAOD::MuonContainer> Prompt::DecoratePLIT::m_dec_mu_plit_output {this, "PLITmuOutput", {}}
private

Definition at line 147 of file DecoratePLIT.h.

147{this, "PLITmuOutput", {}};

◆ m_dec_trk_dr_lepton

SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> Prompt::DecoratePLIT::m_dec_trk_dr_lepton {this, "dec_trk_dr_lepton", m_tracksKey, "dr_lepton"}
private

Definition at line 149 of file DecoratePLIT.h.

149{this, "dec_trk_dr_lepton", m_tracksKey, "dr_lepton"};

◆ m_dec_trk_dr_leptontrack

SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> Prompt::DecoratePLIT::m_dec_trk_dr_leptontrack {this, "dec_trk_dr_leptontrack", m_tracksKey, "dr_leptontrack"}
private

Definition at line 152 of file DecoratePLIT.h.

152{this, "dec_trk_dr_leptontrack", m_tracksKey, "dr_leptontrack"};

◆ m_dec_trk_electron_track

SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> Prompt::DecoratePLIT::m_dec_trk_electron_track {this, "dec_trk_electron_track", m_tracksKey, "electron_track"}
private

Definition at line 150 of file DecoratePLIT.h.

150{this, "dec_trk_electron_track", m_tracksKey, "electron_track"};

◆ m_dec_trk_muon_track

SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> Prompt::DecoratePLIT::m_dec_trk_muon_track {this, "dec_trk_muon_track", m_tracksKey, "muon_track"}
private

Definition at line 151 of file DecoratePLIT.h.

151{this, "dec_trk_muon_track", m_tracksKey, "muon_track"};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 381 of file AthCommonDataStore.h.

◆ m_electronsKey

SG::ReadHandleKey<xAOD::ElectronContainer> Prompt::DecoratePLIT::m_electronsKey
private
Initial value:
{
this, "ElectronContainerKey", "Electrons",
"Electron container name"
}

Definition at line 109 of file DecoratePLIT.h.

109 {
110 this, "ElectronContainerKey", "Electrons",
111 "Electron container name"
112 };

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_lepCalErelConeSize

Gaudi::Property<float> Prompt::DecoratePLIT::m_lepCalErelConeSize
private
Initial value:
{
this, "lepCalErelConeSize", 0.15, "Cone size for relative calo cluster energy sum"}

Definition at line 103 of file DecoratePLIT.h.

103 {
104 this, "lepCalErelConeSize", 0.15, "Cone size for relative calo cluster energy sum"};

◆ m_leptonsName

Gaudi::Property<std::string> Prompt::DecoratePLIT::m_leptonsName
private
Initial value:
{
this, "LeptonContainerName", "",
"Container's name of the lepton that you want to decorate. Also need to set ElectronContainerKey or MuonContainerKey accordingly"
}

Definition at line 93 of file DecoratePLIT.h.

93 {
94 this, "LeptonContainerName", "",
95 "Container's name of the lepton that you want to decorate. Also need to set ElectronContainerKey or MuonContainerKey accordingly"
96 };

◆ m_maxLepTrackdR

Gaudi::Property<float> Prompt::DecoratePLIT::m_maxLepTrackdR
private
Initial value:
{
this, "maxLepTrackdR", 0.4, "Maximum distance between lepton and track"}

Definition at line 101 of file DecoratePLIT.h.

101 {
102 this, "maxLepTrackdR", 0.4, "Maximum distance between lepton and track"};

◆ m_muonsKey

SG::ReadHandleKey<xAOD::MuonContainer> Prompt::DecoratePLIT::m_muonsKey
private
Initial value:
{
this, "MuonContainerKey", "Muons",
"Muon container name"
}

Definition at line 113 of file DecoratePLIT.h.

113 {
114 this, "MuonContainerKey", "Muons",
115 "Muon container name"
116 };

◆ m_num_lepton_features

int Prompt::DecoratePLIT::m_num_lepton_features {}
private

Definition at line 46 of file DecoratePLIT.h.

46{};

◆ m_num_track_features

int Prompt::DecoratePLIT::m_num_track_features {}
private

Definition at line 47 of file DecoratePLIT.h.

47{};

◆ m_saltModel

std::shared_ptr<const FlavorTagInference::SaltModel> Prompt::DecoratePLIT::m_saltModel {}
private

Definition at line 43 of file DecoratePLIT.h.

43{};

◆ m_saltModel_endcap

std::shared_ptr<const FlavorTagInference::SaltModel> Prompt::DecoratePLIT::m_saltModel_endcap {}
private

Definition at line 44 of file DecoratePLIT.h.

44{};

◆ m_TaggerName

Gaudi::Property<std::string> Prompt::DecoratePLIT::m_TaggerName {this, "TaggerName", "", "Tagger name"}
private

Definition at line 100 of file DecoratePLIT.h.

100{this, "TaggerName", "", "Tagger name"};

◆ m_trackjetsKey

SG::ReadHandleKey<xAOD::JetContainer> Prompt::DecoratePLIT::m_trackjetsKey
private
Initial value:
{
this, "TrackJetContainerKey", "AntiKtVR30Rmax4Rmin02PV0TrackJets",
"VR track jet container name"
}

Definition at line 117 of file DecoratePLIT.h.

117 {
118 this, "TrackJetContainerKey", "AntiKtVR30Rmax4Rmin02PV0TrackJets",
119 "VR track jet container name"
120 };

◆ m_tracksKey

SG::ReadHandleKey<xAOD::TrackParticleContainer> Prompt::DecoratePLIT::m_tracksKey
private
Initial value:
{
this, "TracksContainerKey", "InDetTrackParticles",
"Tracks container name"
}

Definition at line 121 of file DecoratePLIT.h.

121 {
122 this, "TracksContainerKey", "InDetTrackParticles",
123 "Tracks container name"
124 };

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 386 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: