![]() |
ATLAS Offline Software
|
#include <JetTruthLabelingTool.h>
Classes | |
| struct | DecorHandles |
| Track internally if the W,Z,Top labels should be done (for large-R). More... | |
Public Member Functions | |
| JetTruthLabelingTool (const std::string &name="JetTruthLabelingTool") | |
| default constructor - to be used in all derived classes | |
| virtual StatusCode | initialize () override |
| Dummy implementation of the initialisation function. | |
| StatusCode | decorate (const xAOD::JetContainer &jets) const override |
| decorate truth label to a jet collection | |
| void | print () const override |
| Print configured parameters. | |
| const std::string & | getLargeRJetTruthLabelName () const |
| returns the name of large-R jet truth label | |
| 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 | sysInitialize () override |
| Perform system initialization for an algorithm. | |
| 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 |
| virtual StatusCode | modify (xAOD::JetContainer &jets) const override final |
| Concrete implementation of the function inherited from IJetModifier. | |
Additional helper functions, not directly mimicking Athena | |
| template<class T> | |
| const T * | getProperty (const std::string &name) const |
| Get one of the tool's properties. | |
| const std::string & | msg_level_name () const __attribute__((deprecated)) |
| A deprecated function for getting the message level's name. | |
| const std::string & | getName (const void *ptr) const |
| Get the name of an object that is / should be in the event store. | |
| SG::sgkey_t | getKey (const void *ptr) const |
| Get the (hashed) key of an object that is in the event store. | |
Protected Types | |
| enum class | TruthLabelConfiguration { R21Precision_2022v1 , R10TruthLabel_R22v1 , R10WZTruthLabel_R22v1 , R4TruthLabel , R4TruthDressedWZLabel , R4InTimeTruthLabel , Unknown } |
Protected Member Functions | |
| StatusCode | labelTruthJets (DecorHandles &dh, const EventContext &ctx) const |
| Label truth jet collection. | |
| StatusCode | labelTruthJets (DecorHandles &dh, const xAOD::JetContainer &jets, const EventContext &ctx) const |
| StatusCode | labelRecoJets (DecorHandles &dh, const xAOD::JetContainer &jets, const EventContext &ctx) const |
| Apply labels to all jets in a container. | |
| int | getTruthJetLabelGA (DecorHandles &dh, const xAOD::Jet &jet, const EventContext &ctx) const |
| Get truth label using ghost-associated particles. | |
| int | getLabel (DecorHandles &dh, const xAOD::Jet &jet, bool matchH, bool matchW, bool matchZ, bool matchTop, const EventContext &ctx) const |
| Get label based on matching and containment criteria. | |
| float | getWZSplit12Cut (float pt) const |
| Get W/Z label Split12 cut. | |
| float | getTopSplit23Cut (float pt) const |
| Get top label Split23 cut. | |
| int | getNGhostParticles (const xAOD::Jet &jet, const std::string &collection) const |
| Get number of ghost associated particles. | |
| TruthLabelConfiguration | parseLabel (const std::string &label) |
| 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. | |
Protected Attributes | |
| Gaudi::Property< std::string > | m_jetContainerName {this, "RecoJetContainer", "", "Input reco jet container name"} |
| Gaudi::Property< std::string > | m_truthLabelName {this, "TruthLabelName", "R10TruthLabel_R22v1", "Truth label name"} |
| Gaudi::Property< bool > | m_isTruthJetCol {this, "IsTruthJetCollection", false, "Flag indicating whether input collection is a truth jet container"} |
| Gaudi::Property< bool > | m_forceDeltaRMatch {this, "ForceDeltaRMatch", false, "Whether to force dR matching e.g. if GhostTruth is not available"} |
| SG::ReadHandleKey< xAOD::EventInfo > | m_evtInfoKey {this, "EventInfoKey", "EventInfo", "Name of EventInfo object"} |
| SG::ReadHandleKey< xAOD::JetContainer > | m_truthJetCollectionKey {this, "TruthJetContainer", "", "Do not configure manually!"} |
| parameters for truth labeling | |
| SG::ReadHandleKey< xAOD::JetContainer > | m_truthGroomedJetCollectionKey {this, "TruthGroomedJetContainer", "", "Do not configure manually!"} |
| bool | m_useGhostJetMatch {} |
| bool | m_matchUngroomedParent {} |
| Use ghost association to match reco to truth jets, dR otherwise. | |
| bool | m_getTruthGroomedJetValues {} |
| Use the ungroomed reco jet parent to match to truth jet. | |
| double | m_dRTruthJet {} |
| When truth jet matching to ungroomed truth, allow saving properties of groomed truth jets. | |
| double | m_recoGhostFrac {} |
| dR to match truth jet to reco jet | |
| double | m_mLowTop {} |
| Ghost pT fraction to match truth jet to reco jet. | |
| double | m_mLowW {} |
| Lower mass cut for top label. | |
| double | m_mLowZ {} |
| Lower mass cut for W label. | |
| bool | m_doLargeRLabels {true} |
| Lower mass cut for Z label. | |
| TruthLabelConfiguration | m_truthLabelConfig = TruthLabelConfiguration::Unknown |
| SG::WriteDecorHandleKey< xAOD::JetContainer > | m_label_truthKey {this, "label_TruthKey", "", "Do not configure manually!"} |
| SG::WriteDecorHandleKey< xAOD::JetContainer > | m_NB_truthKey {this, "NB_TruthKey", "", "Do not configure manually!"} |
| SG::ReadDecorHandleKey< xAOD::JetContainer > | m_split12_truthKey {this, "Split12_TruthKey", "", "Do not configure manually!"} |
| SG::ReadDecorHandleKey< xAOD::JetContainer > | m_split23_truthKey {this, "Split23_TruthKey", "", "Do not configure manually!"} |
| SG::WriteDecorHandleKey< xAOD::JetContainer > | m_label_recoKey {this, "label_RecoKey", "", "Do not configure manually!"} |
| SG::WriteDecorHandleKey< xAOD::JetContainer > | m_NB_recoKey {this, "NB_RecoKey", "", "Do not configure manually!"} |
| SG::WriteDecorHandleKey< xAOD::JetContainer > | m_truthSplit12_recoKey {this, "TruthSplit12_RecoKey", "", "Do not configure manually!"} |
| SG::WriteDecorHandleKey< xAOD::JetContainer > | m_truthSplit23_recoKey {this, "TruthSplit23_RecoKey", "", "Do not configure manually!"} |
| SG::WriteDecorHandleKey< xAOD::JetContainer > | m_matchedTruthJet_recoKey {this, "MatchedTruthJet_RecoKey", "", "Do not configure manually!"} |
| SG::WriteDecorHandleKey< xAOD::JetContainer > | m_matchedTruthJetMass_recoKey {this, "MatchedTruthJetMass_RecoKey", "", "Do not configure manually!"} |
| SG::WriteDecorHandleKey< xAOD::JetContainer > | m_matchedTruthJetPt_recoKey {this, "MatchedTruthJetPt_RecoKey", "", "Do not configure manually!"} |
| SG::WriteDecorHandleKey< xAOD::JetContainer > | m_matchedTruthJetEta_recoKey { this, "MatchedTruthJetEta_RecoKey", "", "Do not configure manually!" } |
| SG::WriteDecorHandleKey< xAOD::JetContainer > | m_matchedTruthJetPhi_recoKey { this, "MatchedTruthJetPhi_RecoKey", "", "Do not configure manually!" } |
| SG::WriteDecorHandleKey< xAOD::JetContainer > | m_matchedTruthJetDR_recoKey { this, "MatchedTruthJetDR_RecoKey", "", "Do not configure manually!" } |
| SG::WriteDecorHandleKey< xAOD::JetContainer > | m_matchedTruthJetGF_recoKey { this, "MatchedTruthJetGF_RecoKey", "", "Do not configure manually!" } |
| SG::WriteDecorHandleKey< xAOD::JetContainer > | m_matchedTruthGroomedJetMass_recoKey {this, "MatchedTruthGroomedJetMass_RecoKey", "", "Do not configure manually!"} |
| SG::WriteDecorHandleKey< xAOD::JetContainer > | m_matchedTruthGroomedJetPt_recoKey {this, "MatchedTruthGroomedJetPt_RecoKey", "", "Do not configure manually!"} |
Private Types | |
| typedef ServiceHandle< StoreGateSvc > | StoreGateSvc_t |
Private Member Functions | |
| Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> | |
Private Attributes | |
| 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 |
Friends | |
| struct | DecorHandles |
Definition at line 24 of file JetTruthLabelingTool.h.
|
privateinherited |
Definition at line 388 of file AthCommonDataStore.h.
|
strongprotected |
| Enumerator | |
|---|---|
| R21Precision_2022v1 | |
| R10TruthLabel_R22v1 | |
| R10WZTruthLabel_R22v1 | |
| R4TruthLabel | |
| R4TruthDressedWZLabel | |
| R4InTimeTruthLabel | |
| Unknown | |
Definition at line 128 of file JetTruthLabelingTool.h.
| JetTruthLabelingTool::JetTruthLabelingTool | ( | const std::string & | name = "JetTruthLabelingTool" | ) |
default constructor - to be used in all derived classes
Definition at line 14 of file JetTruthLabelingTool.cxx.
|
inlineprivateinherited |
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
|
inlineinherited |
Definition at line 145 of file AthCommonDataStore.h.
|
overridevirtual |
decorate truth label to a jet collection
Apply label to truth jet collections
Copy label to matched reco jets
Implements IJetDecorator.
Definition at line 254 of file JetTruthLabelingTool.cxx.
|
inlineinherited |
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition at line 95 of file AthCommonDataStore.h.
|
inlineinherited |
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition at line 85 of file AthCommonDataStore.h.
|
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
|
inherited |
Get the (hashed) key of an object that is in the event store.
This is a bit of a special one. StoreGateSvc and xAOD::Event both provide ways for getting the SG::sgkey_t key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.
In order to allow tools to efficiently perform this operation, they can use this helper function.
| ptr | The bare pointer to the object that the event store should know about |
Definition at line 119 of file AsgTool.cxx.
|
protected |
Get label based on matching and containment criteria.
Booleans for containment selections
This method can be expanded to include custom label priorities
If it isn't matched to any heavy particles, is it QCD
Contained H->bb
Contained H->cc
Contained H->tautau
Other from H
Contained top
Contained W from a top
Contained W not from a top
Contained Z->bb
Contained Z->cc
Contained Z->tautau
Contained Z->qq
Uncontained top
Uncontained V
Definition at line 549 of file JetTruthLabelingTool.cxx.
|
inline |
returns the name of large-R jet truth label
Definition at line 43 of file JetTruthLabelingTool.h.
Get the name of an object that is / should be in the event store.
This is a bit of a special one. StoreGateSvc and xAOD::Event both provide ways for getting the std::string name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.
In order to allow tools to efficiently perform this operation, they can use this helper function.
| ptr | The bare pointer to the object that the event store should know about |
Definition at line 106 of file AsgTool.cxx.
|
protected |
Get number of ghost associated particles.
Definition at line 533 of file JetTruthLabelingTool.cxx.
Get one of the tool's properties.
|
protected |
Get top label Split23 cut.
The functional form and parameters come from optimization studies: https://indico.cern.ch/event/931498/contributions/3921872/attachments/2064188/3463746/JSS_25June.pdf
Definition at line 512 of file JetTruthLabelingTool.cxx.
|
protected |
Get truth label using ghost-associated particles.
Booleans to check ghost-associated heavy particles
Find ghost associated W bosons
Find ghost associated Z bosons
Find ghost associated H bosons
Find ghost associated top quarks
Definition at line 212 of file JetTruthLabelingTool.cxx.
|
protected |
Get W/Z label Split12 cut.
The functional form and parameters come from optimization studies: https://cds.cern.ch/record/2777009/files/ATL-PHYS-PUB-2021-029.pdf
Definition at line 494 of file JetTruthLabelingTool.cxx.
|
overridevirtual |
Dummy implementation of the initialisation function.
It's here to allow the dual-use tools to skip defining an initialisation function. Since many are doing so...
Check if TruthLabelName is supported. If not, give an error and return FAILURE
Ghost Association values
Hard-code some values for R10TruthLabel_R21Precision_2022v1 and R10TruthLabel_R22v1
Hard-code some values for R10WZTruthLabel_R22v1
Hard code for small-R jets
Reimplemented from asg::AsgTool.
Definition at line 43 of file JetTruthLabelingTool.cxx.
|
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.
|
protected |
Apply labels to all jets in a container.
Get parent ungroomed reco jet for matching
Find matched truth jet
If parent jet has been retrieved, calculate dR w.r.t. it instead
If m_dRTruthJet < 0, the closest truth jet is used as matched jet. Otherwise, only match if dR < m_dRTruthJet
Decorate truth label
Decorate additional information used for truth labeling
Definition at line 276 of file JetTruthLabelingTool.cxx.
|
protected |
Label truth jet collection.
Retrieve appropriate truth jet container
Make sure the truth jet collection has been retrieved
Definition at line 444 of file JetTruthLabelingTool.cxx.
|
protected |
Make sure there is at least 1 jet in truth collection
Check if the truth jet collection already has labels applied
Get the EventInfo to identify Sherpa samples
Apply label to truth jet
Definition at line 460 of file JetTruthLabelingTool.cxx.
|
inlinefinaloverridevirtualinherited |
Concrete implementation of the function inherited from IJetModifier.
Implements IJetModifier.
Definition at line 32 of file IJetDecorator.h.
|
inlineinherited |
Definition at line 24 of file AthCommonMsg.h.
|
inherited |
A deprecated function for getting the message level's name.
Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:
This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.
Definition at line 101 of file AsgTool.cxx.
|
inlineinherited |
Definition at line 30 of file AthCommonMsg.h.
|
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.
|
protected |
Definition at line 19 of file JetTruthLabelingTool.cxx.
|
overridevirtual |
Print configured parameters.
Reimplemented from asg::AsgTool.
Definition at line 171 of file JetTruthLabelingTool.cxx.
|
inlineprotectedinherited |
Definition at line 380 of file AthCommonDataStore.h.
|
inlineprotectedinherited |
remove all handles from I/O resolution
Definition at line 364 of file AthCommonDataStore.h.
|
overridevirtualinherited |
Perform system initialization for an algorithm.
We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.
Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.
|
overridevirtualinherited |
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
|
inlineinherited |
Definition at line 308 of file AthCommonDataStore.h.
|
friend |
Definition at line 95 of file JetTruthLabelingTool.h.
|
privateinherited |
Pointer to StoreGate (detector store by default).
Definition at line 393 of file AthCommonDataStore.h.
|
protected |
|
protected |
When truth jet matching to ungroomed truth, allow saving properties of groomed truth jets.
Definition at line 63 of file JetTruthLabelingTool.h.
|
protected |
Definition at line 55 of file JetTruthLabelingTool.h.
|
privateinherited |
Pointer to StoreGate (event store by default).
Definition at line 390 of file AthCommonDataStore.h.
|
protected |
Definition at line 53 of file JetTruthLabelingTool.h.
|
protected |
Use the ungroomed reco jet parent to match to truth jet.
Definition at line 62 of file JetTruthLabelingTool.h.
|
protected |
Definition at line 52 of file JetTruthLabelingTool.h.
|
protected |
Definition at line 49 of file JetTruthLabelingTool.h.
|
protected |
Definition at line 146 of file JetTruthLabelingTool.h.
|
protected |
Definition at line 141 of file JetTruthLabelingTool.h.
|
protected |
Definition at line 159 of file JetTruthLabelingTool.h.
|
protected |
Definition at line 160 of file JetTruthLabelingTool.h.
|
protected |
Definition at line 151 of file JetTruthLabelingTool.h.
|
protected |
Definition at line 156 of file JetTruthLabelingTool.h.
|
protected |
Definition at line 154 of file JetTruthLabelingTool.h.
|
protected |
Definition at line 157 of file JetTruthLabelingTool.h.
|
protected |
Definition at line 152 of file JetTruthLabelingTool.h.
|
protected |
Definition at line 155 of file JetTruthLabelingTool.h.
|
protected |
Definition at line 153 of file JetTruthLabelingTool.h.
|
protected |
Use ghost association to match reco to truth jets, dR otherwise.
Definition at line 61 of file JetTruthLabelingTool.h.
|
protected |
Ghost pT fraction to match truth jet to reco jet.
Definition at line 65 of file JetTruthLabelingTool.h.
|
protected |
|
protected |
|
protected |
Definition at line 147 of file JetTruthLabelingTool.h.
|
protected |
Definition at line 142 of file JetTruthLabelingTool.h.
|
protected |
|
protected |
Definition at line 143 of file JetTruthLabelingTool.h.
|
protected |
Definition at line 144 of file JetTruthLabelingTool.h.
|
protected |
Definition at line 59 of file JetTruthLabelingTool.h.
|
protected |
parameters for truth labeling
Definition at line 58 of file JetTruthLabelingTool.h.
|
protected |
Definition at line 139 of file JetTruthLabelingTool.h.
|
protected |
Definition at line 50 of file JetTruthLabelingTool.h.
|
protected |
Definition at line 148 of file JetTruthLabelingTool.h.
|
protected |
Definition at line 149 of file JetTruthLabelingTool.h.
|
protected |
Definition at line 60 of file JetTruthLabelingTool.h.
|
privateinherited |
Definition at line 399 of file AthCommonDataStore.h.
|
privateinherited |
Definition at line 398 of file AthCommonDataStore.h.