ATLAS Offline Software
Loading...
Searching...
No Matches
JetTruthLabelingTool Class Reference

#include <JetTruthLabelingTool.h>

Inheritance diagram for JetTruthLabelingTool:
Collaboration diagram for JetTruthLabelingTool:

Classes

struct  DecorHandles
 Upper mass cut for Z label. 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 {
  R21Consolidated , R21Precision , R21Precision_2022v1 , R10TruthLabel_R22v1 ,
  R10WZTruthLabel_R22v1 , R4TruthLabel , 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 getTruthJetLabelDR (DecorHandles &dh, const xAOD::Jet &jet, const std::vector< std::pair< TLorentzVector, int > > &tlv_truthParts, const EventContext &ctx) const
 Get truth label using dR-matched particles.
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, std::string collection) const
 Get number of ghost associated particles.
bool getIsSherpa (const int DSID) const
 Check for Sherpa DSIDs.
void getTLVs (std::vector< std::pair< TLorentzVector, int > > &tlvs, const xAOD::TruthParticleContainer *truthBosons, const xAOD::TruthParticleContainer *truthTop, bool isSherpa=false) const
 Extract heavy particle 4-vectors from truth record.
bool selectTruthParticle (const xAOD::TruthParticle *tp, int pdgId) const
 Check if truth particle has correct DSID and isn't self decay.
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_R21Consolidated", "Truth label name"}
Gaudi::Property< bool > m_isTruthJetCol {this, "IsTruthJetCollection", false, "Flag indicating whether input collection is a truth jet container"}
SG::ReadHandleKey< xAOD::EventInfom_evtInfoKey {this, "EventInfoKey", "EventInfo", "Name of EventInfo object"}
Gaudi::Property< bool > m_useTRUTH3 {this, "UseTRUTH3", false, "True for TRUTH3 format, false for TRUTH1"}
 TRUTH1 or TRUTH3.
SG::ReadHandleKey< xAOD::TruthParticleContainerm_truthParticleContainerName {this, "TruthParticleContainerName", "TruthParticles", "Truth particle container name"}
SG::ReadHandleKey< xAOD::TruthParticleContainerm_truthBosonContainerName {this, "TruthBosonContainerName", "TruthBosonsWithDecayParticles", "Truth boson container name"}
SG::ReadHandleKey< xAOD::TruthParticleContainerm_truthTopQuarkContainerName {this, "TruthTopQuarkContainerName", "TruthTopQuarkWithDecayParticles", "Truth top container name"}
SG::ReadHandleKey< xAOD::JetContainerm_truthJetCollectionName {this, "TruthJetContainer", "", "Do not configure manually!"}
 parameters for truth labeling
SG::ReadHandleKey< xAOD::JetContainerm_truthGroomedJetCollectionName {this, "TruthGroomedJetContainer", "", "Do not configure manually!"}
bool m_useDRMatch {}
bool m_useWZMassHigh {}
 Use dR to match partons to truth jet.
bool m_useGhostJetMatch {}
 Use upper mass cut for W/Z labels.
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_dRTruthPart {}
 Ghost pT fraction to match truth jet to reco jet.
double m_mLowTop {}
 dR to match truth particles to truth jet
double m_mLowW {}
 Lower mass cut for top label.
double m_mHighW {}
 Lower mass cut for W label.
double m_mLowZ {}
 Upper mass cut for W label.
double m_mHighZ {}
 Lower mass cut for Z label.
TruthLabelConfiguration m_truthLabelConfig = TruthLabelConfiguration::Unknown
SG::WriteDecorHandleKey< xAOD::JetContainerm_label_truthKey {this, "label_TruthKey", "", "Do not configure manually!"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_dR_W_truthKey {this, "dR_W_TruthKey", "", "Do not configure manually!"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_dR_Z_truthKey {this, "dR_Z_TruthKey", "", "Do not configure manually!"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_dR_H_truthKey {this, "dR_H_TruthKey", "", "Do not configure manually!"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_dR_Top_truthKey {this, "dR_Top_TruthKey", "", "Do not configure manually!"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_NB_truthKey {this, "NB_TruthKey", "", "Do not configure manually!"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_split12_truthKey {this, "Split12_TruthKey", "", "Do not configure manually!"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_split23_truthKey {this, "Split23_TruthKey", "", "Do not configure manually!"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_label_recoKey {this, "label_RecoKey", "", "Do not configure manually!"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_dR_W_recoKey {this, "dR_W_RecoKey", "", "Do not configure manually!"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_dR_Z_recoKey {this, "dR_Z_RecoKey", "", "Do not configure manually!"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_dR_H_recoKey {this, "dR_H_RecoKey", "", "Do not configure manually!"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_dR_Top_recoKey {this, "dR_Top_RecoKey", "", "Do not configure manually!"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_NB_recoKey {this, "NB_RecoKey", "", "Do not configure manually!"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_truthSplit12_recoKey {this, "TruthSplit12_RecoKey", "", "Do not configure manually!"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_truthSplit23_recoKey {this, "TruthSplit23_RecoKey", "", "Do not configure manually!"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_matchedTruthJetMass_recoKey {this, "MatchedTruthJetMass_RecoKey", "", "Do not configure manually!"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_matchedTruthJetPt_recoKey {this, "MatchedTruthJetPt_RecoKey", "", "Do not configure manually!"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_matchedTruthJetEta_recoKey { this, "MatchedTruthJetEta_RecoKey", "", "Do not configure manually!" }
SG::WriteDecorHandleKey< xAOD::JetContainerm_matchedTruthJetPhi_recoKey { this, "MatchedTruthJetPhi_RecoKey", "", "Do not configure manually!" }
SG::WriteDecorHandleKey< xAOD::JetContainerm_matchedTruthJetDR_recoKey { this, "MatchedTruthJetDR_RecoKey", "", "Do not configure manually!" }
SG::WriteDecorHandleKey< xAOD::JetContainerm_matchedTruthJetGF_recoKey { this, "MatchedTruthJetGF_RecoKey", "", "Do not configure manually!" }
SG::WriteDecorHandleKey< xAOD::JetContainerm_matchedTruthGroomedJetMass_recoKey {this, "MatchedTruthGroomedJetMass_RecoKey", "", "Do not configure manually!"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_matchedTruthGroomedJetPt_recoKey {this, "MatchedTruthGroomedJetPt_RecoKey", "", "Do not configure manually!"}

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_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

Detailed Description

Definition at line 23 of file JetTruthLabelingTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ TruthLabelConfiguration

Enumerator
R21Consolidated 
R21Precision 
R21Precision_2022v1 
R10TruthLabel_R22v1 
R10WZTruthLabel_R22v1 
R4TruthLabel 
Unknown 

Definition at line 164 of file JetTruthLabelingTool.h.

164 {
165 R21Consolidated,
166 R21Precision,
167 R21Precision_2022v1,
168 R10TruthLabel_R22v1,
169 R10WZTruthLabel_R22v1,
170 R4TruthLabel,
171 Unknown
172 };
@ Unknown
Definition TruthClasses.h:9

Constructor & Destructor Documentation

◆ JetTruthLabelingTool()

JetTruthLabelingTool::JetTruthLabelingTool ( const std::string & name = "JetTruthLabelingTool")

default constructor - to be used in all derived classes

Definition at line 14 of file JetTruthLabelingTool.cxx.

14 :
15 asg::AsgTool(name)
16{}

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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>

◆ decorate()

StatusCode JetTruthLabelingTool::decorate ( const xAOD::JetContainer & jets) const
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 384 of file JetTruthLabelingTool.cxx.

384 {
385 const EventContext& ctx = Gaudi::Hive::currentContext();
386 DecorHandles dh (*this, ctx);
387
389 if(m_isTruthJetCol) {
390 return labelTruthJets(dh, jets, ctx);
391 }
392
394 return labelRecoJets(dh, jets, ctx);
395 }
396
398 else {
399 ATH_CHECK( labelTruthJets(dh, ctx) );
400 return labelRecoJets(dh, jets, ctx);
401 }
402
403 return StatusCode::SUCCESS;
404}
#define ATH_CHECK
Evaluate an expression and check for errors.
StatusCode labelRecoJets(DecorHandles &dh, const xAOD::JetContainer &jets, const EventContext &ctx) const
Apply labels to all jets in a container.
StatusCode labelTruthJets(DecorHandles &dh, const EventContext &ctx) const
Label truth jet collection.
Gaudi::Property< bool > m_isTruthJetCol
TruthLabelConfiguration m_truthLabelConfig

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::evtStore ( )
inlineinherited

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

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::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

◆ getIsSherpa()

bool JetTruthLabelingTool::getIsSherpa ( const int DSID) const
inlineprotected

Check for Sherpa DSIDs.

Definition at line 148 of file JetTruthLabelingTool.h.

148 {
149 if(
150 (304307 <= DSID && DSID <= 304309) || // Sherpa 2.2.1 W+jets
151 (304707 <= DSID && DSID <= 304709) // Sherpa 2.2.1 Z+jets
152 ) {
153 return true;
154 }
155 return false;
156 };

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void * ptr) const
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.

See also
asg::AsgTool::getName
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The hashed key of the object in the store. If not found, an invalid (zero) key.

Definition at line 119 of file AsgTool.cxx.

119 {
120
121#ifdef XAOD_STANDALONE
122 // In case we use @c xAOD::Event, we have a direct function call
123 // for this.
124 return evtStore()->event()->getKey( ptr );
125#else
126 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127 return ( proxy == nullptr ? 0 : proxy->sgkey() );
128#endif // XAOD_STANDALONE
129 }
ServiceHandle< StoreGateSvc > & evtStore()

◆ getLabel()

int JetTruthLabelingTool::getLabel ( DecorHandles & dh,
const xAOD::Jet & jet,
bool matchH,
bool matchW,
bool matchZ,
bool matchTop,
const EventContext & ctx ) const
protected

Get label based on matching and containment criteria.

Booleans for containment selections

Use R21Consolidated definition

Use R21Precision definition

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 885 of file JetTruthLabelingTool.cxx.

891 {
892
893 // store GhostBHadronsFinal count
894 int nMatchB = getNGhostParticles( jet, "GhostBHadronsFinal" );
895 (*dh.nbHandle)(jet) = nMatchB;
896
898 bool is_bb = false;
899 bool is_cc = false;
900 bool is_tautauEl = false;
901 bool is_tautauMu = false;
902 bool is_tautauHad = false;
903 bool isTop = false;
904 bool isW = false;
905 bool isZ = false;
906
909 is_bb = ( nMatchB > 1 );
910 isTop = ( matchTop && nMatchB > 0 && jet.m() / 1000. > m_mLowTop );
911 isW = matchW && nMatchB == 0 && jet.m() / 1000. > m_mLowW && jet.m() / 1000. < m_mHighW;
912 isZ = matchZ && jet.m() / 1000. > m_mLowZ && jet.m() / 1000. < m_mHighZ;
913 }
914
917 SG::ReadDecorHandle<xAOD::JetContainer, float> split23Handle(m_split23_truthKey, ctx);
918 is_bb = ( nMatchB > 1 );
919 isTop = ( matchTop && matchW && nMatchB > 0 && jet.m() / 1000. > m_mLowTop && split23Handle(jet) / 1000. > getTopSplit23Cut( jet.pt() / 1000. ) );
920 isW = matchW && nMatchB == 0 && jet.m() / 1000. > m_mLowW && jet.m() / 1000. < m_mHighW;
921 isZ = matchZ && jet.m() / 1000. > m_mLowZ && jet.m() / 1000. < m_mHighZ;
922 }
923
924 // Use R21Precision_2022v1 definition
926 SG::ReadDecorHandle<xAOD::JetContainer, float> split23Handle(m_split23_truthKey, ctx);
927 SG::ReadDecorHandle<xAOD::JetContainer, float> split12Handle(m_split12_truthKey, ctx);
928 is_bb = ( nMatchB > 1 );
929 isTop = ( matchTop && matchW && nMatchB > 0 && jet.m() / 1000. > m_mLowTop && split23Handle(jet) / 1000. > getTopSplit23Cut( jet.pt() / 1000. ) );
930 isW = matchW && nMatchB == 0 && jet.m() / 1000. > m_mLowW && split12Handle(jet) / 1000. > getWZSplit12Cut( jet.pt() / 1000. );
931 isZ = matchZ && jet.m() / 1000. > m_mLowZ && split12Handle(jet) / 1000. > getWZSplit12Cut( jet.pt() / 1000. );
932 }
933
934 // Use R10TruthLabel_R22v1 definition
936 // get extended ghost associated truth label
937 int extended_GA_label = -1;
938 if (not jet.getAttribute("HadronGhostExtendedTruthLabelID", extended_GA_label)) {
939 ATH_MSG_ERROR( "HadronGhostExtendedTruthLabelID not available for " + m_truthJetCollectionName.key() );
940 }
941
942 SG::ReadDecorHandle<xAOD::JetContainer, float> split23Handle(m_split23_truthKey, ctx);
943 SG::ReadDecorHandle<xAOD::JetContainer, float> split12Handle(m_split12_truthKey, ctx);
944 is_bb = ( extended_GA_label == 55 );
945 is_cc = ( extended_GA_label == 44 );
946 is_tautauEl = ( extended_GA_label == 151511 );
947 is_tautauMu = ( extended_GA_label == 151513 );
948 is_tautauHad = ( extended_GA_label == 1515 );
949 isTop = ( matchTop && matchW && nMatchB > 0 && jet.m() / 1000. > m_mLowTop && split23Handle(jet) / 1000. > getTopSplit23Cut( jet.pt() / 1000. ) );
950 isW = matchW && nMatchB == 0 && jet.m() / 1000. > m_mLowW && split12Handle(jet) / 1000. > getWZSplit12Cut( jet.pt() / 1000. );
951 isZ = matchZ && jet.m() / 1000. > m_mLowZ && split12Handle(jet) / 1000. > getWZSplit12Cut( jet.pt() / 1000. );
952 }
953
954
956
957 /* The default priority of labels is:
958 * 1) Hbb/cc/tautau
959 * 2) Contained top
960 * 3) Contained W
961 * 4) Contained Zbb/cc/qq/tautau
962 * 5) Uncontained top
963 * 6) Uncontained V
964 */
965
967 if( !(matchTop || matchW || matchZ || matchH) ) {
969 }
970
971 // Higgs
972 if ( matchH ) {
974 if ( is_bb ) return LargeRJetTruthLabel::Hbb;
976 if ( is_cc ) return LargeRJetTruthLabel::Hcc;
978 if ( is_tautauEl ) return LargeRJetTruthLabel::HtautauEl;
979 if ( is_tautauMu ) return LargeRJetTruthLabel::HtautauMu;
980 if ( is_tautauHad ) return LargeRJetTruthLabel::HtautauHad;
983 }
984
986 if ( isTop ) return LargeRJetTruthLabel::tqqb;
987
988 if ( isW ) {
990 if ( matchTop ) return LargeRJetTruthLabel::Wqq_From_t;
993 }
994
995 if ( matchZ ) {
997 if ( is_bb ) return LargeRJetTruthLabel::Zbb;
999 if ( is_cc ) return LargeRJetTruthLabel::Zcc;
1001 if ( is_tautauEl ) return LargeRJetTruthLabel::ZtautauEl;
1002 if ( is_tautauMu ) return LargeRJetTruthLabel::ZtautauMu;
1003 if ( is_tautauHad ) return LargeRJetTruthLabel::ZtautauHad;
1004 }
1005 if ( isZ ) {
1008 }
1009
1011 if ( matchTop ) return LargeRJetTruthLabel::other_From_t;
1012
1015
1016}
#define ATH_MSG_ERROR(x)
bool isW(const T &p)
Definition AtlasPID.h:382
bool isZ(const T &p)
Definition AtlasPID.h:379
bool isTop(const T &p)
Definition AtlasPID.h:185
double m_mHighZ
Lower mass cut for Z label.
double m_mLowZ
Upper mass cut for W label.
float getTopSplit23Cut(float pt) const
Get top label Split23 cut.
double m_mLowTop
dR to match truth particles to truth jet
float getWZSplit12Cut(float pt) const
Get W/Z label Split12 cut.
int getNGhostParticles(const xAOD::Jet &jet, std::string collection) const
Get number of ghost associated particles.
SG::ReadDecorHandleKey< xAOD::JetContainer > m_split23_truthKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_split12_truthKey
SG::ReadHandleKey< xAOD::JetContainer > m_truthJetCollectionName
parameters for truth labeling
double m_mLowW
Lower mass cut for top label.
double m_mHighW
Lower mass cut for W label.
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition Jet_v1.cxx:44
virtual double m() const
The invariant mass of the particle.
Definition Jet_v1.cxx:59
bool getAttribute(AttributeID type, T &value) const
Retrieve attribute moment by enum.

◆ getLargeRJetTruthLabelName()

const std::string & JetTruthLabelingTool::getLargeRJetTruthLabelName ( ) const
inline

returns the name of large-R jet truth label

Definition at line 42 of file JetTruthLabelingTool.h.

42 {
43 return m_truthLabelName;
44 };
Gaudi::Property< std::string > m_truthLabelName

◆ getName()

const std::string & asg::AsgTool::getName ( const void * ptr) const
inherited

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.

See also
asg::AsgTool::getKey
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The string name of the object in the store. If not found, an empty string.

Definition at line 106 of file AsgTool.cxx.

106 {
107
108#ifdef XAOD_STANDALONE
109 // In case we use @c xAOD::Event, we have a direct function call
110 // for this.
111 return evtStore()->event()->getName( ptr );
112#else
113 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114 static const std::string dummy = "";
115 return ( proxy == nullptr ? dummy : proxy->name() );
116#endif // XAOD_STANDALONE
117 }

◆ getNGhostParticles()

int JetTruthLabelingTool::getNGhostParticles ( const xAOD::Jet & jet,
std::string collection ) const
protected

Get number of ghost associated particles.

Definition at line 869 of file JetTruthLabelingTool.cxx.

869 {
870
871 int nMatchPart = 0;
872
873 if( !jet.getAttribute<int>( collection+"Count", nMatchPart ) ){
874
875 std::vector<const xAOD::TruthParticle*> ghostParts;
876 if( !jet.getAssociatedObjects<xAOD::TruthParticle>( collection, ghostParts ) ){
877 ATH_MSG_ERROR( collection + " cannot be retrieved! Truth label definition might be wrong" );
878 }
879 nMatchPart = ghostParts.size();
880 }
881
882 return nMatchPart;
883}
std::vector< const T * > getAssociatedObjects(const std::string &name) const
get associated objects as a vector<object> this compact form throws an exception if the object is not...
TruthParticle_v1 TruthParticle
Typedef to implementation.

◆ getProperty()

template<class T>
const T * asg::AsgTool::getProperty ( const std::string & name) const
inherited

Get one of the tool's properties.

◆ getTLVs()

void JetTruthLabelingTool::getTLVs ( std::vector< std::pair< TLorentzVector, int > > & tlvs,
const xAOD::TruthParticleContainer * truthBosons,
const xAOD::TruthParticleContainer * truthTop,
bool isSherpa = false ) const
protected

Extract heavy particle 4-vectors from truth record.

Sherpa W/Z+jets samples need special treatment

Decay products

W candidate

Flag for W or Z candidates

Flag to check if qq' pair is in the mass window

Skip decayed/stable

Skip anything that isn't a light quark

We want to look at first 2 partons except beam particles. Sometimes beam particles are dropped from DxAODs...

Keep particles as first daughter

Find the next particle in the list with status == 3

Skip decayed/stable

Skip anything that isn't a light quark

Daughters of Z decay should be same-flavor but opposite charge

W+ daughters should have a positive u or c

W+ daughters should have a positive u or c

If p1 is a daughter of W/Z decay, the next one is the other daughter

~98% efficiency to W/Z signals. (95% if it is changed to [65, 105]GeV and 90% if [70,100]GeV)

Store W/Z/H bosons

Save 4-vector and pdgId

Store top quarks

Save 4-vector and pdgId

Definition at line 707 of file JetTruthLabelingTool.cxx.

707 {
708
709 tlvs.clear();
710
712 if(isSherpa) {
713 int countStatus3 = 0;
714
716 TLorentzVector p1(0,0,0,0);
717 TLorentzVector p2(0,0,0,0);
718
720 TLorentzVector WZCand(0,0,0,0);
721
723 bool isWPCand = false;
724 bool isWMCand = false;
725 bool isZCand = false;
726
728 bool inMassWindow = false;
729
730 for ( unsigned int ipart = 0; ipart < truthBosons->size(); ipart++ ){
731
732 const xAOD::TruthParticle* part1 = truthBosons->at(ipart);
733
735 if ( MC::isPhysical(part1) ) continue;
736
738 if ( std::abs(part1->pdgId()) > MC::BQUARK ) continue;
739
740 countStatus3++;
742 if ( countStatus3 > 3 ) continue;
744 p1 = part1->p4();
745
747 for ( unsigned int jpart = ipart+1; jpart < truthBosons->size(); jpart++ ) {
748
749 const xAOD::TruthParticle* part2 = truthBosons->at(jpart);
750
752 if ( MC::isPhysical(part2) ) continue;
753
755 if ( std::abs(part2->pdgId()) > MC::BQUARK ) continue;
756
757 p2 = part2->p4();
758
760 if ( part1->pdgId() + part2->pdgId() == 0 ) {
761 isZCand = true;
762 }
764 else if ( part1->pdgId() == MC::UQUARK || part1->pdgId() == MC::CQUARK || part2->pdgId() == MC::UQUARK || part2->pdgId() == MC::CQUARK ) {
765 isWPCand = true;
766 }
768 else {
769 isWMCand = true;
770 }
771
773 break;
774
775 }
776
777 WZCand = p1 + p2;
778
780 if ( 60000 < WZCand.M() && WZCand.M() < 140000. ) {
781 inMassWindow = true;
782 break;
783 }
784
785 }
786
787 if ( inMassWindow && (isWPCand || isWMCand || isZCand) ) {
788 std::pair<TLorentzVector,int> WZ;
789 if ( isZCand ) {
790 WZ = std::make_pair(WZCand,23);
791 }
792 if ( isWPCand ) {
793 WZ = std::make_pair(WZCand,24);
794 }
795 if ( isWMCand ) {
796 WZ = std::make_pair(WZCand,-24);
797 }
798 tlvs.push_back(WZ);
799 }
800
801 }
802
804 for ( const xAOD::TruthParticle* part : *truthBosons ) {
807 tlvs.push_back(std::make_pair(part->p4(),part->pdgId()));
808 }
809
811 for ( const xAOD::TruthParticle* part : *truthTop ) {
812 if ( !selectTruthParticle(part,MC::TQUARK) ) continue;
814 tlvs.push_back(std::make_pair(part->p4(),part->pdgId()));
815 }
816
817}
const T * at(size_type n) const
Access an element, as an rvalue.
size_type size() const noexcept
Returns the number of elements in the collection.
bool selectTruthParticle(const xAOD::TruthParticle *tp, int pdgId) const
Check if truth particle has correct DSID and isn't self decay.
int pdgId() const
PDG ID code.
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
static const int UQUARK
static const int Z0BOSON
static const int CQUARK
static const int TQUARK
static const int HIGGSBOSON
static const int BQUARK
static const int WPLUSBOSON
bool isPhysical(const T &p)
Identify if the particle is physical, i.e. is stable or decayed.

◆ getTopSplit23Cut()

float JetTruthLabelingTool::getTopSplit23Cut ( float pt) const
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 847 of file JetTruthLabelingTool.cxx.

847 {
848
851
852 float split23 = -999.0;
853
858
859 const float c0 = 3.3;
860 const float c1 = -6.98e-4;
861
862 split23 = std::exp( c0 + c1 * pt );
863
864 }
865
866 return split23;
867}

◆ getTruthJetLabelDR()

int JetTruthLabelingTool::getTruthJetLabelDR ( DecorHandles & dh,
const xAOD::Jet & jet,
const std::vector< std::pair< TLorentzVector, int > > & tlv_truthParts,
const EventContext & ctx ) const
protected

Get truth label using dR-matched particles.

Booleans to check associated heavy particles

Distances to truth particles

Add matching criteria decorations

Definition at line 288 of file JetTruthLabelingTool.cxx.

291 {
292
294 bool matchW = false;
295 bool matchZ = false;
296 bool matchH = false;
297 bool matchTop = false;
298
300 float dR_W = 9999;
301 float dR_Z = 9999;
302 float dR_H = 9999;
303 float dR_Top = 9999;
304
305 for (const auto& tlv_truth : tlv_truthParts) {
306 float dR = tlv_truth.first.DeltaR(jet.p4());
307 if( dR < m_dRTruthPart ) {
308
309 if ( MC::isZ(tlv_truth.second) && !matchZ ) {
310 dR_Z = dR;
311 matchZ = true;
312 }
313
314 if ( MC::isW(tlv_truth.second) && !matchW ) {
315 dR_W = dR;
316 matchW = true;
317 }
318
319 if ( MC::isHiggs(tlv_truth.second) && !matchH ) {
320 dR_H = dR;
321 matchH = true;
322 }
323
324 if ( MC::isTop(tlv_truth.second) && !matchTop ) {
325 dR_Top = dR;
326 matchTop = true;
327 }
328
329 }
330 }
331
333 (*dh.dRWHandle)(jet) = dR_W;
334 (*dh.dRZHandle)(jet) = dR_Z;
335 (*dh.dRHHandle)(jet) = dR_H;
336 (*dh.dRTopHandle)(jet) = dR_Top;
337
338 return getLabel( dh, jet, matchH, matchW, matchZ, matchTop, ctx );
339
340}
double m_dRTruthPart
Ghost pT fraction to match truth jet to reco jet.
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.
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition Jet_v1.cxx:71
bool isZ(const T &p)
bool isW(const T &p)
bool isTop(const T &p)
bool isHiggs(const T &p)
APID: HIGGS boson is only one particle.

◆ getTruthJetLabelGA()

int JetTruthLabelingTool::getTruthJetLabelGA ( DecorHandles & dh,
const xAOD::Jet & jet,
const EventContext & ctx ) const
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 342 of file JetTruthLabelingTool.cxx.

345{
347 bool matchW = false;
348 bool matchZ = false;
349 bool matchH = false;
350 bool matchTop = false;
351
353 int nMatchW = getNGhostParticles( jet, "GhostWBosons" );
354
355 if ( nMatchW ) {
356 matchW = true;
357 }
358
360 int nMatchZ = getNGhostParticles( jet, "GhostZBosons" );
361
362 if ( nMatchZ ) {
363 matchZ = true;
364 }
365
367 int nMatchH = getNGhostParticles( jet, "GhostHBosons" );
368
369 if ( nMatchH ) {
370 matchH = true;
371 }
372
374 int nMatchTop = getNGhostParticles( jet, "GhostTQuarksFinal" );
375
376 if ( nMatchTop ) {
377 matchTop = true;
378 }
379
380 return getLabel( dh, jet, matchH, matchW, matchZ, matchTop, ctx );
381
382}

◆ getWZSplit12Cut()

float JetTruthLabelingTool::getWZSplit12Cut ( float pt) const
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 829 of file JetTruthLabelingTool.cxx.

829 {
830
833
834 float split12 = -999.0;
835
837 const float c0 = 55.25;
838 const float c1 = -2.34e-3;
839
840 split12 = c0 * std::exp( c1 * pt );
841 }
842
843 return split12;
844
845}

◆ initialize()

StatusCode JetTruthLabelingTool::initialize ( void )
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...

Ghost Association values

Hard-code some values for R10TruthLabel_R21Consolidated
Functionality to customize labeling will be added later

Hard-code some values for R10TruthLabel_R21Precision

Hard-code some values for R10TruthLabel_R21Precision_2022v1 and R10TruthLabel_R22v1

Hard-code some values for R10WZTruthLabel_R22v1

Hard code for small-R jets

Check if TruthLabelName is supported. If not, give an error and return FAILURE

Reimplemented from asg::AsgTool.

Definition at line 43 of file JetTruthLabelingTool.cxx.

43 {
44
45 ATH_MSG_INFO("Initializing " << name());
46
48
50 m_useGhostJetMatch = false;
51 m_recoGhostFrac = 0.75;
55 m_truthJetCollectionName="AntiKt10TruthTrimmedPtFrac5SmallR20Jets";
57 m_dRTruthJet = 0.75;
58 m_useDRMatch = true;
59 m_dRTruthPart = 0.75;
60 m_useWZMassHigh = true;
61 m_mLowTop = 140.0;
62 m_mLowW = 50.0;
63 m_mHighW = 100.0;
64 m_mLowZ = 60.0;
65 m_mHighZ = 110.0;
67
68 }
71 m_truthJetCollectionName="AntiKt10TruthJets";
73 m_dRTruthJet = 0.75;
74 m_useDRMatch = false;
75 m_useWZMassHigh = true;
76 m_mLowTop = 140.0;
77 m_mLowW = 50.0;
78 m_mHighW = 100.0;
79 m_mLowZ = 60.0;
80 m_mHighZ = 110.0;
82 }
85 m_truthJetCollectionName="AntiKt10TruthJets";
87 m_dRTruthJet = 0.75;
88 m_useDRMatch = false;
89 m_useWZMassHigh = false;
90 m_mLowTop = 140.0;
91 m_mLowW = 50.0;
92 m_mLowZ = 50.0;
95 m_truthGroomedJetCollectionName = "AntiKt10TruthSoftDropBeta100Zcut10Jets";
96 } else {
98 }
99 }
102 m_truthJetCollectionName="AntiKt10TruthDressedWZJets";
104 m_dRTruthJet = 0.75;
105 m_useDRMatch = false;
106 m_useWZMassHigh = false;
107 m_mLowTop = 140.0;
108 m_mLowW = 50.0;
109 m_mLowZ = 50.0;
111 m_truthGroomedJetCollectionName = "AntiKt10TruthDressedWZSoftDropBeta100Zcut10Jets";
112 }
113
116 m_truthJetCollectionName = "AntiKt4TruthJets";
117 // m_truthJetCollectionName = "AntiKt4TruthDressedWZJets";
118 // Dressed option not working as of 2026-04-17, using regular.
120 m_dRTruthJet = 0.3;
121 m_useDRMatch = false;
122 m_useWZMassHigh = true;
123 m_mLowTop = 140.0;
124 m_mLowW = 50.0;
125 m_mHighW = 100.0;
126 m_mLowZ = 60.0;
127 m_mHighZ = 110.0;
129 m_useGhostJetMatch = true;
130 }
131
132 print();
133
135
136 bool isSupportedLabel = false;
137 isSupportedLabel = isSupportedLabel || (m_truthLabelConfig == TruthLabelConfiguration::R21Consolidated);
138 isSupportedLabel = isSupportedLabel || (m_truthLabelConfig == TruthLabelConfiguration::R21Precision);
139 isSupportedLabel = isSupportedLabel || (m_truthLabelConfig == TruthLabelConfiguration::R21Precision_2022v1);
140 isSupportedLabel = isSupportedLabel || (m_truthLabelConfig == TruthLabelConfiguration::R10TruthLabel_R22v1);
141 isSupportedLabel = isSupportedLabel || (m_truthLabelConfig == TruthLabelConfiguration::R10WZTruthLabel_R22v1);
142 isSupportedLabel = isSupportedLabel || (m_truthLabelConfig == TruthLabelConfiguration::R4TruthLabel);
143
144 if(!isSupportedLabel) {
145 ATH_MSG_ERROR("TruthLabelName " << m_truthLabelName << " is not supported. Exiting...");
146 return StatusCode::FAILURE;
147 }
148
155 m_split12_truthKey = m_truthJetCollectionName.key() + ".Split12";
156 m_split23_truthKey = m_truthJetCollectionName.key() + ".Split23";
157
158 if(!m_isTruthJetCol){
165 m_truthSplit12_recoKey = m_jetContainerName + "." + m_truthLabelName + "_TruthJetSplit12";
166 m_truthSplit23_recoKey = m_jetContainerName + "." + m_truthLabelName + "_TruthJetSplit23";
167
168 m_matchedTruthJetMass_recoKey = m_jetContainerName + "." + m_truthLabelName + "_MatchedTruthJetMass";
169 m_matchedTruthJetPt_recoKey = m_jetContainerName + "." + m_truthLabelName + "_MatchedTruthJetPt";
170 m_matchedTruthJetEta_recoKey = m_jetContainerName + "." + m_truthLabelName + "_MatchedTruthJetEta";
171 m_matchedTruthJetPhi_recoKey = m_jetContainerName + "." + m_truthLabelName + "_MatchedTruthJetPhi";
172 m_matchedTruthJetDR_recoKey = m_jetContainerName + "." + m_truthLabelName + "_MatchedTruthJetDR";
173 m_matchedTruthJetGF_recoKey = m_jetContainerName + "." + m_truthLabelName + "_MatchedTruthJetGF";
174
175 m_matchedTruthGroomedJetMass_recoKey = m_jetContainerName + "." + m_truthLabelName + "_MatchedTruthGroomedJetMass";
176 m_matchedTruthGroomedJetPt_recoKey = m_jetContainerName + "." + m_truthLabelName + "_MatchedTruthGroomedJetPt";
177 }
178
179 ATH_CHECK(m_evtInfoKey.initialize());
185
186 ATH_CHECK(m_label_truthKey.initialize());
191 ATH_CHECK(m_NB_truthKey.initialize());
192
195
204
211
214
215 return StatusCode::SUCCESS;
216}
#define ATH_MSG_INFO(x)
Gaudi::Property< std::string > m_jetContainerName
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthTopQuarkContainerName
bool m_getTruthGroomedJetValues
Use the ungroomed reco jet parent to match to truth jet.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_matchedTruthJetDR_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_NB_truthKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_matchedTruthJetPt_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_label_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_matchedTruthJetEta_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_matchedTruthJetPhi_recoKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthBosonContainerName
Gaudi::Property< bool > m_useTRUTH3
TRUTH1 or TRUTH3.
void print() const override
Print configured parameters.
bool m_useGhostJetMatch
Use upper mass cut for W/Z labels.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_matchedTruthJetMass_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dR_H_recoKey
double m_recoGhostFrac
dR to match truth jet to reco jet
SG::ReadHandleKey< xAOD::JetContainer > m_truthGroomedJetCollectionName
SG::WriteDecorHandleKey< xAOD::JetContainer > m_truthSplit23_recoKey
bool m_useWZMassHigh
Use dR to match partons to truth jet.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dR_H_truthKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dR_Top_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_matchedTruthJetGF_recoKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleContainerName
SG::WriteDecorHandleKey< xAOD::JetContainer > m_truthSplit12_recoKey
SG::ReadHandleKey< xAOD::EventInfo > m_evtInfoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_matchedTruthGroomedJetMass_recoKey
bool m_matchUngroomedParent
Use ghost association to match reco to truth jets, dR otherwise.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dR_Z_recoKey
TruthLabelConfiguration parseLabel(const std::string &label)
SG::WriteDecorHandleKey< xAOD::JetContainer > m_label_truthKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dR_Z_truthKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_NB_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dR_W_truthKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dR_W_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dR_Top_truthKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_matchedTruthGroomedJetPt_recoKey
double m_dRTruthJet
When truth jet matching to ungroomed truth, allow saving properties of groomed truth jets.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ labelRecoJets()

StatusCode JetTruthLabelingTool::labelRecoJets ( DecorHandles & dh,
const xAOD::JetContainer & jets,
const EventContext & ctx ) const
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 406 of file JetTruthLabelingTool.cxx.

408 {
409
410 SG::ReadHandle<xAOD::JetContainer> truthJets(m_truthJetCollectionName, ctx);
411 SG::ReadHandle<xAOD::JetContainer> truthGroomedJets;
413 truthGroomedJets = SG::makeHandle(m_truthGroomedJetCollectionName, ctx);
414 }
415 const SG::AuxElement::Accessor<int> nbAcc (m_truthLabelName + "_NB");
416 static const SG::ConstAccessor< ElementLink< xAOD::JetContainer > > ParentAcc ("Parent");
417 for(const xAOD::Jet *jet : jets) {
418
420 const xAOD::Jet* parent = nullptr;
422 ElementLink<xAOD::JetContainer> element_link = ParentAcc (*jet);
423 if ( element_link.isValid() ) {
424 parent = *element_link;
425 }
426 else {
427 ATH_MSG_ERROR("Unable to get a link to the parent jet! Returning a NULL pointer.");
428 return StatusCode::FAILURE;
429 }
430 }
431
433 float dRmin = 9999;
434 float ghostFracNominal = 9999;
435 const xAOD::Jet* matchTruthJet = nullptr;
436 float dRminGroomed = 9999;
437 const xAOD::Jet* matchTruthGroomedJet = nullptr;
438
439 // Ensure that the reco jet has at least one constituent
440 // (and thus a well-defined four-vector)
441 if(jet->numConstituents() > 0){
442 for ( const xAOD::Jet* truthJet : *truthJets ) {
443 // Calculate DR and GF values. Both are used regardless of the matching option.
444 // DR
445 float dR = jet->p4().DeltaR(truthJet->p4());
447 if (parent) dR = parent->p4().DeltaR(truthJet->p4());
448 // GF
449 static const SG::ConstAccessor<float> accGhostTruthPt("GhostTruthPt");
450 float ghostTruthPt = accGhostTruthPt(*jet);
451 float ghostPtFraction = (ghostTruthPt / (truthJet->pt()));
452 if (m_useGhostJetMatch) {
453 // GA matching. Upper bound applied for completeness, but realistically not needed.
454 if ((ghostPtFraction >= m_recoGhostFrac) && (ghostPtFraction <= (2 - m_recoGhostFrac))) {
455 if (std::abs(1 - ghostPtFraction) < std::abs(1 - ghostFracNominal)) {
456 matchTruthJet = truthJet;
457 ghostFracNominal = ghostPtFraction;
458 }
459 }
460 }
461 else {
462 // If m_dRTruthJet < 0, the closest truth jet is used as matched jet. Otherwise, only match if dR < m_dRTruthJet
463 if (m_dRTruthJet < 0 || dR < m_dRTruthJet ) {
464 if (dR < dRmin) {
465 dRmin = dR;
466 matchTruthJet = truthJet;
467 }
468 }
469 }
470
471 }
472 }
473
474
476 float dR_truthJet_W = 9999;
477 float dR_truthJet_Z = 9999;
478 float dR_truthJet_Top = 9999;
479 float dR_truthJet_H = 9999;
480 int truthJetNB = -1;
481 float truthJetSplit12 = -9999;
482 float truthJetSplit23 = -9999;
483
484 float truthJetMass = -9999;
485 float truthJetPt = -9999;
486 float truthJetEta = -9999;
487 float truthJetPhi = -9999;
488 float deltaR = -2;
489 float ghostFrac = -2;
490
491 if ( matchTruthJet ) {
492 // Can't use the WriteDecorHandle to read --- the decoration may have
493 // been added and locked by a previous algorithm.
494 // Not saving Truth jet decorations for small R
496 SG::ConstAccessor<int> labelAcc(dh.labelHandle->auxid());
497 label = labelAcc(*matchTruthJet);
498 if (m_useDRMatch) {
499 if (dh.dRWHandle->isAvailable()) dR_truthJet_W = (*dh.dRWHandle)(*matchTruthJet);
500 if (dh.dRZHandle->isAvailable()) dR_truthJet_Z = (*dh.dRZHandle)(*matchTruthJet);
501 if (dh.dRHHandle->isAvailable()) dR_truthJet_H = (*dh.dRHHandle)(*matchTruthJet);
502 if (dh.dRTopHandle->isAvailable()) dR_truthJet_Top = (*dh.dRTopHandle)(*matchTruthJet);
503 }
505 SG::ReadDecorHandle<xAOD::JetContainer, float> split23Handle(m_split23_truthKey, ctx);
506 if (split23Handle.isAvailable()) truthJetSplit23 = split23Handle(*matchTruthJet);
507 }
509 SG::ReadDecorHandle<xAOD::JetContainer, float> split23Handle(m_split23_truthKey, ctx);
510 if (split23Handle.isAvailable()) truthJetSplit23 = split23Handle(*matchTruthJet);
511 SG::ReadDecorHandle<xAOD::JetContainer, float> split12Handle(m_split12_truthKey, ctx);
512 if (split12Handle.isAvailable()) truthJetSplit12 = split12Handle(*matchTruthJet);
513 }
514 if (nbAcc.isAvailable(*matchTruthJet)) truthJetNB = nbAcc(*matchTruthJet);
515 }
516 // Reco jet decorations, saved for small and large R
517 truthJetMass = matchTruthJet->m();
518 truthJetPt = matchTruthJet->pt();
519 truthJetEta = matchTruthJet->eta();
520 truthJetPhi = matchTruthJet->phi();
521 ghostFrac = ghostFracNominal;
522 deltaR = dRmin;
523 }
524
525 // Save Groomed Truth Jet variables
526 float truthGroomedJetMass = -9999;
527 float truthGroomedJetPt = -9999;
529 if ( matchTruthJet ) {
530 for ( const xAOD::Jet* truthGroomedJet : *truthGroomedJets ) {
531 ElementLink<xAOD::JetContainer> element_link = ParentAcc (*truthGroomedJet);
532 if ( !element_link.isValid() ) { continue; }
533 if ( matchTruthJet == *element_link ) {
534 matchTruthGroomedJet = truthGroomedJet;
535 break;
536 }
537 }
538 }
539 // If no matched jet found or matched jet has no corresponding groomed jet, use dR matching
540 if ( !matchTruthGroomedJet ) {
541 for ( const xAOD::Jet* truthGroomedJet : *truthGroomedJets ) {
542 float dR = parent->p4().DeltaR(truthGroomedJet->p4());
544 if ( m_dRTruthJet < 0 || dR < m_dRTruthJet ) {
545 if ( dR < dRminGroomed ) {
546 dRminGroomed = dR;
547 matchTruthGroomedJet = truthGroomedJet;
548 }
549 }
550 }
551 }
552 if ( matchTruthGroomedJet ) {
553 truthGroomedJetMass = matchTruthGroomedJet->m();
554 truthGroomedJetPt = matchTruthGroomedJet->pt();
555 }
556 }
557
560 (*dh.labelRecoHandle)(*jet) = label;
562 if (m_useDRMatch) {
563 (*dh.dRWRecoHandle)(*jet) = dR_truthJet_W;
564 (*dh.dRZRecoHandle)(*jet) = dR_truthJet_Z;
565 (*dh.dRHRecoHandle)(*jet) = dR_truthJet_H;
566 (*dh.dRTopRecoHandle)(*jet) = dR_truthJet_Top;
567 }
569 (*dh.split23Handle)(*jet) = truthJetSplit23;
570 }
571
573 (*dh.split23Handle)(*jet) = truthJetSplit23;
574 (*dh.split12Handle)(*jet) = truthJetSplit12;
575 }
576
577 (*dh.nbRecoHandle)(*jet) = truthJetNB;
578 }
579
580 (*dh.matchedTruthJetMassHandle)(*jet) = truthJetMass;
581 (*dh.matchedTruthJetPtHandle)(*jet) = truthJetPt;
582 (*dh.matchedTruthJetEtaHandle)(*jet) = truthJetEta;
583 (*dh.matchedTruthJetPhiHandle)(*jet) = truthJetPhi;
584 (*dh.matchedTruthJetDRHandle)(*jet) = deltaR;
585 (*dh.matchedTruthJetGFHandle)(*jet) = ghostFrac;
586
588 (*dh.matchedTruthGroomedMassHandle)(*jet) = truthGroomedJetMass;
589 (*dh.matchedTruthGroomedPtHandle)(*jet) = truthGroomedJetPt;
590 }
591 }
592
593 return StatusCode::SUCCESS;
594}
Scalar deltaR(const MatrixBase< Derived > &vec) const
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition Jet_v1.cxx:54
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition Jet_v1.cxx:49
std::string label(const std::string &format, int i)
Definition label.h:19
int enumToInt(const TypeEnum type)
SG::ConstAccessor< T, ALLOC > ConstAccessor
Definition AuxElement.h:570
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Jet_v1 Jet
Definition of the current "jet version".

◆ labelTruthJets() [1/2]

StatusCode JetTruthLabelingTool::labelTruthJets ( DecorHandles & dh,
const EventContext & ctx ) const
protected

Label truth jet collection.

Retrieve appropriate truth jet container

Make sure the truth jet collection has been retrieved

Definition at line 596 of file JetTruthLabelingTool.cxx.

597 {
598
600 SG::ReadHandle<xAOD::JetContainer> truthJets(m_truthJetCollectionName, ctx);
601
603 if ( !truthJets.isValid() ) {
604 ATH_MSG_ERROR("No truth jet container retrieved. Please make sure you are using a supported TruthLabelName.");
605 return StatusCode::FAILURE;
606 }
607
608 return labelTruthJets(dh, *truthJets, ctx);
609
610}

◆ labelTruthJets() [2/2]

StatusCode JetTruthLabelingTool::labelTruthJets ( DecorHandles & dh,
const xAOD::JetContainer & jets,
const EventContext & ctx ) const
protected

Make sure there is at least 1 jet in truth collection

Check if the truth jet collection already has labels applied

Get MC channel number

Get the EventInfo to identify Sherpa samples

Vectors of W/Z/H/Top TLorentzVectors

Get truth particles directly if using dR matching

Check if it is a Sherpa sample

TRUTH3

Check for boson container

Check for top quark container

Get truth particle TLVs

TRUTH1

Get truth particle TLVs

Apply label to truth jet

Definition at line 612 of file JetTruthLabelingTool.cxx.

615{
617 if ( !(truthJets.size()) ) return StatusCode::SUCCESS;
618
620 if(dh.labelHandle->isAvailable()){
621 // Beware: if we get here, the configuration is probably not MT-compatible.
622 ATH_MSG_DEBUG("labelTruthJets: Truth jet collection already labelled with " << m_truthLabelName);
623 return StatusCode::SUCCESS;
624 }
625
627 int channelNumber = -999;
628
630 SG::ReadHandle<xAOD::EventInfo> eventInfo(m_evtInfoKey, ctx);
631 if(!eventInfo.isValid()){
632 ATH_MSG_ERROR("Failed to retrieve event information.");
633 return StatusCode::FAILURE;
634 }
635
637 std::vector<std::pair<TLorentzVector,int> > tlv_truthParts;
638
640 if ( m_useDRMatch ) {
641
642 channelNumber = eventInfo->mcChannelNumber();
643
644 if ( channelNumber < 0 ) {
645 ATH_MSG_ERROR("Channel number was not set correctly");
646 return StatusCode::FAILURE;
647 }
648
650 bool isSherpa = getIsSherpa(channelNumber);
651
652 if ( m_useTRUTH3 && isSherpa ) {
653 ATH_MSG_ERROR("Cannot apply truth labels to Sherpa 2.2.1 samples using TRUTH3 containers");
654 return StatusCode::FAILURE;
655 }
656
658 if( m_useTRUTH3 ) {
660 SG::ReadHandle<xAOD::TruthParticleContainer> truthPartsBoson(m_truthBosonContainerName, ctx);
661 if(!truthPartsBoson.isValid()){
662 ATH_MSG_ERROR("Unable to find " << m_truthBosonContainerName.key() << ". Please check the content of your input file.");
663 return StatusCode::FAILURE;
664 }
666 SG::ReadHandle<xAOD::TruthParticleContainer> truthPartsTop(m_truthTopQuarkContainerName, ctx);
667 if(!truthPartsTop.isValid()){
668 ATH_MSG_ERROR("Unable to find " << m_truthTopQuarkContainerName.key() << ". Please check the content of your input file.");
669 return StatusCode::FAILURE;
670 }
672 getTLVs(tlv_truthParts, truthPartsBoson.cptr(), truthPartsTop.cptr(), isSherpa);
673 }
674
676 else {
677 SG::ReadHandle<xAOD::TruthParticleContainer> truthParts(m_truthParticleContainerName, ctx);
678 if(!truthParts.isValid()){
679 ATH_MSG_ERROR("Unable to find " << m_truthParticleContainerName << ". Please check the content of your input file.");
680 return StatusCode::FAILURE;
681 }
683 getTLVs(tlv_truthParts, truthParts.cptr(), truthParts.cptr(), isSherpa);
684 }
685 }
686
689 for ( const xAOD::Jet *jet : truthJets ) {
690
691 if ( m_useDRMatch ) {
692 ATH_MSG_DEBUG("Getting truth label using dR matching");
693 label = getTruthJetLabelDR(dh, *jet, tlv_truthParts, ctx);
694 }
695
696 else {
697 ATH_MSG_DEBUG("Getting truth label using ghost-association");
698 label = getTruthJetLabelGA(dh, *jet, ctx);
699 }
700
701 (*dh.labelHandle)(*jet) = label;
702 }
703
704 return StatusCode::SUCCESS;
705}
#define ATH_MSG_DEBUG(x)
int getTruthJetLabelGA(DecorHandles &dh, const xAOD::Jet &jet, const EventContext &ctx) const
Get truth label using ghost-associated particles.
void getTLVs(std::vector< std::pair< TLorentzVector, int > > &tlvs, const xAOD::TruthParticleContainer *truthBosons, const xAOD::TruthParticleContainer *truthTop, bool isSherpa=false) const
Extract heavy particle 4-vectors from truth record.
int getTruthJetLabelDR(DecorHandles &dh, const xAOD::Jet &jet, const std::vector< std::pair< TLorentzVector, int > > &tlv_truthParts, const EventContext &ctx) const
Get truth label using dR-matched particles.
bool getIsSherpa(const int DSID) const
Check for Sherpa DSIDs.

◆ modify()

virtual StatusCode IJetDecorator::modify ( xAOD::JetContainer & jets) const
inlinefinaloverridevirtualinherited

Concrete implementation of the function inherited from IJetModifier.

Implements IJetModifier.

Definition at line 32 of file IJetDecorator.h.

32{return decorate(jets);};
virtual StatusCode decorate(const xAOD::JetContainer &jets) const =0
Decorate a jet collection without otherwise modifying it.

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg_level_name()

const std::string & asg::AsgTool::msg_level_name ( ) const
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:

MSG::name( msg().level() )

This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.

Returns
The string name of the current minimum message level that's printed

Definition at line 101 of file AsgTool.cxx.

101 {
102
103 return MSG::name( msg().level() );
104 }
MsgStream & msg() const
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition MsgLevel.cxx:19

◆ msgLvl()

bool AthCommonMsg< AlgTool >::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< AlgTool > >::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.

◆ parseLabel()

JetTruthLabelingTool::TruthLabelConfiguration JetTruthLabelingTool::parseLabel ( const std::string & label)
protected

Definition at line 19 of file JetTruthLabelingTool.cxx.

19 {
20
21 if (name == "R10TruthLabel_R21Consolidated")
23
24 if (name == "R10TruthLabel_R21Precision")
26
27 if (name == "R10TruthLabel_R21Precision_2022v1")
29
30 if (name == "R10TruthLabel_R22v1")
32
33 if (name == "R10WZTruthLabel_R22v1")
35
36 if (name == "R4TruthLabel")
38
40}

◆ print()

void JetTruthLabelingTool::print ( ) const
overridevirtual

Print configured parameters.

Reimplemented from asg::AsgTool.

Definition at line 218 of file JetTruthLabelingTool.cxx.

218 {
219 ATH_MSG_INFO("Parameters for " << name());
220
221 ATH_MSG_INFO("xAOD information:");
222 ATH_MSG_INFO("TruthLabelName: " << m_truthLabelName);
223 ATH_MSG_INFO("UseTRUTH3: " << ( m_useTRUTH3 ? "True" : "False"));
224
225 if(m_useTRUTH3) {
226 ATH_MSG_INFO("TruthBosonContainerName: " << m_truthBosonContainerName);
227 ATH_MSG_INFO("TruthTopQuarkContainerName: " << m_truthTopQuarkContainerName);
228 }
229 else {
230 ATH_MSG_INFO("TruthParticleContainerName: " << m_truthParticleContainerName);
231 }
232
233 ATH_MSG_INFO("TruthJetCollectionName: " << m_truthJetCollectionName.key());
234 ATH_MSG_INFO("dRTruthJet: " << std::to_string(m_dRTruthJet));
235
236 if ( m_useDRMatch ) {
237 ATH_MSG_INFO("dRTruthPart: " << std::to_string(m_dRTruthPart));
238 }
239
240 ATH_MSG_INFO("mLowTop: " << std::to_string(m_mLowTop));
241 ATH_MSG_INFO("mLowW: " << std::to_string(m_mLowW));
243 ATH_MSG_INFO("mHighW: " << std::to_string(m_mHighW));
244 ATH_MSG_INFO("mLowZ: " << std::to_string(m_mLowZ));
246 ATH_MSG_INFO("mHighZ: " << std::to_string(m_mHighZ));
247
249 ATH_MSG_INFO("truthGroomedJetCollectionName: " << m_truthGroomedJetCollectionName.key());
250 }
251}

◆ 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< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
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)

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ selectTruthParticle()

bool JetTruthLabelingTool::selectTruthParticle ( const xAOD::TruthParticle * tp,
int pdgId ) const
protected

Check if truth particle has correct DSID and isn't self decay.

Definition at line 819 of file JetTruthLabelingTool.cxx.

819 {
820 if ( std::abs(tp->pdgId()) != pdgId ) return false;
821 for ( unsigned int iChild = 0; iChild < tp->nChildren(); iChild++ ) {
822 const xAOD::TruthParticle *child = tp->child(iChild);
823 if ( !child ) continue;
824 if ( child->pdgId() == tp->pdgId() ) return false;
825 }
826 return true;
827}
const TruthParticle_v1 * child(size_t i) const
Retrieve the i-th mother (TruthParticle) of this TruthParticle.
size_t nChildren() const
Number of children of this particle.

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
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.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

◆ DecorHandles

friend struct DecorHandles
friend

Definition at line 108 of file JetTruthLabelingTool.h.

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_dR_H_recoKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetTruthLabelingTool::m_dR_H_recoKey {this, "dR_H_RecoKey", "", "Do not configure manually!"}
protected

Definition at line 189 of file JetTruthLabelingTool.h.

189{this, "dR_H_RecoKey", "", "Do not configure manually!"};

◆ m_dR_H_truthKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetTruthLabelingTool::m_dR_H_truthKey {this, "dR_H_TruthKey", "", "Do not configure manually!"}
protected

Definition at line 180 of file JetTruthLabelingTool.h.

180{this, "dR_H_TruthKey", "", "Do not configure manually!"};

◆ m_dR_Top_recoKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetTruthLabelingTool::m_dR_Top_recoKey {this, "dR_Top_RecoKey", "", "Do not configure manually!"}
protected

Definition at line 190 of file JetTruthLabelingTool.h.

190{this, "dR_Top_RecoKey", "", "Do not configure manually!"};

◆ m_dR_Top_truthKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetTruthLabelingTool::m_dR_Top_truthKey {this, "dR_Top_TruthKey", "", "Do not configure manually!"}
protected

Definition at line 181 of file JetTruthLabelingTool.h.

181{this, "dR_Top_TruthKey", "", "Do not configure manually!"};

◆ m_dR_W_recoKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetTruthLabelingTool::m_dR_W_recoKey {this, "dR_W_RecoKey", "", "Do not configure manually!"}
protected

Definition at line 187 of file JetTruthLabelingTool.h.

187{this, "dR_W_RecoKey", "", "Do not configure manually!"};

◆ m_dR_W_truthKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetTruthLabelingTool::m_dR_W_truthKey {this, "dR_W_TruthKey", "", "Do not configure manually!"}
protected

Definition at line 178 of file JetTruthLabelingTool.h.

178{this, "dR_W_TruthKey", "", "Do not configure manually!"};

◆ m_dR_Z_recoKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetTruthLabelingTool::m_dR_Z_recoKey {this, "dR_Z_RecoKey", "", "Do not configure manually!"}
protected

Definition at line 188 of file JetTruthLabelingTool.h.

188{this, "dR_Z_RecoKey", "", "Do not configure manually!"};

◆ m_dR_Z_truthKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetTruthLabelingTool::m_dR_Z_truthKey {this, "dR_Z_TruthKey", "", "Do not configure manually!"}
protected

Definition at line 179 of file JetTruthLabelingTool.h.

179{this, "dR_Z_TruthKey", "", "Do not configure manually!"};

◆ m_dRTruthJet

double JetTruthLabelingTool::m_dRTruthJet {}
protected

When truth jet matching to ungroomed truth, allow saving properties of groomed truth jets.

Definition at line 69 of file JetTruthLabelingTool.h.

69{};

◆ m_dRTruthPart

double JetTruthLabelingTool::m_dRTruthPart {}
protected

Ghost pT fraction to match truth jet to reco jet.

Definition at line 71 of file JetTruthLabelingTool.h.

71{};

◆ m_evtInfoKey

SG::ReadHandleKey<xAOD::EventInfo> JetTruthLabelingTool::m_evtInfoKey {this, "EventInfoKey", "EventInfo", "Name of EventInfo object"}
protected

Definition at line 53 of file JetTruthLabelingTool.h.

53{this, "EventInfoKey", "EventInfo", "Name of EventInfo object"};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_getTruthGroomedJetValues

bool JetTruthLabelingTool::m_getTruthGroomedJetValues {}
protected

Use the ungroomed reco jet parent to match to truth jet.

Definition at line 68 of file JetTruthLabelingTool.h.

68{};

◆ m_isTruthJetCol

Gaudi::Property<bool> JetTruthLabelingTool::m_isTruthJetCol {this, "IsTruthJetCollection", false, "Flag indicating whether input collection is a truth jet container"}
protected

Definition at line 51 of file JetTruthLabelingTool.h.

51{this, "IsTruthJetCollection", false, "Flag indicating whether input collection is a truth jet container"};

◆ m_jetContainerName

Gaudi::Property<std::string> JetTruthLabelingTool::m_jetContainerName {this, "RecoJetContainer", "", "Input reco jet container name"}
protected

Definition at line 48 of file JetTruthLabelingTool.h.

48{this, "RecoJetContainer", "", "Input reco jet container name"};

◆ m_label_recoKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetTruthLabelingTool::m_label_recoKey {this, "label_RecoKey", "", "Do not configure manually!"}
protected

Definition at line 186 of file JetTruthLabelingTool.h.

186{this, "label_RecoKey", "", "Do not configure manually!"};

◆ m_label_truthKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetTruthLabelingTool::m_label_truthKey {this, "label_TruthKey", "", "Do not configure manually!"}
protected

Definition at line 177 of file JetTruthLabelingTool.h.

177{this, "label_TruthKey", "", "Do not configure manually!"};

◆ m_matchedTruthGroomedJetMass_recoKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetTruthLabelingTool::m_matchedTruthGroomedJetMass_recoKey {this, "MatchedTruthGroomedJetMass_RecoKey", "", "Do not configure manually!"}
protected

Definition at line 202 of file JetTruthLabelingTool.h.

202{this, "MatchedTruthGroomedJetMass_RecoKey", "", "Do not configure manually!"};

◆ m_matchedTruthGroomedJetPt_recoKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetTruthLabelingTool::m_matchedTruthGroomedJetPt_recoKey {this, "MatchedTruthGroomedJetPt_RecoKey", "", "Do not configure manually!"}
protected

Definition at line 203 of file JetTruthLabelingTool.h.

203{this, "MatchedTruthGroomedJetPt_RecoKey", "", "Do not configure manually!"};

◆ m_matchedTruthJetDR_recoKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetTruthLabelingTool::m_matchedTruthJetDR_recoKey { this, "MatchedTruthJetDR_RecoKey", "", "Do not configure manually!" }
protected

Definition at line 199 of file JetTruthLabelingTool.h.

199{ this, "MatchedTruthJetDR_RecoKey", "", "Do not configure manually!" };

◆ m_matchedTruthJetEta_recoKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetTruthLabelingTool::m_matchedTruthJetEta_recoKey { this, "MatchedTruthJetEta_RecoKey", "", "Do not configure manually!" }
protected

Definition at line 197 of file JetTruthLabelingTool.h.

197{ this, "MatchedTruthJetEta_RecoKey", "", "Do not configure manually!" };

◆ m_matchedTruthJetGF_recoKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetTruthLabelingTool::m_matchedTruthJetGF_recoKey { this, "MatchedTruthJetGF_RecoKey", "", "Do not configure manually!" }
protected

Definition at line 200 of file JetTruthLabelingTool.h.

200{ this, "MatchedTruthJetGF_RecoKey", "", "Do not configure manually!" };

◆ m_matchedTruthJetMass_recoKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetTruthLabelingTool::m_matchedTruthJetMass_recoKey {this, "MatchedTruthJetMass_RecoKey", "", "Do not configure manually!"}
protected

Definition at line 195 of file JetTruthLabelingTool.h.

195{this, "MatchedTruthJetMass_RecoKey", "", "Do not configure manually!"};

◆ m_matchedTruthJetPhi_recoKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetTruthLabelingTool::m_matchedTruthJetPhi_recoKey { this, "MatchedTruthJetPhi_RecoKey", "", "Do not configure manually!" }
protected

Definition at line 198 of file JetTruthLabelingTool.h.

198{ this, "MatchedTruthJetPhi_RecoKey", "", "Do not configure manually!" };

◆ m_matchedTruthJetPt_recoKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetTruthLabelingTool::m_matchedTruthJetPt_recoKey {this, "MatchedTruthJetPt_RecoKey", "", "Do not configure manually!"}
protected

Definition at line 196 of file JetTruthLabelingTool.h.

196{this, "MatchedTruthJetPt_RecoKey", "", "Do not configure manually!"};

◆ m_matchUngroomedParent

bool JetTruthLabelingTool::m_matchUngroomedParent {}
protected

Use ghost association to match reco to truth jets, dR otherwise.

Definition at line 67 of file JetTruthLabelingTool.h.

67{};

◆ m_mHighW

double JetTruthLabelingTool::m_mHighW {}
protected

Lower mass cut for W label.

Definition at line 74 of file JetTruthLabelingTool.h.

74{};

◆ m_mHighZ

double JetTruthLabelingTool::m_mHighZ {}
protected

Lower mass cut for Z label.

Definition at line 76 of file JetTruthLabelingTool.h.

76{};

◆ m_mLowTop

double JetTruthLabelingTool::m_mLowTop {}
protected

dR to match truth particles to truth jet

Definition at line 72 of file JetTruthLabelingTool.h.

72{};

◆ m_mLowW

double JetTruthLabelingTool::m_mLowW {}
protected

Lower mass cut for top label.

Definition at line 73 of file JetTruthLabelingTool.h.

73{};

◆ m_mLowZ

double JetTruthLabelingTool::m_mLowZ {}
protected

Upper mass cut for W label.

Definition at line 75 of file JetTruthLabelingTool.h.

75{};

◆ m_NB_recoKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetTruthLabelingTool::m_NB_recoKey {this, "NB_RecoKey", "", "Do not configure manually!"}
protected

Definition at line 191 of file JetTruthLabelingTool.h.

191{this, "NB_RecoKey", "", "Do not configure manually!"};

◆ m_NB_truthKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetTruthLabelingTool::m_NB_truthKey {this, "NB_TruthKey", "", "Do not configure manually!"}
protected

Definition at line 182 of file JetTruthLabelingTool.h.

182{this, "NB_TruthKey", "", "Do not configure manually!"};

◆ m_recoGhostFrac

double JetTruthLabelingTool::m_recoGhostFrac {}
protected

dR to match truth jet to reco jet

Definition at line 70 of file JetTruthLabelingTool.h.

70{};

◆ m_split12_truthKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JetTruthLabelingTool::m_split12_truthKey {this, "Split12_TruthKey", "", "Do not configure manually!"}
protected

Definition at line 183 of file JetTruthLabelingTool.h.

183{this, "Split12_TruthKey", "", "Do not configure manually!"};

◆ m_split23_truthKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JetTruthLabelingTool::m_split23_truthKey {this, "Split23_TruthKey", "", "Do not configure manually!"}
protected

Definition at line 184 of file JetTruthLabelingTool.h.

184{this, "Split23_TruthKey", "", "Do not configure manually!"};

◆ m_truthBosonContainerName

SG::ReadHandleKey<xAOD::TruthParticleContainer> JetTruthLabelingTool::m_truthBosonContainerName {this, "TruthBosonContainerName", "TruthBosonsWithDecayParticles", "Truth boson container name"}
protected

Definition at line 58 of file JetTruthLabelingTool.h.

58{this, "TruthBosonContainerName", "TruthBosonsWithDecayParticles", "Truth boson container name"};

◆ m_truthGroomedJetCollectionName

SG::ReadHandleKey<xAOD::JetContainer> JetTruthLabelingTool::m_truthGroomedJetCollectionName {this, "TruthGroomedJetContainer", "", "Do not configure manually!"}
protected

Definition at line 63 of file JetTruthLabelingTool.h.

63{this, "TruthGroomedJetContainer", "", "Do not configure manually!"};

◆ m_truthJetCollectionName

SG::ReadHandleKey<xAOD::JetContainer> JetTruthLabelingTool::m_truthJetCollectionName {this, "TruthJetContainer", "", "Do not configure manually!"}
protected

parameters for truth labeling

Definition at line 62 of file JetTruthLabelingTool.h.

62{this, "TruthJetContainer", "", "Do not configure manually!"};

◆ m_truthLabelConfig

TruthLabelConfiguration JetTruthLabelingTool::m_truthLabelConfig = TruthLabelConfiguration::Unknown
protected

Definition at line 175 of file JetTruthLabelingTool.h.

◆ m_truthLabelName

Gaudi::Property<std::string> JetTruthLabelingTool::m_truthLabelName {this, "TruthLabelName", "R10TruthLabel_R21Consolidated", "Truth label name"}
protected

Definition at line 49 of file JetTruthLabelingTool.h.

49{this, "TruthLabelName", "R10TruthLabel_R21Consolidated", "Truth label name"};

◆ m_truthParticleContainerName

SG::ReadHandleKey<xAOD::TruthParticleContainer> JetTruthLabelingTool::m_truthParticleContainerName {this, "TruthParticleContainerName", "TruthParticles", "Truth particle container name"}
protected

Definition at line 57 of file JetTruthLabelingTool.h.

57{this, "TruthParticleContainerName", "TruthParticles", "Truth particle container name"};

◆ m_truthSplit12_recoKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetTruthLabelingTool::m_truthSplit12_recoKey {this, "TruthSplit12_RecoKey", "", "Do not configure manually!"}
protected

Definition at line 192 of file JetTruthLabelingTool.h.

192{this, "TruthSplit12_RecoKey", "", "Do not configure manually!"};

◆ m_truthSplit23_recoKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetTruthLabelingTool::m_truthSplit23_recoKey {this, "TruthSplit23_RecoKey", "", "Do not configure manually!"}
protected

Definition at line 193 of file JetTruthLabelingTool.h.

193{this, "TruthSplit23_RecoKey", "", "Do not configure manually!"};

◆ m_truthTopQuarkContainerName

SG::ReadHandleKey<xAOD::TruthParticleContainer> JetTruthLabelingTool::m_truthTopQuarkContainerName {this, "TruthTopQuarkContainerName", "TruthTopQuarkWithDecayParticles", "Truth top container name"}
protected

Definition at line 59 of file JetTruthLabelingTool.h.

59{this, "TruthTopQuarkContainerName", "TruthTopQuarkWithDecayParticles", "Truth top container name"};

◆ m_useDRMatch

bool JetTruthLabelingTool::m_useDRMatch {}
protected

Definition at line 64 of file JetTruthLabelingTool.h.

64{};

◆ m_useGhostJetMatch

bool JetTruthLabelingTool::m_useGhostJetMatch {}
protected

Use upper mass cut for W/Z labels.

Definition at line 66 of file JetTruthLabelingTool.h.

66{};

◆ m_useTRUTH3

Gaudi::Property<bool> JetTruthLabelingTool::m_useTRUTH3 {this, "UseTRUTH3", false, "True for TRUTH3 format, false for TRUTH1"}
protected

TRUTH1 or TRUTH3.

Definition at line 56 of file JetTruthLabelingTool.h.

56{this, "UseTRUTH3", false, "True for TRUTH3 format, false for TRUTH1"};

◆ m_useWZMassHigh

bool JetTruthLabelingTool::m_useWZMassHigh {}
protected

Use dR to match partons to truth jet.

Definition at line 65 of file JetTruthLabelingTool.h.

65{};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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