ATLAS Offline Software
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
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 More...
 
virtual StatusCode initialize () override
 Dummy implementation of the initialisation function. More...
 
StatusCode decorate (const xAOD::JetContainer &jets) const override
 decorate truth label to a jet collection More...
 
void print () const override
 Print configured parameters. More...
 
const std::string & getLargeRJetTruthLabelName () const
 returns the name of large-R jet truth label More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 
virtual StatusCode modify (xAOD::JetContainer &jets) const override final
 Concrete implementation of the function inherited from IJetModifier. More...
 

Protected Member Functions

StatusCode labelTruthJets (DecorHandles &dh, const EventContext &ctx) const
 Label truth jet collection. More...
 
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. More...
 
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. More...
 
int getTruthJetLabelGA (DecorHandles &dh, const xAOD::Jet &jet, const EventContext &ctx) const
 Get truth label using ghost-associated particles. More...
 
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. More...
 
float getWZSplit12Cut (float pt) const
 Get W/Z label Split12 cut. More...
 
float getTopSplit23Cut (float pt) const
 Get top label Split23 cut. More...
 
int getNGhostParticles (const xAOD::Jet &jet, std::string collection) const
 Get number of ghost associated particles. More...
 
bool getIsSherpa (const int DSID) const
 Check for Sherpa DSIDs. More...
 
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. More...
 
bool selectTruthParticle (const xAOD::TruthParticle *tp, int pdgId) const
 Check if truth particle has correct DSID and isn't self decay. More...
 
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
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. More...
 

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. More...
 
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 More...
 
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. More...
 
bool m_matchUngroomedParent
 Use upper mass cut for W/Z labels. More...
 
bool m_getTruthGroomedJetValues
 Use the ungroomed reco jet parent to match to truth jet. More...
 
double m_dRTruthJet
 When truth jet matching to ungroomed truth, allow saving properties of groomed truth jets. More...
 
double m_dRTruthPart
 dR to match truth jet to reco jet More...
 
double m_mLowTop
 dR to match truth particles to truth jet More...
 
double m_mLowW
 Lower mass cut for top label. More...
 
double m_mHighW
 Lower mass cut for W label. More...
 
double m_mLowZ
 Upper mass cut for W label. More...
 
double m_mHighZ
 Lower mass cut for Z label. More...
 
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_truthJetMass_recoKey {this, "TruthJetMass_RecoKey", "", "Do not configure manually!"}
 
SG::WriteDecorHandleKey< xAOD::JetContainerm_truthJetPt_recoKey {this, "TruthJetPt_RecoKey", "", "Do not configure manually!"}
 
SG::WriteDecorHandleKey< xAOD::JetContainerm_truthGroomedJetMass_recoKey {this, "TruthGroomedJetMass_RecoKey", "", "Do not configure manually!"}
 
SG::WriteDecorHandleKey< xAOD::JetContainerm_truthGroomedJetPt_recoKey {this, "TruthGroomedJetPt_RecoKey", "", "Do not configure manually!"}
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

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.

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  :
16 {}

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

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

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

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

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

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

303  {
304  const EventContext& ctx = Gaudi::Hive::currentContext();
305  DecorHandles dh (*this, ctx);
306 
308  if(m_isTruthJetCol) {
309  return labelTruthJets(dh, jets, ctx);
310  }
311 
313  else {
314  ATH_CHECK( labelTruthJets(dh, ctx) );
315  return labelRecoJets(dh, jets, ctx);
316  }
317 
318  return StatusCode::SUCCESS;
319 }

◆ 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.

95 { return m_detStore; }

◆ evtStore() [1/2]

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.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ 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 142 of file JetTruthLabelingTool.h.

142  {
143  if(
144  (304307 <= DSID && DSID <= 304309) || // Sherpa 2.2.1 W+jets
145  (304707 <= DSID && DSID <= 304709) // Sherpa 2.2.1 Z+jets
146  ) {
147  return true;
148  }
149  return false;
150  };

◆ 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::TEvent 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::TEvent, 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  }

◆ 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->qq

Uncontained top

Uncontained V

Definition at line 757 of file JetTruthLabelingTool.cxx.

763  {
764 
765  // store GhostBHadronsFinal count
766  int nMatchB = getNGhostParticles( jet, "GhostBHadronsFinal" );
767  (*dh.nbHandle)(jet) = nMatchB;
768 
770  bool is_bb = false;
771  bool is_cc = false;
772  bool is_tautauEl = false;
773  bool is_tautauMu = false;
774  bool is_tautauHad = false;
775  bool isTop = false;
776  bool isW = false;
777  bool isZ = false;
778 
780  if ( m_truthLabelName == "R10TruthLabel_R21Consolidated" ) {
781  is_bb = ( nMatchB > 1 );
782  isTop = ( matchTop && nMatchB > 0 && jet.m() / 1000. > m_mLowTop );
783  isW = matchW && nMatchB == 0 && jet.m() / 1000. > m_mLowW && jet.m() / 1000. < m_mHighW;
784  isZ = matchZ && jet.m() / 1000. > m_mLowZ && jet.m() / 1000. < m_mHighZ;
785  }
786 
788  if ( m_truthLabelName == "R10TruthLabel_R21Precision" ) {
790  is_bb = ( nMatchB > 1 );
791  isTop = ( matchTop && matchW && nMatchB > 0 && jet.m() / 1000. > m_mLowTop && split23Handle(jet) / 1000. > getTopSplit23Cut( jet.pt() / 1000. ) );
792  isW = matchW && nMatchB == 0 && jet.m() / 1000. > m_mLowW && jet.m() / 1000. < m_mHighW;
793  isZ = matchZ && jet.m() / 1000. > m_mLowZ && jet.m() / 1000. < m_mHighZ;
794  }
795 
796  // Use R21Precision_2022v1 definition
797  if ( m_truthLabelName == "R10TruthLabel_R21Precision_2022v1" ) {
800  is_bb = ( nMatchB > 1 );
801  isTop = ( matchTop && matchW && nMatchB > 0 && jet.m() / 1000. > m_mLowTop && split23Handle(jet) / 1000. > getTopSplit23Cut( jet.pt() / 1000. ) );
802  isW = matchW && nMatchB == 0 && jet.m() / 1000. > m_mLowW && split12Handle(jet) / 1000. > getWZSplit12Cut( jet.pt() / 1000. );
803  isZ = matchZ && jet.m() / 1000. > m_mLowZ && split12Handle(jet) / 1000. > getWZSplit12Cut( jet.pt() / 1000. );
804  }
805 
806  // Use R10TruthLabel_R22v1 definition
807  if ( m_truthLabelName == "R10TruthLabel_R22v1" ) {
808  // get extended ghost associated truth label
809  int extended_GA_label = -1;
810  if (not jet.getAttribute("HadronGhostExtendedTruthLabelID", extended_GA_label)) {
811  ATH_MSG_ERROR( "HadronGhostExtendedTruthLabelID not available for " + m_truthJetCollectionName.key() );
812  }
813 
816  is_bb = ( extended_GA_label == 55 );
817  is_cc = ( extended_GA_label == 44 );
818  is_tautauEl = ( extended_GA_label == 151511 );
819  is_tautauMu = ( extended_GA_label == 151513 );
820  is_tautauHad = ( extended_GA_label == 1515 );
821  isTop = ( matchTop && matchW && nMatchB > 0 && jet.m() / 1000. > m_mLowTop && split23Handle(jet) / 1000. > getTopSplit23Cut( jet.pt() / 1000. ) );
822  isW = matchW && nMatchB == 0 && jet.m() / 1000. > m_mLowW && split12Handle(jet) / 1000. > getWZSplit12Cut( jet.pt() / 1000. );
823  isZ = matchZ && jet.m() / 1000. > m_mLowZ && split12Handle(jet) / 1000. > getWZSplit12Cut( jet.pt() / 1000. );
824  }
825 
826 
828 
829  /* The default priority of labels is:
830  * 1) Hbb/cc/tautau
831  * 2) Contained top
832  * 3) Contained W
833  * 4) Contained Zbb/cc/qq
834  * 5) Uncontained top
835  * 6) Uncontained V
836  */
837 
839  if( !(matchTop || matchW || matchZ || matchH) ) {
841  }
842 
843  // Higgs
844  if ( matchH ) {
846  if ( is_bb ) return LargeRJetTruthLabel::Hbb;
848  if ( is_cc ) return LargeRJetTruthLabel::Hcc;
850  if ( is_tautauEl ) return LargeRJetTruthLabel::HtautauEl;
851  if ( is_tautauMu ) return LargeRJetTruthLabel::HtautauMu;
852  if ( is_tautauHad ) return LargeRJetTruthLabel::HtautauHad;
855  }
856 
858  if ( isTop ) return LargeRJetTruthLabel::tqqb;
859 
860  if ( isW ) {
862  if ( matchTop ) return LargeRJetTruthLabel::Wqq_From_t;
865  }
866 
867  if ( matchZ ) {
869  if ( is_bb ) return LargeRJetTruthLabel::Zbb;
871  if ( is_cc ) return LargeRJetTruthLabel::Zcc;
872  }
873  if ( isZ ) {
876  }
877 
879  if ( matchTop ) return LargeRJetTruthLabel::other_From_t;
880 
883 
884 }

◆ 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  };

◆ 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::TEvent 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::TEvent, 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 741 of file JetTruthLabelingTool.cxx.

741  {
742 
743  int nMatchPart = 0;
744 
745  if( !jet.getAttribute<int>( collection+"Count", nMatchPart ) ){
746 
747  std::vector<const xAOD::TruthParticle*> ghostParts;
748  if( !jet.getAssociatedObjects<xAOD::TruthParticle>( collection, ghostParts ) ){
749  ATH_MSG_ERROR( collection + " cannot be retrieved! Truth label definition might be wrong" );
750  }
751  nMatchPart = ghostParts.size();
752  }
753 
754  return nMatchPart;
755 }

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

580  {
581 
582  tlvs.clear();
583 
585  if(isSherpa) {
586  int countStatus3 = 0;
587 
589  TLorentzVector p1(0,0,0,0);
590  TLorentzVector p2(0,0,0,0);
591 
593  TLorentzVector WZCand(0,0,0,0);
594 
596  bool isWPCand = false;
597  bool isWMCand = false;
598  bool isZCand = false;
599 
601  bool inMassWindow = false;
602 
603  for ( unsigned int ipart = 0; ipart < truthBosons->size(); ipart++ ){
604 
605  const xAOD::TruthParticle* part1 = truthBosons->at(ipart);
606 
608  if ( MC::isPhysical(part1) ) continue;
609 
611  if ( std::abs(part1->pdgId()) > 5 ) continue;
612 
613  countStatus3++;
615  if ( countStatus3 > 3 ) continue;
617  p1 = part1->p4();
618 
620  for ( unsigned int jpart = ipart+1; jpart < truthBosons->size(); jpart++ ) {
621 
622  const xAOD::TruthParticle* part2 = truthBosons->at(jpart);
623 
625  if ( MC::isPhysical(part2) ) continue;
626 
628  if ( std::abs(part2->pdgId()) > 5 ) continue;
629 
630  p2 = part2->p4();
631 
633  if ( part1->pdgId() + part2->pdgId() == 0 ) {
634  isZCand = true;
635  }
637  else if ( part1->pdgId() == 2 || part1->pdgId() == 4 || part2->pdgId() == 2 || part2->pdgId() == 4 ) {
638  isWPCand = true;
639  }
641  else {
642  isWMCand = true;
643  }
644 
646  break;
647 
648  }
649 
650  WZCand = p1 + p2;
651 
653  if ( 60000 < WZCand.M() && WZCand.M() < 140000. ) {
654  inMassWindow = true;
655  break;
656  }
657 
658  }
659 
660  if ( inMassWindow && (isWPCand || isWMCand || isZCand) ) {
661  std::pair<TLorentzVector,int> WZ;
662  if ( isZCand ) {
663  WZ = std::make_pair(WZCand,23);
664  }
665  if ( isWPCand ) {
666  WZ = std::make_pair(WZCand,24);
667  }
668  if ( isWMCand ) {
669  WZ = std::make_pair(WZCand,-24);
670  }
671  tlvs.push_back(WZ);
672  }
673 
674  }
675 
677  for ( const xAOD::TruthParticle* part : *truthBosons ) {
678  if ( !(selectTruthParticle(part,23) || selectTruthParticle(part,24) || selectTruthParticle(part,25)) ) continue;
680  tlvs.push_back(std::make_pair(part->p4(),part->pdgId()));
681  }
682 
684  for ( const xAOD::TruthParticle* part : *truthTop ) {
685  if ( !selectTruthParticle(part,6) ) continue;
687  tlvs.push_back(std::make_pair(part->p4(),part->pdgId()));
688  }
689 
690 }

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

720  {
721 
724 
725  float split23 = -999.0;
726 
727  if ( m_truthLabelName == "R10TruthLabel_R21Precision" ||
728  m_truthLabelName == "R10TruthLabel_R21Precision_2022v1" ||
729  m_truthLabelName == "R10TruthLabel_R22v1") {
730 
731  const float c0 = 3.3;
732  const float c1 = -6.98e-4;
733 
734  split23 = std::exp( c0 + c1 * pt );
735 
736  }
737 
738  return split23;
739 }

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

210  {
211 
213  bool matchW = false;
214  bool matchZ = false;
215  bool matchH = false;
216  bool matchTop = false;
217 
219  float dR_W = 9999;
220  float dR_Z = 9999;
221  float dR_H = 9999;
222  float dR_Top = 9999;
223 
224  for (auto tlv_truth : tlv_truthParts) {
225  float dR = tlv_truth.first.DeltaR(jet.p4());
226  if( dR < m_dRTruthPart ) {
227 
228  if ( std::abs(tlv_truth.second) == 23 && !matchZ ) {
229  dR_Z = dR;
230  matchZ = true;
231  }
232 
233  if ( std::abs(tlv_truth.second) == 24 && !matchW ) {
234  dR_W = dR;
235  matchW = true;
236  }
237 
238  if ( std::abs(tlv_truth.second) == 25 && !matchH ) {
239  dR_H = dR;
240  matchH = true;
241  }
242 
243  if ( std::abs(tlv_truth.second) == 6 && !matchTop ) {
244  dR_Top = dR;
245  matchTop = true;
246  }
247 
248  }
249  }
250 
252  (*dh.dRWHandle)(jet) = dR_W;
253  (*dh.dRZHandle)(jet) = dR_Z;
254  (*dh.dRHHandle)(jet) = dR_H;
255  (*dh.dRTopHandle)(jet) = dR_Top;
256 
257  return getLabel( dh, jet, matchH, matchW, matchZ, matchTop, ctx );
258 
259 }

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

264 {
266  bool matchW = false;
267  bool matchZ = false;
268  bool matchH = false;
269  bool matchTop = false;
270 
272  int nMatchW = getNGhostParticles( jet, "GhostWBosons" );
273 
274  if ( nMatchW ) {
275  matchW = true;
276  }
277 
279  int nMatchZ = getNGhostParticles( jet, "GhostZBosons" );
280 
281  if ( nMatchZ ) {
282  matchZ = true;
283  }
284 
286  int nMatchH = getNGhostParticles( jet, "GhostHBosons" );
287 
288  if ( nMatchH ) {
289  matchH = true;
290  }
291 
293  int nMatchTop = getNGhostParticles( jet, "GhostTQuarksFinal" );
294 
295  if ( nMatchTop ) {
296  matchTop = true;
297  }
298 
299  return getLabel( dh, jet, matchH, matchW, matchZ, matchTop, ctx );
300 
301 }

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

702  {
703 
706 
707  float split12 = -999.0;
708 
709  if ( m_truthLabelName == "R10TruthLabel_R21Precision_2022v1" || m_truthLabelName == "R10TruthLabel_R22v1") {
710  const float c0 = 55.25;
711  const float c1 = -2.34e-3;
712 
713  split12 = c0 * std::exp( c1 * pt );
714  }
715 
716  return split12;
717 
718 }

◆ initialize()

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

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

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

Reimplemented from asg::AsgTool.

Definition at line 18 of file JetTruthLabelingTool.cxx.

18  {
19 
20  ATH_MSG_INFO("Initializing " << name());
21 
24  if(m_truthLabelName == "R10TruthLabel_R21Consolidated") {
25  m_truthJetCollectionName="AntiKt10TruthTrimmedPtFrac5SmallR20Jets";
26  m_matchUngroomedParent = false;
27  m_dRTruthJet = 0.75;
28  m_useDRMatch = true;
29  m_dRTruthPart = 0.75;
30  m_useWZMassHigh = true;
31  m_mLowTop = 140.0;
32  m_mLowW = 50.0;
33  m_mHighW = 100.0;
34  m_mLowZ = 60.0;
35  m_mHighZ = 110.0;
37  }
39  else if(m_truthLabelName == "R10TruthLabel_R21Precision") {
40  m_truthJetCollectionName="AntiKt10TruthJets";
42  m_dRTruthJet = 0.75;
43  m_useDRMatch = false;
44  m_useWZMassHigh = true;
45  m_mLowTop = 140.0;
46  m_mLowW = 50.0;
47  m_mHighW = 100.0;
48  m_mLowZ = 60.0;
49  m_mHighZ = 110.0;
51  }
53  else if( m_truthLabelName == "R10TruthLabel_R21Precision_2022v1" or m_truthLabelName == "R10TruthLabel_R22v1" ) {
54  m_truthJetCollectionName="AntiKt10TruthJets";
56  m_dRTruthJet = 0.75;
57  m_useDRMatch = false;
58  m_useWZMassHigh = false;
59  m_mLowTop = 140.0;
60  m_mLowW = 50.0;
61  m_mLowZ = 50.0;
62  if ( m_truthLabelName == "R10TruthLabel_R22v1" ) {
64  m_truthGroomedJetCollectionName = "AntiKt10TruthSoftDropBeta100Zcut10Jets";
65  } else {
67  }
68  }
69 
70  print();
71 
73 
74  bool isSupportedLabel = false;
75  isSupportedLabel = isSupportedLabel || (m_truthLabelName=="R10TruthLabel_R21Consolidated");
76  isSupportedLabel = isSupportedLabel || (m_truthLabelName=="R10TruthLabel_R21Precision");
77  isSupportedLabel = isSupportedLabel || (m_truthLabelName=="R10TruthLabel_R21Precision_2022v1");
78  isSupportedLabel = isSupportedLabel || (m_truthLabelName=="R10TruthLabel_R22v1");
79 
80  if(!isSupportedLabel) {
81  ATH_MSG_ERROR("TruthLabelName " << m_truthLabelName << " is not supported. Exiting...");
82  return StatusCode::FAILURE;
83  }
84 
91  m_split12_truthKey = m_truthJetCollectionName.key() + ".Split12";
92  m_split23_truthKey = m_truthJetCollectionName.key() + ".Split23";
93 
94  if(!m_isTruthJetCol){
101  m_truthSplit12_recoKey = m_jetContainerName + "." + m_truthLabelName + "_TruthJetSplit12";
102  m_truthSplit23_recoKey = m_jetContainerName + "." + m_truthLabelName + "_TruthJetSplit23";
103  m_truthJetMass_recoKey = m_jetContainerName + "." + m_truthLabelName + "_TruthJetMass";
104  m_truthJetPt_recoKey = m_jetContainerName + "." + m_truthLabelName + "_TruthJetPt";
105  m_truthGroomedJetMass_recoKey = m_jetContainerName + "." + m_truthLabelName + "_TruthGroomedJetMass";
106  m_truthGroomedJetPt_recoKey = m_jetContainerName + "." + m_truthLabelName + "_TruthGroomedJetPt";
107  }
108 
113  ATH_CHECK(m_truthJetCollectionName.initialize());
115 
116  ATH_CHECK(m_label_truthKey.initialize());
121  ATH_CHECK(m_NB_truthKey.initialize());
122 
123  ATH_CHECK(m_split12_truthKey.initialize(m_truthLabelName == "R10TruthLabel_R21Precision_2022v1" || m_truthLabelName == "R10TruthLabel_R22v1"));
124  ATH_CHECK(m_split23_truthKey.initialize(m_truthLabelName == "R10TruthLabel_R21Precision" || m_truthLabelName == "R10TruthLabel_R21Precision_2022v1" || m_truthLabelName == "R10TruthLabel_R22v1"));
125 
131  ATH_CHECK(m_NB_recoKey.initialize(!m_isTruthJetCol));
132  ATH_CHECK(m_truthSplit12_recoKey.initialize(!m_isTruthJetCol && (m_truthLabelName == "R10TruthLabel_R21Precision_2022v1" || m_truthLabelName == "R10TruthLabel_R22v1") ));
133  ATH_CHECK(m_truthSplit23_recoKey.initialize(!m_isTruthJetCol && (m_truthLabelName == "R10TruthLabel_R21Precision" || m_truthLabelName == "R10TruthLabel_R21Precision_2022v1" || m_truthLabelName == "R10TruthLabel_R22v1")));
136 
139 
140  return StatusCode::SUCCESS;
141 }

◆ 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

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

323  {
324 
326  SG::ReadHandle<xAOD::JetContainer> truthGroomedJets;
328  truthGroomedJets = SG::makeHandle(m_truthGroomedJetCollectionName, ctx);
329  }
330  const SG::AuxElement::Accessor<int> nbAcc (m_truthLabelName + "_NB");
331  static const SG::ConstAccessor< ElementLink< xAOD::JetContainer > > ParentAcc ("Parent");
332  for(const xAOD::Jet *jet : jets) {
333 
335  const xAOD::Jet* parent = nullptr;
336  if ( m_matchUngroomedParent ){
337  ElementLink<xAOD::JetContainer> element_link = ParentAcc (*jet);
338  if ( element_link.isValid() ) {
339  parent = *element_link;
340  }
341  else {
342  ATH_MSG_ERROR("Unable to get a link to the parent jet! Returning a NULL pointer.");
343  return StatusCode::FAILURE;
344  }
345  }
346 
348  float dRmin = 9999;
349  const xAOD::Jet* matchTruthJet = nullptr;
350  float dRminGroomed = 9999;
351  const xAOD::Jet* matchTruthGroomedJet = nullptr;
352 
353  // Ensure that the reco jet has at least one constituent
354  // (and thus a well-defined four-vector)
355  if(jet->numConstituents() > 0){
356  for ( const xAOD::Jet* truthJet : *truthJets ) {
357  float dR = jet->p4().DeltaR( truthJet->p4() );
359  if ( parent ) dR = parent->p4().DeltaR( truthJet->p4() );
361  if ( m_dRTruthJet < 0 || dR < m_dRTruthJet ) {
362  if ( dR < dRmin ) {
363  dRmin = dR;
364  matchTruthJet = truthJet;
365  }
366  }
367  }
368  }
369 
371  float dR_truthJet_W = 9999;
372  float dR_truthJet_Z = 9999;
373  float dR_truthJet_Top = 9999;
374  float dR_truthJet_H = 9999;
375  int truthJetNB = -1;
376  float truthJetSplit12 = -9999;
377  float truthJetSplit23 = -9999;
378  float truthJetMass = -9999;
379  float truthJetPt = -9999;
380 
381  if ( matchTruthJet ) {
382  // WriteDecorHandles can also read
383  label = (*dh.labelHandle)(*matchTruthJet);
384  if ( m_useDRMatch ) {
385  if(dh.dRWHandle->isAvailable()) dR_truthJet_W = (*dh.dRWHandle)(*matchTruthJet);
386  if(dh.dRZHandle->isAvailable()) dR_truthJet_Z = (*dh.dRZHandle)(*matchTruthJet);
387  if(dh.dRHHandle->isAvailable()) dR_truthJet_H = (*dh.dRHHandle)(*matchTruthJet);
388  if(dh.dRTopHandle->isAvailable()) dR_truthJet_Top = (*dh.dRTopHandle)(*matchTruthJet);
389  }
390  if ( m_truthLabelName == "R10TruthLabel_R21Precision" ) {
392  if(split23Handle.isAvailable()) truthJetSplit23 = split23Handle(*matchTruthJet);
393  }
394  if ( m_truthLabelName == "R10TruthLabel_R21Precision_2022v1" || m_truthLabelName == "R10TruthLabel_R22v1" ) {
396  if(split23Handle.isAvailable()) truthJetSplit23 = split23Handle(*matchTruthJet);
398  if(split12Handle.isAvailable()) truthJetSplit12 = split12Handle(*matchTruthJet);
399  }
400  if(nbAcc.isAvailable(*matchTruthJet)) truthJetNB = nbAcc (*matchTruthJet);
401  truthJetMass = matchTruthJet->m();
402  truthJetPt = matchTruthJet->pt();
403  }
404 
405  // Save Groomed Truth Jet variables
406  float truthGroomedJetMass = -9999;
407  float truthGroomedJetPt = -9999;
409  if ( matchTruthJet ) {
410  for ( const xAOD::Jet* truthGroomedJet : *truthGroomedJets ) {
411  ElementLink<xAOD::JetContainer> element_link = ParentAcc (*truthGroomedJet);
412  if ( !element_link.isValid() ) { continue; }
413  if ( matchTruthJet == *element_link ) {
414  matchTruthGroomedJet = truthGroomedJet;
415  break;
416  }
417  }
418  }
419  // If no matched jet found or matched jet has no corresponding groomed jet, use dR matching
420  if ( !matchTruthGroomedJet ) {
421  for ( const xAOD::Jet* truthGroomedJet : *truthGroomedJets ) {
422  float dR = jet->p4().DeltaR( truthGroomedJet->p4() );
424  if ( m_dRTruthJet < 0 || dR < m_dRTruthJet ) {
425  if ( dR < dRminGroomed ) {
426  dRminGroomed = dR;
427  matchTruthGroomedJet = truthGroomedJet;
428  }
429  }
430  }
431  }
432  if ( matchTruthGroomedJet ) {
433  truthGroomedJetMass = matchTruthGroomedJet->m();
434  truthGroomedJetPt = matchTruthGroomedJet->pt();
435  }
436  }
437 
439  (*dh.labelRecoHandle)(*jet) = label;
440 
442  if ( m_useDRMatch ) {
443  (*dh.dRWRecoHandle)(*jet) = dR_truthJet_W;
444  (*dh.dRZRecoHandle)(*jet) = dR_truthJet_Z;
445  (*dh.dRHRecoHandle)(*jet) = dR_truthJet_H;
446  (*dh.dRTopRecoHandle)(*jet) = dR_truthJet_Top;
447  }
448  if ( m_truthLabelName == "R10TruthLabel_R21Precision" ) {
449  (*dh.split23Handle)(*jet) = truthJetSplit23;
450  }
451 
452  if ( m_truthLabelName == "R10TruthLabel_R21Precision_2022v1" || m_truthLabelName == "R10TruthLabel_R22v1" ) {
453  (*dh.split23Handle)(*jet) = truthJetSplit23;
454  (*dh.split12Handle)(*jet) = truthJetSplit12;
455  }
456 
457  (*dh.nbRecoHandle)(*jet) = truthJetNB;
458  (*dh.truthMassHandle)(*jet) = truthJetMass;
459  (*dh.truthPtHandle)(*jet) = truthJetPt;
460 
462  (*dh.truthGroomedMassHandle)(*jet) = truthGroomedJetMass;
463  (*dh.truthGroomedPtHandle)(*jet) = truthGroomedJetPt;
464  }
465  }
466 
467  return StatusCode::SUCCESS;
468 }

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

471  {
472 
475 
477  if ( !truthJets.isValid() ) {
478  ATH_MSG_ERROR("No truth jet container retrieved. Please make sure you are using a supported TruthLabelName.");
479  return StatusCode::FAILURE;
480  }
481 
482  return labelTruthJets(dh, *truthJets, ctx);
483 
484 }

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

489 {
491  if ( !(truthJets.size()) ) return StatusCode::SUCCESS;
492 
494  if(dh.labelHandle->isAvailable()){
495  ATH_MSG_DEBUG("labelTruthJets: Truth jet collection already labelled with " << m_truthLabelName);
496  return StatusCode::SUCCESS;
497  }
498 
500  int channelNumber = -999;
501 
504  if(!eventInfo.isValid()){
505  ATH_MSG_ERROR("Failed to retrieve event information.");
506  return StatusCode::FAILURE;
507  }
508 
510  std::vector<std::pair<TLorentzVector,int> > tlv_truthParts;
511 
513  if ( m_useDRMatch ) {
514 
515  channelNumber = eventInfo->mcChannelNumber();
516 
517  if ( channelNumber < 0 ) {
518  ATH_MSG_ERROR("Channel number was not set correctly");
519  return StatusCode::FAILURE;
520  }
521 
523  bool isSherpa = getIsSherpa(channelNumber);
524 
525  if ( m_useTRUTH3 && isSherpa ) {
526  ATH_MSG_ERROR("Cannot apply truth labels to Sherpa 2.2.1 samples using TRUTH3 containers");
527  return StatusCode::FAILURE;
528  }
529 
531  if( m_useTRUTH3 ) {
534  if(!truthPartsBoson.isValid()){
535  ATH_MSG_ERROR("Unable to find " << m_truthBosonContainerName.key() << ". Please check the content of your input file.");
536  return StatusCode::FAILURE;
537  }
540  if(!truthPartsTop.isValid()){
541  ATH_MSG_ERROR("Unable to find " << m_truthTopQuarkContainerName.key() << ". Please check the content of your input file.");
542  return StatusCode::FAILURE;
543  }
545  getTLVs(tlv_truthParts, truthPartsBoson.cptr(), truthPartsTop.cptr(), isSherpa);
546  }
547 
549  else {
551  if(!truthParts.isValid()){
552  ATH_MSG_ERROR("Unable to find " << m_truthParticleContainerName << ". Please check the content of your input file.");
553  return StatusCode::FAILURE;
554  }
556  getTLVs(tlv_truthParts, truthParts.cptr(), truthParts.cptr(), isSherpa);
557  }
558  }
559 
562  for ( const xAOD::Jet *jet : truthJets ) {
563 
564  if ( m_useDRMatch ) {
565  ATH_MSG_DEBUG("Getting truth label using dR matching");
566  label = getTruthJetLabelDR(dh, *jet, tlv_truthParts, ctx);
567  }
568 
569  else {
570  ATH_MSG_DEBUG("Getting truth label using ghost-association");
571  label = getTruthJetLabelGA(dh, *jet, ctx);
572  }
573 
574  (*dh.labelHandle)(*jet) = label;
575  }
576 
577  return StatusCode::SUCCESS;
578 }

◆ 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);};

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ 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  }

◆ 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.

◆ print()

void JetTruthLabelingTool::print ( ) const
overridevirtual

Print configured parameters.

Reimplemented from asg::AsgTool.

Definition at line 143 of file JetTruthLabelingTool.cxx.

143  {
144  ATH_MSG_INFO("Parameters for " << name());
145 
146  ATH_MSG_INFO("xAOD information:");
147  ATH_MSG_INFO("TruthLabelName: " << m_truthLabelName);
148  ATH_MSG_INFO("UseTRUTH3: " << ( m_useTRUTH3 ? "True" : "False"));
149 
150  if(m_useTRUTH3) {
151  ATH_MSG_INFO("TruthBosonContainerName: " << m_truthBosonContainerName);
152  ATH_MSG_INFO("TruthTopQuarkContainerName: " << m_truthTopQuarkContainerName);
153  }
154  else {
155  ATH_MSG_INFO("TruthParticleContainerName: " << m_truthParticleContainerName);
156  }
157 
158  ATH_MSG_INFO("TruthJetCollectionName: " << m_truthJetCollectionName.key());
159  ATH_MSG_INFO("dRTruthJet: " << std::to_string(m_dRTruthJet));
160 
161  if ( m_useDRMatch ) {
162  ATH_MSG_INFO("dRTruthPart: " << std::to_string(m_dRTruthPart));
163  }
164 
165  ATH_MSG_INFO("mLowTop: " << std::to_string(m_mLowTop));
166  ATH_MSG_INFO("mLowW: " << std::to_string(m_mLowW));
167  if(m_useWZMassHigh)
168  ATH_MSG_INFO("mHighW: " << std::to_string(m_mHighW));
169  ATH_MSG_INFO("mLowZ: " << std::to_string(m_mLowZ));
170  if(m_useWZMassHigh)
171  ATH_MSG_INFO("mHighZ: " << std::to_string(m_mHighZ));
172 
174  ATH_MSG_INFO("truthGroomedJetCollectionName: " << m_truthGroomedJetCollectionName.key());
175  }
176 }

◆ 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();
383  PBASE::renounce (h);
384  }

◆ 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  {
365  handlesArray.renounce();
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 692 of file JetTruthLabelingTool.cxx.

692  {
693  if ( std::abs(tp->pdgId()) != pdgId ) return false;
694  for ( unsigned int iChild = 0; iChild < tp->nChildren(); iChild++ ) {
695  const xAOD::TruthParticle *child = tp->child(iChild);
696  if ( !child ) continue;
697  if ( child->pdgId() == tp->pdgId() ) return false;
698  }
699  return true;
700 }

◆ 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 DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ 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) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Friends And Related Function Documentation

◆ DecorHandles

friend struct DecorHandles
friend

Definition at line 102 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 170 of file JetTruthLabelingTool.h.

◆ 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 161 of file JetTruthLabelingTool.h.

◆ 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 171 of file JetTruthLabelingTool.h.

◆ 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 162 of file JetTruthLabelingTool.h.

◆ 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 168 of file JetTruthLabelingTool.h.

◆ 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 159 of file JetTruthLabelingTool.h.

◆ 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 169 of file JetTruthLabelingTool.h.

◆ 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 160 of file JetTruthLabelingTool.h.

◆ m_dRTruthJet

double JetTruthLabelingTool::m_dRTruthJet
protected

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

Definition at line 68 of file JetTruthLabelingTool.h.

◆ m_dRTruthPart

double JetTruthLabelingTool::m_dRTruthPart
protected

dR to match truth jet to reco jet

Definition at line 69 of file JetTruthLabelingTool.h.

◆ 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.

◆ 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 67 of file JetTruthLabelingTool.h.

◆ 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.

◆ 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.

◆ m_label_recoKey

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

Definition at line 167 of file JetTruthLabelingTool.h.

◆ m_label_truthKey

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

Definition at line 158 of file JetTruthLabelingTool.h.

◆ m_matchUngroomedParent

bool JetTruthLabelingTool::m_matchUngroomedParent
protected

Use upper mass cut for W/Z labels.

Definition at line 66 of file JetTruthLabelingTool.h.

◆ m_mHighW

double JetTruthLabelingTool::m_mHighW
protected

Lower mass cut for W label.

Definition at line 72 of file JetTruthLabelingTool.h.

◆ m_mHighZ

double JetTruthLabelingTool::m_mHighZ
protected

Lower mass cut for Z label.

Definition at line 74 of file JetTruthLabelingTool.h.

◆ m_mLowTop

double JetTruthLabelingTool::m_mLowTop
protected

dR to match truth particles to truth jet

Definition at line 70 of file JetTruthLabelingTool.h.

◆ m_mLowW

double JetTruthLabelingTool::m_mLowW
protected

Lower mass cut for top label.

Definition at line 71 of file JetTruthLabelingTool.h.

◆ m_mLowZ

double JetTruthLabelingTool::m_mLowZ
protected

Upper mass cut for W label.

Definition at line 73 of file JetTruthLabelingTool.h.

◆ m_NB_recoKey

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

Definition at line 172 of file JetTruthLabelingTool.h.

◆ m_NB_truthKey

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

Definition at line 163 of file JetTruthLabelingTool.h.

◆ m_split12_truthKey

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

Definition at line 164 of file JetTruthLabelingTool.h.

◆ m_split23_truthKey

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

Definition at line 165 of file JetTruthLabelingTool.h.

◆ 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.

◆ m_truthGroomedJetCollectionName

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

Definition at line 63 of file JetTruthLabelingTool.h.

◆ m_truthGroomedJetMass_recoKey

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

Definition at line 177 of file JetTruthLabelingTool.h.

◆ m_truthGroomedJetPt_recoKey

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

Definition at line 178 of file JetTruthLabelingTool.h.

◆ 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.

◆ m_truthJetMass_recoKey

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

Definition at line 175 of file JetTruthLabelingTool.h.

◆ m_truthJetPt_recoKey

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

Definition at line 176 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.

◆ 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.

◆ m_truthSplit12_recoKey

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

Definition at line 173 of file JetTruthLabelingTool.h.

◆ m_truthSplit23_recoKey

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

Definition at line 174 of file JetTruthLabelingTool.h.

◆ 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.

◆ m_useDRMatch

bool JetTruthLabelingTool::m_useDRMatch
protected

Definition at line 64 of file JetTruthLabelingTool.h.

◆ 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.

◆ m_useWZMassHigh

bool JetTruthLabelingTool::m_useWZMassHigh
protected

Use dR to match partons to truth jet.

Definition at line 65 of file JetTruthLabelingTool.h.

◆ 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:
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
JetTruthLabelingTool::m_evtInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_evtInfoKey
Definition: JetTruthLabelingTool.h:53
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
JetTruthLabelingTool::m_truthSplit12_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_truthSplit12_recoKey
Definition: JetTruthLabelingTool.h:173
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
JetTruthLabelingTool::m_truthGroomedJetPt_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_truthGroomedJetPt_recoKey
Definition: JetTruthLabelingTool.h:178
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:66
JetTruthLabelingTool::m_dR_Top_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dR_Top_recoKey
Definition: JetTruthLabelingTool.h:171
JetTruthLabelingTool::m_matchUngroomedParent
bool m_matchUngroomedParent
Use upper mass cut for W/Z labels.
Definition: JetTruthLabelingTool.h:66
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
JetTruthLabelingTool::m_truthParticleContainerName
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleContainerName
Definition: JetTruthLabelingTool.h:57
JetTruthLabelingTool::DecorHandles
friend struct DecorHandles
Definition: JetTruthLabelingTool.h:102
JetTruthLabelingTool::m_isTruthJetCol
Gaudi::Property< bool > m_isTruthJetCol
Definition: JetTruthLabelingTool.h:51
jet::JetTopology::WZ
@ WZ
Definition: UncertaintyEnum.h:211
extractSporadic.c1
c1
Definition: extractSporadic.py:134
JetTruthLabelingTool::m_mHighW
double m_mHighW
Lower mass cut for W label.
Definition: JetTruthLabelingTool.h:72
test_pyathena.pt
pt
Definition: test_pyathena.py:11
LargeRJetTruthLabel::other_From_t
@ other_From_t
Definition: LargeRJetLabelEnum.h:22
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
ParticleTest.tp
tp
Definition: ParticleTest.py:25
JetTruthLabelingTool::m_useTRUTH3
Gaudi::Property< bool > m_useTRUTH3
TRUTH1 or TRUTH3.
Definition: JetTruthLabelingTool.h:56
JetTruthLabelingTool::m_truthGroomedJetMass_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_truthGroomedJetMass_recoKey
Definition: JetTruthLabelingTool.h:177
JetTruthLabelingTool::selectTruthParticle
bool selectTruthParticle(const xAOD::TruthParticle *tp, int pdgId) const
Check if truth particle has correct DSID and isn't self decay.
Definition: JetTruthLabelingTool.cxx:692
JetTruthLabelingTool::m_dR_H_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dR_H_recoKey
Definition: JetTruthLabelingTool.h:170
JetTruthLabelingTool::m_truthTopQuarkContainerName
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthTopQuarkContainerName
Definition: JetTruthLabelingTool.h:59
JetTruthLabelingTool::labelTruthJets
StatusCode labelTruthJets(DecorHandles &dh, const EventContext &ctx) const
Label truth jet collection.
Definition: JetTruthLabelingTool.cxx:470
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:54
PyPoolBrowser.dh
dh
Definition: PyPoolBrowser.py:102
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
JetTruthLabelingTool::m_truthBosonContainerName
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthBosonContainerName
Definition: JetTruthLabelingTool.h:58
LargeRJetTruthLabel::Zqq
@ Zqq
Definition: LargeRJetLabelEnum.h:20
JetTruthLabelingTool::getNGhostParticles
int getNGhostParticles(const xAOD::Jet &jet, std::string collection) const
Get number of ghost associated particles.
Definition: JetTruthLabelingTool.cxx:741
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
JetTruthLabelingTool::m_mLowZ
double m_mLowZ
Upper mass cut for W label.
Definition: JetTruthLabelingTool.h:73
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
JetTruthLabelingTool::m_truthGroomedJetCollectionName
SG::ReadHandleKey< xAOD::JetContainer > m_truthGroomedJetCollectionName
Definition: JetTruthLabelingTool.h:63
LargeRJetTruthLabel::qcd
@ qcd
Definition: LargeRJetLabelEnum.h:25
LargeRJetTruthLabel::Hbb
@ Hbb
Definition: LargeRJetLabelEnum.h:26
JetTruthLabelingTool::m_NB_truthKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_NB_truthKey
Definition: JetTruthLabelingTool.h:163
JetTruthLabelingTool::m_label_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_label_recoKey
Definition: JetTruthLabelingTool.h:167
PowhegPy8EG_H2a.pdgId
dictionary pdgId
Definition: PowhegPy8EG_H2a.py:128
LargeRJetTruthLabel::notruth
@ notruth
Definition: LargeRJetLabelEnum.h:24
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
LargeRJetTruthLabel::HtautauMu
@ HtautauMu
Definition: LargeRJetLabelEnum.h:30
JetTruthLabelingTool::m_mLowW
double m_mLowW
Lower mass cut for top label.
Definition: JetTruthLabelingTool.h:71
JetTruthLabelingTool::getTruthJetLabelDR
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.
Definition: JetTruthLabelingTool.cxx:207
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:269
hotSpotInTAG.c0
c0
Definition: hotSpotInTAG.py:192
MC::isPhysical
bool isPhysical(const T &p)
Definition: HepMCHelpers.h:32
part1
Definition: part1.py:1
JetTruthLabelingTool::m_dR_W_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dR_W_recoKey
Definition: JetTruthLabelingTool.h:168
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
JetTruthLabelingTool::getTopSplit23Cut
float getTopSplit23Cut(float pt) const
Get top label Split23 cut.
Definition: JetTruthLabelingTool.cxx:720
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
AthCommonDataStore
Definition: AthCommonDataStore.h:52
LargeRJetTruthLabel::Wqq
@ Wqq
Definition: LargeRJetLabelEnum.h:17
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SG::ReadDecorHandle
Handle class for reading a decoration on an object.
Definition: StoreGate/StoreGate/ReadDecorHandle.h:94
JetTruthLabelingTool::m_dR_Z_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dR_Z_recoKey
Definition: JetTruthLabelingTool.h:169
LargeRJetTruthLabel::HtautauEl
@ HtautauEl
Definition: LargeRJetLabelEnum.h:29
JetTruthLabelingTool::m_dR_Top_truthKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dR_Top_truthKey
Definition: JetTruthLabelingTool.h:162
JetTruthLabelingTool::getLabel
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.
Definition: JetTruthLabelingTool.cxx:757
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
isZ
bool isZ(const T &p)
Definition: AtlasPID.h:164
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
JetTruthLabelingTool::m_dR_H_truthKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dR_H_truthKey
Definition: JetTruthLabelingTool.h:161
JetTruthLabelingTool::m_truthJetPt_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_truthJetPt_recoKey
Definition: JetTruthLabelingTool.h:176
JetTruthLabelingTool::m_mHighZ
double m_mHighZ
Lower mass cut for Z label.
Definition: JetTruthLabelingTool.h:74
test_pyathena.parent
parent
Definition: test_pyathena.py:15
JetTruthLabelingTool::getIsSherpa
bool getIsSherpa(const int DSID) const
Check for Sherpa DSIDs.
Definition: JetTruthLabelingTool.h:142
python.xAODType.dummy
dummy
Definition: xAODType.py:4
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MSG::name
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition: MsgLevel.cxx:19
LargeRJetTruthLabel::Hcc
@ Hcc
Definition: LargeRJetLabelEnum.h:27
GetAllXsec.DSID
tuple DSID
Definition: GetAllXsec.py:53
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
JetTruthLabelingTool::m_split23_truthKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_split23_truthKey
Definition: JetTruthLabelingTool.h:165
JetTruthLabelingTool::getWZSplit12Cut
float getWZSplit12Cut(float pt) const
Get W/Z label Split12 cut.
Definition: JetTruthLabelingTool.cxx:702
LargeRJetTruthLabel::Zbb
@ Zbb
Definition: LargeRJetLabelEnum.h:18
LargeRJetTruthLabel::HtautauHad
@ HtautauHad
Definition: LargeRJetLabelEnum.h:31
part2
Definition: part2.py:1
JetTruthLabelingTool::m_useWZMassHigh
bool m_useWZMassHigh
Use dR to match partons to truth jet.
Definition: JetTruthLabelingTool.h:65
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
LargeRJetTruthLabel::Wqq_From_t
@ Wqq_From_t
Definition: LargeRJetLabelEnum.h:21
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
JetTruthLabelingTool::m_truthJetMass_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_truthJetMass_recoKey
Definition: JetTruthLabelingTool.h:175
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
JetTruthLabelingTool::getTLVs
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.
Definition: JetTruthLabelingTool.cxx:580
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
JetTruthLabelingTool::m_truthLabelName
Gaudi::Property< std::string > m_truthLabelName
Definition: JetTruthLabelingTool.h:49
JetTruthLabelingTool::m_mLowTop
double m_mLowTop
dR to match truth particles to truth jet
Definition: JetTruthLabelingTool.h:70
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
isW
bool isW(const T &p)
Definition: AtlasPID.h:167
JetTruthLabelingTool::m_split12_truthKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_split12_truthKey
Definition: JetTruthLabelingTool.h:164
xAOD::Jet_v1::m
virtual double m() const
The invariant mass of the particle.
Definition: Jet_v1.cxx:59
a
TList * a
Definition: liststreamerinfos.cxx:10
JetTruthLabelingTool::getTruthJetLabelGA
int getTruthJetLabelGA(DecorHandles &dh, const xAOD::Jet &jet, const EventContext &ctx) const
Get truth label using ghost-associated particles.
Definition: JetTruthLabelingTool.cxx:261
isTop
bool isTop(const T &p)
Definition: AtlasPID.h:126
h
IJetDecorator::decorate
virtual StatusCode decorate(const xAOD::JetContainer &jets) const =0
Decorate a jet collection without otherwise modifying it.
LargeRJetTruthLabel::other_From_V
@ other_From_V
Definition: LargeRJetLabelEnum.h:23
JetTruthLabelingTool::m_dR_Z_truthKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dR_Z_truthKey
Definition: JetTruthLabelingTool.h:160
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
JetTruthLabelingTool::m_truthJetCollectionName
SG::ReadHandleKey< xAOD::JetContainer > m_truthJetCollectionName
parameters for truth labeling
Definition: JetTruthLabelingTool.h:62
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
LargeRJetTruthLabel::other_From_H
@ other_From_H
Definition: LargeRJetLabelEnum.h:28
JetTruthLabelingTool::m_jetContainerName
Gaudi::Property< std::string > m_jetContainerName
Definition: JetTruthLabelingTool.h:48
JetTruthLabelingTool::m_truthSplit23_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_truthSplit23_recoKey
Definition: JetTruthLabelingTool.h:174
JetTruthLabelingTool::m_dR_W_truthKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dR_W_truthKey
Definition: JetTruthLabelingTool.h:159
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
LargeRJetTruthLabel::Zcc
@ Zcc
Definition: LargeRJetLabelEnum.h:19
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
JetTruthLabelingTool::print
void print() const override
Print configured parameters.
Definition: JetTruthLabelingTool.cxx:143
LargeRJetTruthLabel::tqqb
@ tqqb
Definition: LargeRJetLabelEnum.h:16
LargeRJetTruthLabel::enumToInt
int enumToInt(const TypeEnum type)
Definition: LargeRJetLabelEnum.h:34
JetTruthLabelingTool::m_dRTruthPart
double m_dRTruthPart
dR to match truth jet to reco jet
Definition: JetTruthLabelingTool.h:69
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
JetTruthLabelingTool::m_useDRMatch
bool m_useDRMatch
Definition: JetTruthLabelingTool.h:64
xAOD::TruthParticle_v1::pdgId
int pdgId() const
PDG ID code.
SG::DataProxy
Definition: DataProxy.h:44
xAOD::Jet_v1::pt
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition: Jet_v1.cxx:44
JetTruthLabelingTool::m_getTruthGroomedJetValues
bool m_getTruthGroomedJetValues
Use the ungroomed reco jet parent to match to truth jet.
Definition: JetTruthLabelingTool.h:67
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
JetTruthLabelingTool::m_label_truthKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_label_truthKey
Definition: JetTruthLabelingTool.h:158
JetTruthLabelingTool::m_NB_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_NB_recoKey
Definition: JetTruthLabelingTool.h:172
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
JetTruthLabelingTool::labelRecoJets
StatusCode labelRecoJets(DecorHandles &dh, const xAOD::JetContainer &jets, const EventContext &ctx) const
Apply labels to all jets in a container.
Definition: JetTruthLabelingTool.cxx:321
fitman.k
k
Definition: fitman.py:528
JetTruthLabelingTool::m_dRTruthJet
double m_dRTruthJet
When truth jet matching to ungroomed truth, allow saving properties of groomed truth jets.
Definition: JetTruthLabelingTool.h:68