 |
ATLAS Offline Software
|
#include <DecoratePLIT.h>
|
| DecoratePLIT (const std::string &name, ISvcLocator *pSvcLocator) |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | execute (const EventContext &) const override |
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual bool | isClonable () const override |
| Specify if the algorithm is clonable. More...
|
|
virtual unsigned int | cardinality () const override |
| Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
|
|
virtual StatusCode | sysExecute (const EventContext &ctx) override |
| Execute an algorithm. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
virtual bool | filterPassed (const EventContext &ctx) const |
|
virtual void | setFilterPassed (bool state, const EventContext &ctx) const |
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T, V, H > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
StatusCode | initializeAccessors () |
|
StatusCode | predictElec (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 (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 (const xAOD::TrackParticle &track, float dr_lepton, bool isUsedForElectron, bool isUsedForMuon, const xAOD::TrackParticle *trackLep) const |
|
StatusCode | fillParticles (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> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
|
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", {}} |
|
const SG::Decorator< float > | m_dec_trk_dr_lepton {"dr_lepton"} |
|
const SG::Decorator< char > | m_dec_trk_electron_track {"electron_track"} |
|
const SG::Decorator< char > | m_dec_trk_muon_track {"muon_track"} |
|
const SG::Decorator< float > | m_dec_trk_dr_leptontrack {"dr_leptontrack"} |
|
DataObjIDColl | m_extendedExtraObjects |
| Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
|
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
Definition at line 34 of file DecoratePLIT.h.
◆ StoreGateSvc_t
◆ DecoratePLIT()
Prompt::DecoratePLIT::DecoratePLIT |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ cardinality()
Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
Override this to return 0 for reentrant algorithms.
Override this to return 0 for reentrant algorithms.
Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ decorateTrack()
Definition at line 801 of file DecoratePLIT.cxx.
813 float dr_leptontrack = -99;
815 if (trackLep->
pt() > 0.) {
816 dr_leptontrack =
track.p4().DeltaR(trackLep->
p4());
821 return StatusCode::SUCCESS;
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode Prompt::DecoratePLIT::execute |
( |
const EventContext & |
ctx | ) |
const |
|
overridevirtual |
Definition at line 116 of file DecoratePLIT.cxx.
121 if (!tracks->empty()) {
131 std::vector<SG::WriteDecorHandle<xAOD::ElectronContainer, float>> dec_el_plit_output;
133 dec_el_plit_output.emplace_back(wdhk, ctx);
137 if (!
predictElec(*elec, *tracks, *caloclusters, dec_el_plit_output, ctx)) {
138 ATH_MSG_ERROR(
"DecoratePLIT::execute - failed to predict electron");
139 return StatusCode::FAILURE;
145 std::vector<SG::WriteDecorHandle<xAOD::MuonContainer, float>> dec_mu_plit_output;
147 dec_mu_plit_output.emplace_back(wdhk, ctx);
152 ATH_MSG_ERROR(
"DecoratePLIT::execute - failed to predict muon");
153 return StatusCode::FAILURE;
158 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
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()
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.
◆ fillParticles()
Definition at line 745 of file DecoratePLIT.cxx.
756 std::set<const xAOD::TrackParticle*> tracksUsedForElectron;
757 std::set<const xAOD::TrackParticle*> tracksUsedForMuon;
758 if (
const auto* elec =
dynamic_cast<const xAOD::Electron*
>(&lepton)) {
760 }
else if (
const auto*
muon =
dynamic_cast<const xAOD::Muon*
>(&lepton)) {
762 tracksUsedForMuon.insert(*(
muon->inDetTrackParticleLink()));
769 ATH_MSG_ERROR(
"DecoratePLIT::fillParticles - null track pointer");
776 float dr_lepton = (lepton.
p4().Pt() > 0.) ?
track->p4().DeltaR(lepton.
p4()) : -99;
781 bool isUsedForElectron = tracksUsedForElectron.count(
track);
782 bool isUsedForMuon = tracksUsedForMuon.count(
track);
785 ATH_MSG_ERROR(
"DecoratePLIT::fillParticles - failed to decorate track");
786 return StatusCode::FAILURE;
794 return a->p4().DeltaR(lepton_p4) <
b->p4().DeltaR(lepton_p4);
798 return StatusCode::SUCCESS;
◆ filterPassed()
◆ initialize()
StatusCode Prompt::DecoratePLIT::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 19 of file DecoratePLIT.cxx.
41 m_saltModel = std::make_shared<FlavorTagInference::SaltModel>(fullPathToOnnxFile);
44 m_saltModel_endcap = std::make_shared<FlavorTagInference::SaltModel>(fullPathToOnnxFile_endcap);
50 std::map<std::string, FlavorTagInference::Inputs> gnn_input;
53 std::vector<int64_t> elec_feat_dim = {1,
static_cast<int64_t
>(elec_feat.size())};
55 gnn_input.insert({
"jet_features", elec_info});
60 gnn_input.insert({
"track_features", track_info});
62 auto [out_f, out_vc, out_vf] =
m_saltModel->runInference(gnn_input);
64 std::vector<std::string> output_names;
65 for (
auto& singlefloat : out_f){
69 output_names.push_back(
outname);
76 m_saltModel = std::make_shared<FlavorTagInference::SaltModel>(fullPathToOnnxFile);
82 std::map<std::string, FlavorTagInference::Inputs> gnn_input;
85 std::vector<int64_t> muon_feat_dim = {1,
static_cast<int64_t
>(muon_feat.size())};
87 gnn_input.insert({
"jet_features", muon_info});
92 gnn_input.insert({
"track_features", track_info});
94 auto [out_f, out_vc, out_vf] =
m_saltModel->runInference(gnn_input);
96 std::vector<std::string> output_names;
97 for (
auto& singlefloat : out_f){
99 std::string
outname =
m_muonsKey.
key()+
"." +
m_TaggerName +
"_" + (singlefloat.first.find(
"muxpromp") != std::string::npos ?
"TPLTmu_pmuxpromp" :
"TPLTmu_pnpxall" );
101 output_names.push_back(
outname);
108 return StatusCode::FAILURE;
113 return StatusCode::SUCCESS;
◆ initializeAccessors()
StatusCode Prompt::DecoratePLIT::initializeAccessors |
( |
| ) |
|
|
private |
◆ inputHandles()
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()
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
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()
Definition at line 665 of file DecoratePLIT.cxx.
668 constexpr
float pt_minimum = 500;
669 constexpr
float abs_eta_maximum = 2.5;
670 constexpr
float d0_maximum = 3.5;
671 constexpr
float z0_maximum= 5.0;
672 constexpr
unsigned char si_hits_minimum = 8;
673 constexpr
unsigned char si_shared_maximum = 1;
674 constexpr
unsigned char si_holes_maximum = 2;
675 constexpr
unsigned char pix_holes_maximum = 1;
684 ATH_MSG_ERROR(
"DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfPixelSharedHits");
689 ATH_MSG_ERROR(
"DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfSCTSharedHits");
694 ATH_MSG_ERROR(
"DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfPixelHits");
699 ATH_MSG_ERROR(
"DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfSCTHits");
704 ATH_MSG_ERROR(
"DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfPixelDeadSensors");
709 ATH_MSG_ERROR(
"DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfSCTDeadSensors");
714 ATH_MSG_ERROR(
"DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfPixelHoles");
719 ATH_MSG_ERROR(
"DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfSCTHoles");
723 if (std::abs(
tp.eta()) > abs_eta_maximum)
725 double n_module_shared = (pix_shared + sct_shared / 2);
726 if (n_module_shared > si_shared_maximum)
728 if (
tp.pt() <= pt_minimum)
730 if (std::isfinite(d0_maximum) &&
731 std::abs(acc_d0(
tp)) >= d0_maximum)
733 if (std::isfinite(z0_maximum) &&
734 std::abs(acc_z0SinTheta(
tp)) >= z0_maximum)
736 if (pix_hits + pix_dead + sct_hits + sct_dead < si_hits_minimum)
738 if ((pix_holes + sct_holes) > si_holes_maximum)
740 if (pix_holes > pix_holes_maximum)
◆ predictElec()
Definition at line 413 of file DecoratePLIT.cxx.
421 std::map<std::string, FlavorTagInference::Inputs> gnn_input;
440 float elec_ptvarcone30Rel = acc_ptvarcone30(
electron) / elec_pt;
441 float elec_topoetcone30Rel = acc_topoetcone30(
electron) / elec_pt;
444 float elec_caloClusterSumEtRel = 0.0;
445 float sumCoreEt_large = 0.0;
447 float elec_calEta =
electron.caloCluster()->eta();
448 float elec_calPhi =
electron.caloCluster()->phi();
451 float deta = elec_calEta - cluster->eta();
453 float dr = std::sqrt(deta*deta + dphi*dphi);
456 sumCoreEt_large += cluster->pt();
460 elec_caloClusterSumEtRel = sumCoreEt_large / elec_pt;
465 if (bestmatchedGSFElTrack) {
478 std::vector<float> electron_feat = {
483 elec_topoetcone30Rel,
484 elec_caloClusterSumEtRel};
485 std::vector<int64_t> electron_feat_dim = {1,
static_cast<int64_t
>(electron_feat.size())};
489 gnn_input.insert({
"jet_features", electron_info});
492 std::vector<const xAOD::IParticle *>
parts;
494 ATH_MSG_ERROR(
"DecoratePLIT::execute - failed to fill particles");
495 return StatusCode::FAILURE;
499 std::vector<float> track_feat;
500 track_feat.reserve(
parts.size() *
static_cast<int64_t
>(electron_feat.size()));
516 float qoverp =
track->qOverP();
523 float d0_significance = -99;
527 float z0SinTheta_significance = -99;
532 ATH_MSG_ERROR(
"DecoratePLIT::execute - failed to retrieve xAOD::numberOfInnermostPixelLayerHits");
533 return StatusCode::FAILURE;
536 uint8_t pix_nextinnermosthits = 0;
538 ATH_MSG_ERROR(
"DecoratePLIT::execute - failed to retrieve xAOD::numberOfNextToInnermostPixelLayerHits");
539 return StatusCode::FAILURE;
542 uint8_t pix_innermostsharedhits = 0;
544 ATH_MSG_ERROR(
"DecoratePLIT::execute - failed to retrieve xAOD::numberOfInnermostPixelLayerSharedHits");
545 return StatusCode::FAILURE;
548 uint8_t pix_innermostsplithits = 0;
550 ATH_MSG_ERROR(
"DecoratePLIT::execute - failed to retrieve xAOD::numberOfInnermostPixelLayerSplitHits");
551 return StatusCode::FAILURE;
556 ATH_MSG_ERROR(
"DecoratePLIT::execute - failed to retrieve xAOD::numberOfPixelHits");
557 return StatusCode::FAILURE;
562 ATH_MSG_ERROR(
"DecoratePLIT::execute - failed to retrieve xAOD::numberOfPixelSharedHits");
563 return StatusCode::FAILURE;
568 ATH_MSG_ERROR(
"DecoratePLIT::execute - failed to retrieve xAOD::numberOfPixelSplitHits");
569 return StatusCode::FAILURE;
574 ATH_MSG_ERROR(
"DecoratePLIT::execute - failed to retrieve xAOD::numberOfSCTHits");
575 return StatusCode::FAILURE;
580 ATH_MSG_ERROR(
"DecoratePLIT::execute - failed to retrieve xAOD::numberOfSCTSharedHits");
581 return StatusCode::FAILURE;
584 char electron_track = acc_electron_track(*
track);
588 track_feat.push_back(deta_lepton);
589 track_feat.push_back(dphi_lepton);
590 track_feat.push_back(qoverp);
591 track_feat.push_back(
d0);
593 track_feat.push_back(d0_significance);
594 track_feat.push_back(z0SinTheta_significance);
595 track_feat.push_back(pix_innermosthits);
596 track_feat.push_back(pix_nextinnermosthits);
597 track_feat.push_back(pix_innermostsharedhits);
598 track_feat.push_back(pix_innermostsplithits);
599 track_feat.push_back(pix_hits);
600 track_feat.push_back(pix_shared);
601 track_feat.push_back(pix_split);
602 track_feat.push_back(sct_hits);
603 track_feat.push_back(sct_shared);
604 track_feat.push_back(electron_track);
608 int num_cnsts =
parts.size();
612 gnn_input.insert({
"track_features", track_info});
616 for (
auto& inp : gnn_input){
618 for (
auto &
dim: inp.second.second) {
622 for (
auto & con: inp.second.first) {
631 auto [out_f, out_vc, out_vf] = (std::abs(elec_eta) < 1.37) ?
m_saltModel->runInference(gnn_input) :
m_saltModel_endcap->runInference(gnn_input);
636 for (
auto& singlefloat : out_f){
640 for (
auto& vecchar : out_vc){
642 for (
auto&
cc : vecchar.second){
647 for (
auto& vecfloat : out_vf){
649 for (
auto&
ff : vecfloat.second){
655 auto it_dec_el_plit_output = dec_el_plit_output.begin();
656 for (
auto& singlefloat : out_f){
658 (*it_dec_el_plit_output)(
electron) = singlefloat.second;
659 ++it_dec_el_plit_output;
662 return StatusCode::SUCCESS;
◆ predictMuon()
Definition at line 181 of file DecoratePLIT.cxx.
201 std::map<std::string, FlavorTagInference::Inputs> gnn_input;
204 float muon_pt =
muon.pt();
205 float muon_eta =
muon.eta();
206 float muon_phi =
muon.phi();
208 float muon_ptvarcone30TTVARel = acc_ptvarcone30TTVA(
muon) / muon_pt;
209 float muon_topoetcone30Rel = acc_topoetcone30(
muon) / muon_pt;
211 float muon_caloClusterERel = -99;
214 float energyloss = 0;
215 if (!
muon.parameter(energyloss,xAOD::Muon::EnergyLoss)) {
216 ATH_MSG_WARNING(
"DecoratePLIT::execute - failed to retrieve energy loss");
217 return StatusCode::FAILURE;
219 float calE = cluster->
calE();
223 if (std::abs(energyloss) != 0)
224 muon_caloClusterERel = calE / energyloss;
228 std::vector<float> muon_feat = {
232 muon_ptvarcone30TTVARel,
233 muon_topoetcone30Rel,
234 muon_caloClusterERel};
235 std::vector<int64_t> muon_feat_dim = {1,
static_cast<int64_t
>(muon_feat.size())};
239 gnn_input.insert({
"jet_features", muon_info});
243 std::vector<const xAOD::IParticle *>
parts;
246 ATH_MSG_ERROR(
"DecoratePLIT::execute - failed to fill particles");
247 return StatusCode::FAILURE;
251 std::vector<float> track_feat;
252 track_feat.reserve(
parts.size() *
static_cast<int64_t
>(muon_feat.size()));
259 float deta_lepton =
track->p4().Eta() -
muon.eta();
261 float dphi_lepton =
track->p4().DeltaPhi(
muon.p4());
263 float qoverp =
track->qOverP();
273 float d0_significance = -99;
276 float z0SinTheta_significance = -99;
281 ATH_MSG_ERROR(
"DecoratePLIT::execute - failed to retrieve xAOD::numberOfPixelHits");
282 return StatusCode::FAILURE;
287 ATH_MSG_ERROR(
"DecoratePLIT::execute - failed to retrieve xAOD::numberOfInnermostPixelLayerHits");
288 return StatusCode::FAILURE;
291 uint8_t pix_nextinnermosthits = 0;
293 ATH_MSG_ERROR(
"DecoratePLIT::execute - failed to retrieve xAOD::numberOfNextToInnermostPixelLayerHits");
294 return StatusCode::FAILURE;
297 uint8_t pix_innermostsharedhits = 0;
299 ATH_MSG_ERROR(
"DecoratePLIT::execute - failed to retrieve xAOD::numberOfInnermostPixelLayerSharedHits");
300 return StatusCode::FAILURE;
303 uint8_t pix_innermostsplithits = 0;
305 ATH_MSG_ERROR(
"DecoratePLIT::execute - failed to retrieve xAOD::numberOfInnermostPixelLayerSplitHits");
306 return StatusCode::FAILURE;
311 ATH_MSG_ERROR(
"DecoratePLIT::execute - failed to retrieve xAOD::numberOfPixelSharedHits");
312 return StatusCode::FAILURE;
317 ATH_MSG_ERROR(
"DecoratePLIT::execute - failed to retrieve xAOD::numberOfPixelSplitHits");
318 return StatusCode::FAILURE;
323 ATH_MSG_ERROR(
"DecoratePLIT::execute - failed to retrieve xAOD::numberOfSCTHits");
324 return StatusCode::FAILURE;
329 ATH_MSG_ERROR(
"DecoratePLIT::execute - failed to retrieve xAOD::numberOfSCTSharedHits");
330 return StatusCode::FAILURE;
333 char muon_track = acc_muon_track(*
track);
335 track_feat.push_back(deta_lepton);
336 track_feat.push_back(dphi_lepton);
337 track_feat.push_back(qoverp);
338 track_feat.push_back(
d0);
342 track_feat.push_back(d0_significance);
343 track_feat.push_back(z0SinTheta_significance);
344 track_feat.push_back(pix_hits);
345 track_feat.push_back(pix_innermosthits);
346 track_feat.push_back(pix_nextinnermosthits);
347 track_feat.push_back(pix_innermostsharedhits);
348 track_feat.push_back(pix_innermostsplithits);
349 track_feat.push_back(pix_shared);
350 track_feat.push_back(pix_split);
351 track_feat.push_back(sct_hits);
352 track_feat.push_back(sct_shared);
353 track_feat.push_back(muon_track);
357 int num_cnsts =
parts.size();
361 gnn_input.insert({
"track_features", track_info});
365 for (
auto& inp : gnn_input){
367 for (
auto &
dim: inp.second.second) {
371 for (
auto & con: inp.second.first) {
379 auto [out_f, out_vc, out_vf] =
m_saltModel->runInference(gnn_input);
384 for (
auto& singlefloat : out_f){
388 for (
auto& vecchar : out_vc){
390 for (
auto&
cc : vecchar.second){
395 for (
auto& vecfloat : out_vf){
397 for (
auto&
ff : vecfloat.second){
403 auto it_dec_mu_plit_output = dec_mu_plit_output.begin();
404 for (
auto& singlefloat : out_f){
406 (*it_dec_mu_plit_output)(
muon) = singlefloat.second;
407 ++it_dec_mu_plit_output;
410 return StatusCode::SUCCESS;
◆ renounce()
◆ renounceArray()
◆ setFilterPassed()
◆ sysExecute()
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.
Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.
◆ sysInitialize()
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 InputMakerBase, and HypoBase.
Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.
110 if (
sc.isFailure()) {
118 if ( cs.retrieve().isFailure() ) {
120 return StatusCode::SUCCESS;
122 if (cs->regHandle(
this,*
h).isFailure()) {
123 sc = StatusCode::FAILURE;
124 ATH_MSG_ERROR(
"unable to register WriteCondHandle " <<
h->fullKey()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_acc_el_ptvarcone30
◆ m_acc_el_topoetcone30
◆ m_acc_mu_ptvarcone30TTVA
◆ m_acc_mu_topoetcone30
◆ m_acc_trk_d0
◆ m_acc_trk_d0Uncertainty
◆ m_acc_trk_dr_lepton
◆ m_acc_trk_dr_leptontrack
◆ m_acc_trk_electron_track
◆ m_acc_trk_muon_track
◆ m_acc_trk_z0SinTheta
◆ m_acc_trk_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 89 of file DecoratePLIT.h.
◆ m_caloclustersKey
Initial value:{
this, "CaloClusterContainerKey", "egammaClusters",
"Calo cluster container name"
}
Definition at line 109 of file DecoratePLIT.h.
◆ m_configFileVersion
Gaudi::Property<std::string> Prompt::DecoratePLIT::m_configFileVersion {this, "ConfigFileVersion", "", "Vector of tagger score files"} |
|
private |
◆ m_configFileVersion_endcap
Gaudi::Property<std::string> Prompt::DecoratePLIT::m_configFileVersion_endcap {this, "ConfigFileVersion_endcap", "", "Vector of tagger score files for endcap"} |
|
private |
◆ m_configPath
Gaudi::Property<std::string> Prompt::DecoratePLIT::m_configPath {this, "ConfigPath", "", "Path of the directory containing the onnx files"} |
|
private |
◆ m_dec_el_plit_output
◆ m_dec_mu_plit_output
◆ m_dec_trk_dr_lepton
◆ m_dec_trk_dr_leptontrack
const SG::Decorator<float> Prompt::DecoratePLIT::m_dec_trk_dr_leptontrack {"dr_leptontrack"} |
|
private |
◆ m_dec_trk_electron_track
const SG::Decorator<char> Prompt::DecoratePLIT::m_dec_trk_electron_track {"electron_track"} |
|
private |
◆ m_dec_trk_muon_track
◆ m_detStore
◆ m_electronsKey
Initial value:{
this, "ElectronContainerKey", "Electrons",
"Electron container name"
}
Definition at line 93 of file DecoratePLIT.h.
◆ m_evtStore
◆ m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Empty if no symlinks were found.
Definition at line 114 of file AthCommonReentrantAlgorithm.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 87 of file DecoratePLIT.h.
◆ 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 77 of file DecoratePLIT.h.
◆ 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 85 of file DecoratePLIT.h.
◆ m_muonsKey
Initial value:{
this, "MuonContainerKey", "Muons",
"Muon container name"
}
Definition at line 97 of file DecoratePLIT.h.
◆ m_num_lepton_features
int Prompt::DecoratePLIT::m_num_lepton_features {} |
|
private |
◆ m_num_track_features
int Prompt::DecoratePLIT::m_num_track_features {} |
|
private |
◆ m_saltModel
std::shared_ptr<const FlavorTagInference::SaltModel> Prompt::DecoratePLIT::m_saltModel {} |
|
private |
◆ m_saltModel_endcap
std::shared_ptr<const FlavorTagInference::SaltModel> Prompt::DecoratePLIT::m_saltModel_endcap {} |
|
private |
◆ m_TaggerName
Gaudi::Property<std::string> Prompt::DecoratePLIT::m_TaggerName {this, "TaggerName", "", "Tagger name"} |
|
private |
◆ m_trackjetsKey
Initial value:{
this, "TrackJetContainerKey", "AntiKtVR30Rmax4Rmin02PV0TrackJets",
"VR track jet container name"
}
Definition at line 101 of file DecoratePLIT.h.
◆ m_tracksKey
Initial value:{
this, "TracksContainerKey", "InDetTrackParticles",
"Tracks container name"
}
Definition at line 105 of file DecoratePLIT.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
int m_num_lepton_features
StatusCode fillParticles(std::vector< const xAOD::IParticle * > &parts, const xAOD::IParticle &lepton, const xAOD::TrackParticle *trackLep, const xAOD::TrackParticleContainer &trackContainer, const EventContext &ctx) const
virtual double pt() const override final
The transverse momentum ( ) of the particle.
@ numberOfPixelHoles
number of pixel layers on track with absence of hits [unit8_t].
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_z0SinTheta
@ numberOfInnermostPixelLayerSplitHits
number of Pixel 0th layer barrel hits split by cluster splitting
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].
flt_t calE() const
Geet Energy in signal state CALIBRATED.
StatusCode decorateTrack(const xAOD::TrackParticle &track, float dr_lepton, bool isUsedForElectron, bool isUsedForMuon, const xAOD::TrackParticle *trackLep) const
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_caloclustersKey
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::ReadHandleKey< xAOD::ElectronContainer > m_electronsKey
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
Gaudi::Property< std::string > m_configFileVersion_endcap
bool msgLvl(const MSG::Level lvl) const
container_pointer_type getDecorationArray(const AuxVectorData &container) const
Get a pointer to the start of the auxiliary data array.
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
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.
const SG::Decorator< float > m_dec_trk_dr_lepton
StatusCode predictMuon(const xAOD::Muon &muon, const xAOD::TrackParticleContainer &tracks, std::vector< SG::WriteDecorHandle< xAOD::MuonContainer, float >> &dec_mu_plit_output, const EventContext &ctx) const
const SG::Decorator< char > m_dec_trk_electron_track
const std::string z0SinThetaUncertainty
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
SG::WriteDecorHandleKeyArray< xAOD::MuonContainer > m_dec_mu_plit_output
bool empty() const
Test if the key is blank.
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_z0SinThetaUncertainty
Class providing the definition of the 4-vector interface.
__HOSTDEV__ double Phi_mpi_pi(double)
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_muon_track
virtual void setOwner(IDataHandleHolder *o)=0
An algorithm that can be simultaneously executed in multiple threads.
std::shared_ptr< const FlavorTagInference::SaltModel > m_saltModel_endcap
float z0SinTheta(const U &p)
StatusCode initializeAccessors()
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_dr_leptontrack
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
SG::ReadDecorHandleKey< xAOD::MuonContainer > m_acc_mu_topoetcone30
const SG::Decorator< char > m_dec_trk_muon_track
virtual const DataObjIDColl & extraOutputDeps() const override
Return the list of extra output dependencies.
Description of a calorimeter cluster.
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
Handle class for reading a decoration on an object.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
SG::ReadDecorHandleKey< xAOD::ElectronContainer > m_acc_el_ptvarcone30
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
virtual StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
std::shared_ptr< const FlavorTagInference::SaltModel > m_saltModel
SG::ReadDecorHandleKey< xAOD::ElectronContainer > m_acc_el_topoetcone30
Gaudi::Property< float > m_maxLepTrackdR
bool passed_r22tracking_cuts(const xAOD::TrackParticle &tp, const EventContext &ctx) const
SG::WriteDecorHandleKeyArray< xAOD::ElectronContainer > m_dec_el_plit_output
Gaudi::Property< std::string > m_configFileVersion
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
@ numberOfPixelSplitHits
number of Pixel all-layer hits split by cluster splitting [unit8_t].
@ numberOfSCTHoles
number of SCT holes [unit8_t].
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_tracksKey
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_dr_lepton
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Gaudi::Property< std::string > m_TaggerName
@ numberOfNextToInnermostPixelLayerHits
these are the hits in the 1st pixel barrel layer
std::string to_string(const DetectorType &type)
StatusCode predictElec(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
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...
virtual FourMom_t p4() const =0
The full 4-momentum of the particle.
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
SG::ReadHandleKey< xAOD::MuonContainer > m_muonsKey
const SG::Decorator< float > m_dec_trk_dr_leptontrack
Gaudi::Property< float > m_lepCalErelConeSize
Gaudi::Property< std::string > m_configPath
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_d0
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_electron_track
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
#define ATH_MSG_WARNING(x)
@ numberOfSCTDeadSensors
number of dead SCT sensors crossed [unit8_t].
SG::ReadDecorHandleKey< xAOD::MuonContainer > m_acc_mu_ptvarcone30TTVA
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
@ numberOfInnermostPixelLayerSharedHits
number of Pixel 0th layer barrel hits shared by several tracks.
virtual StatusCode sysInitialize() override
Override sysInitialize.
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ numberOfPixelDeadSensors
number of dead pixel sensors crossed [unit8_t].
Class describing a TrackParticle.
std::pair< std::vector< float >, std::vector< int64_t > > Inputs
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_d0Uncertainty
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer
Gaudi::Property< std::string > m_leptonsName
SG::ReadHandleKey< xAOD::JetContainer > m_trackjetsKey
const std::string d0Uncertainty