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

#include <PRD_TruthTrajectoryBuilder.h>

Inheritance diagram for Trk::PRD_TruthTrajectoryBuilder:
Collaboration diagram for Trk::PRD_TruthTrajectoryBuilder:

Public Member Functions

 PRD_TruthTrajectoryBuilder (const std::string &t, const std::string &n, const IInterface *p)
 Constructor. More...
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
virtual std::map< HepMC::ConstGenParticlePtr, PRD_TruthTrajectorytruthTrajectories () const override
 return a vector of PrepRawData trajectories - uses internal cache More...
 
virtual StatusCode refreshEvent () override
 Event refresh - can't be an IIncident, because it has to run after PRD creation and PRD truth creation. 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

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

const AtlasDetectorIDm_idHelper
 
ToolHandle< IPRD_Providerm_idPrdProvider {this, "InDetPRD_Provider", ""}
 Helper to detect type of sub-detector from PRD->identify(). More...
 
ToolHandle< IPRD_Providerm_msPrdProvider {this, "MuonPRD_Provider", ""}
 Identifier to PRD relation in the Muons System. More...
 
ToolHandleArray< IPRD_TruthTrajectoryManipulatorm_prdTruthTrajectoryManipulators {this, "PRD_TruthTrajectoryManipulators", {}}
 PRD truth tracjectory manipulators. More...
 
SG::ReadHandleKeyArray< PRD_MultiTruthCollectionm_prdMultiTruthCollectionNames {this,"PRD_MultiTruthCollections",{"PixelClusterTruth","SCT_ClusterTruth","TRT_DriftCircleTruth"}, "PRD multi truth collection names this builder is working on"}
 
std::vector< const PRD_MultiTruthCollection * > m_prdMultiTruthCollections
 the retrieved PRD muli truth collections More...
 
Gaudi::Property< double > m_minPt {this,"MinimumPt",400.,"minimum pT to be even considered"}
 
Gaudi::Property< bool > m_geantinos {this,"Geantinos",false,"Track geantinos or not"}
 
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 45 of file PRD_TruthTrajectoryBuilder.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

◆ PRD_TruthTrajectoryBuilder()

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

Constructor.

Definition at line 21 of file PRD_TruthTrajectoryBuilder.cxx.

21  :
22  AthAlgTool(t,n,p),
23  m_idHelper(nullptr)
24 {
25  declareInterface<Trk::IPRD_TruthTrajectoryBuilder>(this);
26  // the PRD providers that turn Identifier -> IdentiferHash and get the PRD
27 }

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  }

◆ 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

◆ finalize()

StatusCode Trk::PRD_TruthTrajectoryBuilder::finalize ( )
overridevirtual

Definition at line 162 of file PRD_TruthTrajectoryBuilder.cxx.

163 {
164  // clear the cache a last time
166  return StatusCode::SUCCESS;
167 }

◆ initialize()

StatusCode Trk::PRD_TruthTrajectoryBuilder::initialize ( )
overridevirtual

Definition at line 30 of file PRD_TruthTrajectoryBuilder.cxx.

31 {
32 
33  // Set up ATLAS ID helper to be able to identify the PRD's det-subsystem
34  if (detStore()->retrieve(m_idHelper, "AtlasID").isFailure()) {
35  ATH_MSG_ERROR ("Could not get AtlasDetectorID helper. Arborting ...");
36  return StatusCode::FAILURE;
37  }
38  // get the ID PRD Provider
39  if ( !m_idPrdProvider.empty() && m_idPrdProvider.retrieve().isFailure()){
40  ATH_MSG_ERROR ("Could not get " << m_idPrdProvider << ". Arborting ..." );
41  return StatusCode::FAILURE;
42  }
43  // get the Muon System PRD Provider
44  if ( !m_msPrdProvider.empty() && m_msPrdProvider.retrieve().isFailure()){
45  ATH_MSG_ERROR ("Could not get " << m_msPrdProvider << ". Arborting ..." );
46  return StatusCode::FAILURE;
47  }
48  // get the manipulators
49  if ( !m_prdTruthTrajectoryManipulators.empty() && m_prdTruthTrajectoryManipulators.retrieve().isFailure()){
50  ATH_MSG_ERROR ("Could not get configured " << m_prdTruthTrajectoryManipulators << ". Arborting ..." );
51  return StatusCode::FAILURE;
52  }
53 
55 
56  return StatusCode::SUCCESS;
57 }

◆ 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& Trk::IPRD_TruthTrajectoryBuilder::interfaceID ( )
inlinestaticinherited

AlgTool interface methods.

Definition at line 38 of file IPRD_TruthTrajectoryBuilder.h.

38 { return IID_IPRD_TruthTrajectoryBuilder; }

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

◆ refreshEvent()

StatusCode Trk::PRD_TruthTrajectoryBuilder::refreshEvent ( )
overridevirtual

Event refresh - can't be an IIncident, because it has to run after PRD creation and PRD truth creation.

Implements Trk::IPRD_TruthTrajectoryBuilder.

Definition at line 59 of file PRD_TruthTrajectoryBuilder.cxx.

59  {
60 
61  ATH_MSG_INFO("Calling refreshEvent() to reset cache and retrieve collections");
62  // clear the cache & reserve
65  // load the PRD collections from SG
66  for(const auto& pmtCollNameIter:m_prdMultiTruthCollectionNames){
67  // try to retrieve the PRD multi truth collection
68  SG::ReadHandle<PRD_MultiTruthCollection> curColl (pmtCollNameIter);
69  if (!curColl.isValid()){
70  ATH_MSG_WARNING("Could not retrieve " << pmtCollNameIter << ". Ignoring ... ");
71  }
72  else{
73  ATH_MSG_INFO("Added " << pmtCollNameIter << " to collection list for truth track creation.");
74  m_prdMultiTruthCollections.push_back(curColl.cptr());
75  }
76  }
77  // all good
78  return StatusCode::SUCCESS;
79 
80 }

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

◆ truthTrajectories()

std::map< HepMC::ConstGenParticlePtr, Trk::PRD_TruthTrajectory > Trk::PRD_TruthTrajectoryBuilder::truthTrajectories ( ) const
overridevirtual

return a vector of PrepRawData trajectories - uses internal cache

Implements Trk::IPRD_TruthTrajectoryBuilder.

Definition at line 82 of file PRD_TruthTrajectoryBuilder.cxx.

82  {
83  // ndof
84  size_t ndofTotal = 0;
85  size_t ndof = 0;
86 
87  std::map< HepMC::ConstGenParticlePtr, PRD_TruthTrajectory > gpPrdTruthTrajectories;
88 
89  // PART 1 --------------------------------------------------------------------------------------------------------
90  // loop over the PRD_MultiTruthCollection, search for the PRD and create (if necessary and entry in the return map)
91  std::vector<const PRD_MultiTruthCollection*>::const_iterator pmtCollIter = m_prdMultiTruthCollections.begin();
92  std::vector<const PRD_MultiTruthCollection*>::const_iterator pmtCollIterE = m_prdMultiTruthCollections.end();
93  for ( ; pmtCollIter != pmtCollIterE; ++pmtCollIter ){
94  // loop over the map and get the identifier, GenParticle relation
95  PRD_MultiTruthCollection::const_iterator prdMtCIter = (*pmtCollIter)->begin();
96  PRD_MultiTruthCollection::const_iterator prdMtCIterE = (*pmtCollIter)->end();
97  for ( ; prdMtCIter != prdMtCIterE; ++ prdMtCIter ){
98 
99  // check if entry exists and if
100 #ifdef HEPMC3
101  HepMC::ConstGenParticlePtr curGenP = (*prdMtCIter).second.scptr();
102 #else
103 //AV Looks like an implicit conversion
104  HepMC::ConstGenParticlePtr curGenP = (*prdMtCIter).second;
105 #endif
106  Identifier curIdentifier = (*prdMtCIter).first;
107  // apply the min pT cut
108  if ( curGenP->momentum().perp() < m_minPt ) continue;
109  // skip geantinos if required
110  if (!m_geantinos && std::abs(curGenP->pdg_id())==999) continue;
111  // get the associated PRD from the provider
112  const Trk::PrepRawData* prd = m_idHelper->is_indet(curIdentifier) ?
113  m_idPrdProvider->prdFromIdentifier(curIdentifier,ndof) : m_msPrdProvider->prdFromIdentifier(curIdentifier,ndof);
114  // stuff it into the trajectory if you found a PRD
115  if (prd){
116  // try to find the entry for this GenParticle
117  auto prdTrajIter = gpPrdTruthTrajectories.find(curGenP);
118  if ( prdTrajIter == gpPrdTruthTrajectories.end() ){
119  // first PRD associated to this: create PRD_TruthTrajectory object
120  Trk::PRD_TruthTrajectory newPrdTruthTrajectory;
121  newPrdTruthTrajectory.prds.push_back(prd);
122  newPrdTruthTrajectory.nDoF = ndof-5;
123  // register the GenParticle only once
124  newPrdTruthTrajectory.genParticle = curGenP;
125  // fill into map
126  gpPrdTruthTrajectories[curGenP] = newPrdTruthTrajectory;
127  ndofTotal = ndof;
128  } else {
129  // this PRD_TruthTrajectory already exists
130  (prdTrajIter->second).prds.push_back(prd);
131  (prdTrajIter->second).nDoF += ndof;
132  ndofTotal = (prdTrajIter->second).nDoF;
133  }
134  ATH_MSG_DEBUG(" Associating PRD with " << ndof << " degrees of freedom, total N.d.o.F : " << ndofTotal );
135  ATH_MSG_DEBUG(" Associating Identifier " << curIdentifier << " with particle at [ " << curGenP << " ]." );
136  std::string prdtype = m_idHelper->is_pixel(curIdentifier) ? "Pixel" : m_idHelper->is_sct(curIdentifier) ? "SCT" : "TRT";
137  ATH_MSG_DEBUG(" PRD is a " << prdtype);
138  } else {
139  std::string prdtype = m_idHelper->is_pixel(curIdentifier) ? "Pixel" : m_idHelper->is_sct(curIdentifier) ? "SCT" : "TRT";
140  ATH_MSG_DEBUG(" Failed to get " << prdtype << " PRD");
141  }
142  }
143  }
144  // PART 2 --------------------------------------------------------------------------------------------------------
145  // loop through the provided list of manipulators ( sorter is included )
146  auto prdTruthTrajIter = gpPrdTruthTrajectories.begin();
147  auto prdTruthTrajIterE = gpPrdTruthTrajectories.end();
148  for ( ; prdTruthTrajIter != prdTruthTrajIterE; ++prdTruthTrajIter ){
149  if ( !m_prdTruthTrajectoryManipulators.empty() ){
150  ToolHandleArray<IPRD_TruthTrajectoryManipulator>::const_iterator prdTTMIter = m_prdTruthTrajectoryManipulators.begin();
151  ToolHandleArray<IPRD_TruthTrajectoryManipulator>::const_iterator prdTTMIterE = m_prdTruthTrajectoryManipulators.end();
152  for ( ; prdTTMIter != prdTTMIterE; ++prdTTMIter ){
153  if ((*prdTTMIter)->manipulateTruthTrajectory((*prdTruthTrajIter).second))
154  ATH_MSG_DEBUG("PRD truth trajectory got manipulated by: " << (*prdTTMIter).name() );
155  }
156  }
157  }
158  // return the truth trajectories and leave it to the TruthTrack creation to proceed further
159  return gpPrdTruthTrajectories;
160 }

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

Gaudi::Property<bool> Trk::PRD_TruthTrajectoryBuilder::m_geantinos {this,"Geantinos",false,"Track geantinos or not"}
private

Definition at line 73 of file PRD_TruthTrajectoryBuilder.h.

◆ m_idHelper

const AtlasDetectorID* Trk::PRD_TruthTrajectoryBuilder::m_idHelper
private

Definition at line 62 of file PRD_TruthTrajectoryBuilder.h.

◆ m_idPrdProvider

ToolHandle<IPRD_Provider> Trk::PRD_TruthTrajectoryBuilder::m_idPrdProvider {this, "InDetPRD_Provider", ""}
private

Helper to detect type of sub-detector from PRD->identify().

Identifier to PRD relation in the Inner Detector

Definition at line 64 of file PRD_TruthTrajectoryBuilder.h.

◆ m_minPt

Gaudi::Property<double> Trk::PRD_TruthTrajectoryBuilder::m_minPt {this,"MinimumPt",400.,"minimum pT to be even considered"}
private

Definition at line 72 of file PRD_TruthTrajectoryBuilder.h.

◆ m_msPrdProvider

ToolHandle<IPRD_Provider> Trk::PRD_TruthTrajectoryBuilder::m_msPrdProvider {this, "MuonPRD_Provider", ""}
private

Identifier to PRD relation in the Muons System.

Definition at line 65 of file PRD_TruthTrajectoryBuilder.h.

◆ m_prdMultiTruthCollectionNames

SG::ReadHandleKeyArray<PRD_MultiTruthCollection> Trk::PRD_TruthTrajectoryBuilder::m_prdMultiTruthCollectionNames {this,"PRD_MultiTruthCollections",{"PixelClusterTruth","SCT_ClusterTruth","TRT_DriftCircleTruth"}, "PRD multi truth collection names this builder is working on"}
private

Definition at line 69 of file PRD_TruthTrajectoryBuilder.h.

◆ m_prdMultiTruthCollections

std::vector<const PRD_MultiTruthCollection*> Trk::PRD_TruthTrajectoryBuilder::m_prdMultiTruthCollections
private

the retrieved PRD muli truth collections

Definition at line 70 of file PRD_TruthTrajectoryBuilder.h.

◆ m_prdTruthTrajectoryManipulators

ToolHandleArray<IPRD_TruthTrajectoryManipulator> Trk::PRD_TruthTrajectoryBuilder::m_prdTruthTrajectoryManipulators {this, "PRD_TruthTrajectoryManipulators", {}}
private

PRD truth tracjectory manipulators.

Definition at line 67 of file PRD_TruthTrajectoryBuilder.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:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
AtlasDetectorID::is_pixel
bool is_pixel(Identifier id) const
Definition: AtlasDetectorID.h:760
Trk::PRD_TruthTrajectoryBuilder::m_idHelper
const AtlasDetectorID * m_idHelper
Definition: PRD_TruthTrajectoryBuilder.h:62
IDTPM::ndof
float ndof(const U &p)
Definition: TrackParametersHelper.h:134
Trk::PRD_TruthTrajectoryBuilder::m_prdMultiTruthCollectionNames
SG::ReadHandleKeyArray< PRD_MultiTruthCollection > m_prdMultiTruthCollectionNames
Definition: PRD_TruthTrajectoryBuilder.h:69
Trk::PRD_TruthTrajectoryBuilder::m_minPt
Gaudi::Property< double > m_minPt
Definition: PRD_TruthTrajectoryBuilder.h:72
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
AtlasDetectorID::is_sct
bool is_sct(Identifier id) const
Definition: AtlasDetectorID.h:770
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
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
Trk::PRD_TruthTrajectory::genParticle
HepMC::ConstGenParticlePtr genParticle
Definition: PRD_TruthTrajectory.h:31
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Trk::PRD_TruthTrajectoryBuilder::m_prdTruthTrajectoryManipulators
ToolHandleArray< IPRD_TruthTrajectoryManipulator > m_prdTruthTrajectoryManipulators
PRD truth tracjectory manipulators.
Definition: PRD_TruthTrajectoryBuilder.h:67
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
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
Trk::PRD_TruthTrajectoryBuilder::m_prdMultiTruthCollections
std::vector< const PRD_MultiTruthCollection * > m_prdMultiTruthCollections
the retrieved PRD muli truth collections
Definition: PRD_TruthTrajectoryBuilder.h:70
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
Trk::PrepRawData
Definition: PrepRawData.h:62
Trk::PRD_TruthTrajectory
Definition: PRD_TruthTrajectory.h:27
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
AtlasDetectorID::is_indet
bool is_indet(Identifier id) const
Definition: AtlasDetectorID.h:683
Trk::PRD_TruthTrajectory::nDoF
size_t nDoF
Definition: PRD_TruthTrajectory.h:32
Trk::PRD_TruthTrajectoryBuilder::m_idPrdProvider
ToolHandle< IPRD_Provider > m_idPrdProvider
Helper to detect type of sub-detector from PRD->identify().
Definition: PRD_TruthTrajectoryBuilder.h:64
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
Trk::PRD_TruthTrajectoryBuilder::m_geantinos
Gaudi::Property< bool > m_geantinos
Definition: PRD_TruthTrajectoryBuilder.h:73
Trk::PRD_TruthTrajectory::prds
std::vector< const Trk::PrepRawData * > prds
public members
Definition: PRD_TruthTrajectory.h:30
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
Trk::PRD_TruthTrajectoryBuilder::m_msPrdProvider
ToolHandle< IPRD_Provider > m_msPrdProvider
Identifier to PRD relation in the Muons System.
Definition: PRD_TruthTrajectoryBuilder.h:65
Identifier
Definition: IdentifierFieldParser.cxx:14