ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
DerivationFramework::TruthIsolationTool Class Reference

#include <TruthIsolationTool.h>

Inheritance diagram for DerivationFramework::TruthIsolationTool:
Collaboration diagram for DerivationFramework::TruthIsolationTool:

Public Member Functions

 TruthIsolationTool (const std::string &t, const std::string &n, const IInterface *p)
 
 ~TruthIsolationTool ()
 
virtual StatusCode initialize () override
 
virtual StatusCode addBranches () const override
 Pass the thinning service
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
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 AlgTool interface methods. More...
 

Protected Member Functions

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

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

void calcIsos (const xAOD::TruthParticle *particle, const std::vector< const xAOD::TruthParticle * > &, std::vector< float > &) const
 
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...
 

Static Private Member Functions

static float calculateDeltaR2 (const xAOD::IParticle *p1, float eta2, float phi2)
 

Private Attributes

SG::ReadHandleKey< xAOD::TruthParticleContainerm_isoParticlesKey {this, "isoParticlesKey", "TruthParticles", "Name of TruthParticle key for input"}
 Parameter: input collection key. More...
 
SG::ReadHandleKey< xAOD::TruthParticleContainerm_allParticlesKey {this, "allParticlesKey", "TruthParticles", "Name of Truthparticle key to find in iso cone"}
 Parameter: input collection key for particles used in calculation. More...
 
SG::WriteDecorHandleKeyArray< xAOD::TruthParticleContainer, float > m_isoDecorKeys {this, "DoNotSet_isoDecorKeys", {}, "WriteDecorHandleKeyArray - set internally but must be property"}
 Decor handle key array. More...
 
Gaudi::Property< std::vector< float > > m_coneSizes {this, "IsolationConeSizes", {0.2}, "Vector of sizes of dR cone in which to include particles"}
 Parameter: Cone size for Isolation. More...
 
Gaudi::Property< bool > m_chargedOnly {this, "ChargedParticlesOnly", false, "Only keep charged particles in isolation cone"}
 Parameter: only use charged particles for iso? More...
 
Gaudi::Property< std::vector< int > > m_listOfPIDs {this, "particleIDsToCalculate", {11,13,22}, "List of the pdgIDs of particles for which to calculate isolation"}
 Parameter: List of pdgIDs of particles to dress. More...
 
Gaudi::Property< std::vector< int > > m_excludeFromCone {this, "excludeIDsFromCone", {}, "List of the pdgIDs of particles to exclude from the cone when calculating isolation"}
 Parameter: List of pdgIDs to exclude from cone calculation. More...
 
Gaudi::Property< std::string > m_isoVarNamePrefix {this, "IsolationVarNamePrefix", "", "Prefix of name of the variable to add to output xAOD"}
 Parameter: name of output variable. More...
 
Gaudi::Property< bool > m_includeNonInteracting {this, "IncludeNonInteracting", false, "Include non-interacting particles in the isolation definition"}
 Parameter: Include non-interacting particles? More...
 
Gaudi::Property< bool > m_variableR {this, "VariableR", false, "Use radius that shrinks with pT in isolation"}
 Parameter: Use variable radius? More...
 
std::vector< float > m_coneSizesSort
 
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
 

Detailed Description

Definition at line 21 of file DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.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

◆ TruthIsolationTool()

TruthIsolationTool::TruthIsolationTool ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 17 of file DerivationFramework/DerivationFrameworkMCTruth/src/TruthIsolationTool.cxx.

19  :
20  AthAlgTool(t,n,p)
21 {
22  declareInterface<DerivationFramework::IAugmentationTool>(this);
23 }

◆ ~TruthIsolationTool()

TruthIsolationTool::~TruthIsolationTool ( )

Member Function Documentation

◆ addBranches()

StatusCode TruthIsolationTool::addBranches ( ) const
overridevirtual

Pass the thinning service

Even if this is with some dummy value

Implements DerivationFramework::IAugmentationTool.

Definition at line 54 of file DerivationFramework/DerivationFrameworkMCTruth/src/TruthIsolationTool.cxx.

55 {
56  // Event context
57  const EventContext& ctx = Gaudi::Hive::currentContext();
58 
59  // Retrieve the truth collections
61  if (!isoTruthParticles.isValid()) {
62  ATH_MSG_ERROR("Couldn't retrieve collection with name " << m_isoParticlesKey);
63  return StatusCode::FAILURE;
64  }
65 
67  if (!allTruthParticles.isValid()) {
68  ATH_MSG_ERROR("Couldn't retrieve collection with name " << m_allParticlesKey);
69  return StatusCode::FAILURE;
70  }
71 
72  //get struct of helper functions
74 
75  // Isolation is applied to selected particles only
76  std::vector<const xAOD::TruthParticle*> listOfParticlesForIso;
77  decayHelper.constructListOfFinalParticles(isoTruthParticles.ptr(), listOfParticlesForIso, m_listOfPIDs);
78 
79  // Vectors to store particles which will be dressed
80  std::vector<const xAOD::TruthParticle*> candidateParticlesList;
81 
82  std::vector<int> emptyList;
83  //make a list of all candidate particles that could fall inside the cone of the particle of interest from listOfParticlesForIso
84  decayHelper.constructListOfFinalParticles(allTruthParticles.ptr(), candidateParticlesList, emptyList, true, m_chargedOnly);
85 
86  std::vector<SG::WriteDecorHandle< xAOD::TruthParticleContainer, float > >
87  decorator_iso = m_isoDecorKeys.makeHandles (ctx);
88 
89  //All isolation must filled for all Particles.
91  for ( unsigned int icone = 0; icone < m_coneSizesSort.size(); ++icone ) {
92  for (const auto part : *isoTruthParticles) {
93  decorator_iso.at(icone)(*part) = -1;
94  }
95  }
96 
97  // Standard particle loop over final state particles of interest
98  for (const auto& part : listOfParticlesForIso) {
99  std::vector<float> isolationsCalcs(m_coneSizesSort.size(), 0.0);
100  calcIsos(part, candidateParticlesList, isolationsCalcs);
101  for ( unsigned int icone = 0; icone < m_coneSizesSort.size(); ++icone ) {
102  decorator_iso.at(icone)(*part) = isolationsCalcs.at(icone);
103  }
104  }
105 
106  return StatusCode::SUCCESS;
107 }

◆ calcIsos()

void TruthIsolationTool::calcIsos ( const xAOD::TruthParticle particle,
const std::vector< const xAOD::TruthParticle * > &  candidateParticlesList,
std::vector< float > &  isoCalcs 
) const
private

Definition at line 109 of file DerivationFramework/DerivationFrameworkMCTruth/src/TruthIsolationTool.cxx.

112 {
113  //given a bare TruthParticle particle, calculate the isolation(s) using the
114  //particles in candidateParticlesList, filling isoCalcs in order corresponding
115  //to the sorted cone sizes
116 
117  float part_eta = particle->eta();
118  float part_phi = particle->phi();
119  for (const auto& cand_part : candidateParticlesList) {
120  if (find(m_excludeFromCone.begin(), m_excludeFromCone.end(), cand_part->pdgId()) != m_excludeFromCone.end()) {
121  //skip if we find a particle in the exclude list
122  continue;
123  }
124  if (!m_includeNonInteracting && !MC::isInteracting(cand_part->pdgId())){
125  // Do not include non-interacting particles, and this particle is non-interacting
126  continue;
127  }
128  if (HepMC::uniqueID(cand_part) != HepMC::uniqueID(particle)) {
129  //iteration over sorted cone sizes
130  for ( unsigned int icone = 0; icone < m_coneSizesSort.size(); ++icone ) {
131  const float dr2 = calculateDeltaR2(cand_part, part_eta, part_phi);
132  const float coneSize = m_coneSizesSort.at(icone);
133  if (dr2 < coneSize*coneSize &&
134  (!m_variableR || dr2*particle->pt()*particle->pt() < 100000000.)) {
135  //sum the transverse momenta
136  isoCalcs.at(icone) = isoCalcs.at(icone) + cand_part->pt();
137  } else {
138  //break out of the loop safely since the cone sizes are sorted descending
139  break;
140  }
141  }
142  }
143  }
144  return;
145 }

◆ calculateDeltaR2()

float TruthIsolationTool::calculateDeltaR2 ( const xAOD::IParticle p1,
float  eta2,
float  phi2 
)
staticprivate

Definition at line 147 of file DerivationFramework/DerivationFrameworkMCTruth/src/TruthIsolationTool.cxx.

148 {
149  //calculate dR^2 this way to hopefully do fewer sqrt and TVector3::Pseudorapidity calls
150  float phi1 = p1->phi();
151  float eta1 = p1->eta();
152  float deltaPhi = fabs(phi1-phi2);
153  if (deltaPhi>TMath::Pi()) deltaPhi = 2.0*TMath::Pi() - deltaPhi;
154  float deltaPhiSq = deltaPhi * deltaPhi;
155  float deltaEtaSq = (eta1-eta2)*(eta1-eta2);
156  return deltaPhiSq+deltaEtaSq;
157 }

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

◆ 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

◆ initialize()

StatusCode TruthIsolationTool::initialize ( )
overridevirtual

Definition at line 30 of file DerivationFramework/DerivationFrameworkMCTruth/src/TruthIsolationTool.cxx.

31 {
32 
33  // Initialise input keys
36 
37  //sort (descsending) the cone sizes vector to optimize calculation
39  std::sort(m_coneSizesSort.begin(), m_coneSizesSort.end(), [](float a, float b){return a>b;});
40 
41  // Decorations depend on the list of cone sizes
42  for ( auto csize_itr : m_coneSizesSort ) {
43  std::ostringstream sizess;
44  if (m_variableR) sizess << "var";
45  sizess << m_isoVarNamePrefix.value() << (int)((csize_itr)*100.);
46  m_isoDecorKeys.emplace_back(m_isoParticlesKey.key()+"."+sizess.str());
47  }
48  ATH_CHECK(m_isoDecorKeys.initialize());
49 
50  return StatusCode::SUCCESS;
51 }

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

◆ interfaceID()

static const InterfaceID& DerivationFramework::IAugmentationTool::interfaceID ( )
inlinestaticinherited

AlgTool interface methods.

Definition at line 31 of file IAugmentationTool.h.

31 { return IID_IAugmentationTool; }

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

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

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

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

Member Data Documentation

◆ m_allParticlesKey

SG::ReadHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthIsolationTool::m_allParticlesKey {this, "allParticlesKey", "TruthParticles", "Name of Truthparticle key to find in iso cone"}
private

Parameter: input collection key for particles used in calculation.

Definition at line 33 of file DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h.

◆ m_chargedOnly

Gaudi::Property<bool> DerivationFramework::TruthIsolationTool::m_chargedOnly {this, "ChargedParticlesOnly", false, "Only keep charged particles in isolation cone"}
private

Parameter: only use charged particles for iso?

Definition at line 42 of file DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h.

◆ m_coneSizes

Gaudi::Property<std::vector<float> > DerivationFramework::TruthIsolationTool::m_coneSizes {this, "IsolationConeSizes", {0.2}, "Vector of sizes of dR cone in which to include particles"}
private

Parameter: Cone size for Isolation.

Definition at line 39 of file DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h.

◆ m_coneSizesSort

std::vector<float> DerivationFramework::TruthIsolationTool::m_coneSizesSort
private

◆ 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_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_excludeFromCone

Gaudi::Property<std::vector<int> > DerivationFramework::TruthIsolationTool::m_excludeFromCone {this, "excludeIDsFromCone", {}, "List of the pdgIDs of particles to exclude from the cone when calculating isolation"}
private

Parameter: List of pdgIDs to exclude from cone calculation.

Definition at line 48 of file DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h.

◆ m_includeNonInteracting

Gaudi::Property<bool> DerivationFramework::TruthIsolationTool::m_includeNonInteracting {this, "IncludeNonInteracting", false, "Include non-interacting particles in the isolation definition"}
private

Parameter: Include non-interacting particles?

Definition at line 54 of file DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h.

◆ m_isoDecorKeys

SG::WriteDecorHandleKeyArray<xAOD::TruthParticleContainer, float> DerivationFramework::TruthIsolationTool::m_isoDecorKeys {this, "DoNotSet_isoDecorKeys", {}, "WriteDecorHandleKeyArray - set internally but must be property"}
private

◆ m_isoParticlesKey

SG::ReadHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthIsolationTool::m_isoParticlesKey {this, "isoParticlesKey", "TruthParticles", "Name of TruthParticle key for input"}
private

Parameter: input collection key.

Definition at line 30 of file DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h.

◆ m_isoVarNamePrefix

Gaudi::Property<std::string> DerivationFramework::TruthIsolationTool::m_isoVarNamePrefix {this, "IsolationVarNamePrefix", "", "Prefix of name of the variable to add to output xAOD"}
private

Parameter: name of output variable.

Definition at line 51 of file DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h.

◆ m_listOfPIDs

Gaudi::Property<std::vector<int> > DerivationFramework::TruthIsolationTool::m_listOfPIDs {this, "particleIDsToCalculate", {11,13,22}, "List of the pdgIDs of particles for which to calculate isolation"}
private

Parameter: List of pdgIDs of particles to dress.

Definition at line 45 of file DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_variableR

Gaudi::Property<bool> DerivationFramework::TruthIsolationTool::m_variableR {this, "VariableR", false, "Use radius that shrinks with pT in isolation"}
private

◆ 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
DerivationFramework::TruthIsolationTool::m_isoParticlesKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_isoParticlesKey
Parameter: input collection key.
Definition: DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h:31
P4Helpers::deltaEtaSq
double deltaEtaSq(const I4Momentum &p1, const I4Momentum &p2)
Computes efficiently .
Definition: P4Helpers.h:85
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
ParticleGun_SamplingFraction.eta2
eta2
Definition: ParticleGun_SamplingFraction.py:96
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
xAOD::deltaPhi
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
Definition: L2StandAloneMuon_v1.cxx:160
DerivationFramework::TruthIsolationTool::m_isoVarNamePrefix
Gaudi::Property< std::string > m_isoVarNamePrefix
Parameter: name of output variable.
Definition: DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h:52
DerivationFramework::TruthIsolationTool::m_coneSizesSort
std::vector< float > m_coneSizesSort
Definition: DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h:60
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
xAOD::eta1
setEt setPhi setE277 setWeta2 eta1
Definition: TrigEMCluster_v1.cxx:41
DerivationFramework::DecayGraphHelper::constructListOfFinalParticles
bool constructListOfFinalParticles(const xAOD::TruthParticleContainer *allParticles, std::vector< const xAOD::TruthParticle * > &selectedlist, const std::vector< int > &pdgId, bool allowFromHadron=false, bool chargedOnly=false) const
Definition: DecayGraphHelper.h:218
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
DerivationFramework::TruthIsolationTool::m_listOfPIDs
Gaudi::Property< std::vector< int > > m_listOfPIDs
Parameter: List of pdgIDs of particles to dress.
Definition: DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h:46
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
DerivationFramework::TruthIsolationTool::m_chargedOnly
Gaudi::Property< bool > m_chargedOnly
Parameter: only use charged particles for iso?
Definition: DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h:43
DerivationFramework::TruthIsolationTool::calcIsos
void calcIsos(const xAOD::TruthParticle *particle, const std::vector< const xAOD::TruthParticle * > &, std::vector< float > &) const
Definition: DerivationFramework/DerivationFrameworkMCTruth/src/TruthIsolationTool.cxx:109
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
DerivationFramework::TruthIsolationTool::m_allParticlesKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_allParticlesKey
Parameter: input collection key for particles used in calculation.
Definition: DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h:34
beamspotman.n
n
Definition: beamspotman.py:731
DerivationFramework::TruthIsolationTool::m_variableR
Gaudi::Property< bool > m_variableR
Parameter: Use variable radius?
Definition: DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h:58
HepMC::uniqueID
int uniqueID(const T &p)
Definition: MagicNumbers.h:113
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
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
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
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
DerivationFramework::TruthIsolationTool::m_coneSizes
Gaudi::Property< std::vector< float > > m_coneSizes
Parameter: Cone size for Isolation.
Definition: DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h:40
P4Helpers::deltaPhiSq
double deltaPhiSq(const I4Momentum &pA, const I4Momentum &pB)
delta Phi squared in range ([-pi,pi[)^2 from two I4momentum references
Definition: P4Helpers.h:172
DerivationFramework::TruthIsolationTool::m_includeNonInteracting
Gaudi::Property< bool > m_includeNonInteracting
Parameter: Include non-interacting particles?
Definition: DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h:55
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
DerivationFramework::DecayGraphHelper
Definition: DecayGraphHelper.h:26
DerivationFramework::TruthIsolationTool::m_excludeFromCone
Gaudi::Property< std::vector< int > > m_excludeFromCone
Parameter: List of pdgIDs to exclude from cone calculation.
Definition: DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h:49
a
TList * a
Definition: liststreamerinfos.cxx:10
h
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
xAOD::IParticle::eta
virtual double eta() const =0
The pseudorapidity ( ) of the particle.
DerivationFramework::TruthIsolationTool::m_isoDecorKeys
SG::WriteDecorHandleKeyArray< xAOD::TruthParticleContainer, float > m_isoDecorKeys
Decor handle key array.
Definition: DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h:37
DerivationFramework::TruthIsolationTool::calculateDeltaR2
static float calculateDeltaR2(const xAOD::IParticle *p1, float eta2, float phi2)
Definition: DerivationFramework/DerivationFrameworkMCTruth/src/TruthIsolationTool.cxx:147
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
MC::isInteracting
bool isInteracting(const T &p)
Identify if the particle with given PDG ID would not interact with the detector, i....
Definition: HepMCHelpers.h:23
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
xAOD::IParticle::phi
virtual double phi() const =0
The azimuthal angle ( ) of the particle.
xAOD::Iso::coneSize
float coneSize(IsolationConeSize type)
convert Isolation Size into cone size
Definition: IsolationHelpers.h:27
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528