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

Algorithm to convert PRD multi truth maps into a track collection. More...

#include <TruthTrackCreation.h>

Inheritance diagram for Trk::TruthTrackCreation:
Collaboration diagram for Trk::TruthTrackCreation:

Public Member Functions

 TruthTrackCreation (const std::string &name, ISvcLocator *pSvcLocator)
 Standard Athena-Algorithm Constructor. More...
 
 ~TruthTrackCreation ()
 Default Destructor. More...
 
StatusCode initialize ()
 standard Athena-Algorithm method More...
 
StatusCode execute ()
 standard Athena-Algorithm method More...
 
StatusCode finalize ()
 standard Athena-Algorithm method More...
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. 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 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
 

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

SG::WriteHandleKey< TrackCollectionm_outputTrackCollectionName {this, "OutputTrackCollection", "TruthTracks", "Output Truth Track Collection"}
 
SG::WriteHandleKey< TrackCollectionm_skippedTrackCollectionName {this, "OutputSkippedTrackCollection", "SkippedTruthTracks", "Output Skipped Truth Track Collection"}
 
ToolHandle< Trk::IPRD_TruthTrajectoryBuilderm_prdTruthTrajectoryBuilder
 truth tools More...
 
ToolHandle< Trk::ITruthTrackBuilderm_truthTrackBuilder
 truth tools More...
 
ToolHandleArray< Trk::IPRD_TruthTrajectorySelectorm_prdTruthTrajectorySelectors
 PRD truth trajectory selectors. More...
 
ToolHandleArray< Trk::ITrackSelectorToolm_trackSelectors
 track selectors for a posteriory track selection More...
 
ToolHandle< Trk::IPRDtoTrackMapToolm_assoTool {this, "AssociationTool", "InDet::InDetPRDtoTrackMapToolGangedPixels" }
 
ToolHandle< Trk::IExtendedTrackSummaryToolm_trackSummaryTool
 summary tool for completing the track More...
 
DataObjIDColl m_extendedExtraObjects
 
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

Algorithm to convert PRD multi truth maps into a track collection.

Algorithm to convert PRD multi truth maps into a track collection, basic cuts on the prdTruthTrajectory can be applied. Additionally a track selector can be used a posteriory to mimic some efficiency effects.

Author
Andreas Salzburger Andre.nosp@m.as.S.nosp@m.alzbu.nosp@m.rger.nosp@m.@cern.nosp@m..ch

Definition at line 47 of file TruthTrackCreation.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TruthTrackCreation()

Trk::TruthTrackCreation::TruthTrackCreation ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Standard Athena-Algorithm Constructor.

Definition at line 22 of file TruthTrackCreation.cxx.

23  :
24  AthAlgorithm(name,pSvcLocator),
25  m_prdTruthTrajectoryBuilder("Trk::PRD_TruthTrajectoryBuilder/InDetPRD_TruthTrajectoryBuilder"),
26  m_truthTrackBuilder("Trk::TruthTrackBuilder/InDetTruthTrackBuilder"),
28 {
29  // Trk Truth Tools
30  declareProperty("PRD_TruthTrajectoryBuilder", m_prdTruthTrajectoryBuilder, "Truth Trajectory Builder Tool");
31  declareProperty("TruthTrackBuilder", m_truthTrackBuilder, "Truth Track Builder Tool");
32  declareProperty("PRD_TruthTrajectorySelectors", m_prdTruthTrajectorySelectors, "PRD truth trajectory selectors");
33  // Trk Tools
34  declareProperty("TrackSelectors", m_trackSelectors, "Track selectors for a posteriori track selection");
35  declareProperty("TrackSummaryTool", m_trackSummaryTool, "Summary tool for completing the track with its summary info");
36 }

◆ ~TruthTrackCreation()

Trk::TruthTrackCreation::~TruthTrackCreation ( )
default

Default Destructor.

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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; }

◆ execute()

StatusCode Trk::TruthTrackCreation::execute ( )

standard Athena-Algorithm method

Definition at line 92 of file TruthTrackCreation.cxx.

93 {
94  std::unique_ptr<Trk::PRDtoTrackMap> prd_to_track_map(!m_assoTool.empty()
95  ? m_assoTool->createPRDtoTrackMap()
96  : std::unique_ptr<Trk::PRDtoTrackMap>());
97  // create the track collection
98  std::unique_ptr<TrackCollection> outputTrackCollection = std::make_unique<TrackCollection>();
99  std::unique_ptr<TrackCollection> skippedTrackCollection = std::make_unique<TrackCollection>();
102 
103  std::vector<std::unique_ptr<Trk::Track> > tmp_track_collection;
104 
105  // set up the PRD trajectory builder
106  if ( m_prdTruthTrajectoryBuilder->refreshEvent().isFailure() ){
107  ATH_MSG_INFO("Could not refresh the PRD truth trajectory builder. No truth track creation.");
108  return StatusCode::SUCCESS;
109  }
110 
111  // ----------------------------------- main loop ------------------------------------------------------------------
112  // get the PRD truth trajectories
113  const std::map< HepMC::ConstGenParticlePtr, PRD_TruthTrajectory >& truthTraj =
114  m_prdTruthTrajectoryBuilder->truthTrajectories();
115  // some screen output
116  ATH_MSG_VERBOSE("PRD_TruthTrajectoryBuilder delivered " << truthTraj.size() << " PRD truth trajectories, starting track creation.");
117  // loop over truth trajectories and create track
118  auto ttIter = truthTraj.begin();
119  auto ttIterE = truthTraj.end();
120  for ( ; ttIter != ttIterE; ++ttIter){
121  // run through the selector chain
122  if (!m_prdTruthTrajectorySelectors.empty()){
123  ToolHandleArray<Trk::IPRD_TruthTrajectorySelector>::const_iterator prdTTSelIter = m_prdTruthTrajectorySelectors.begin();
124  ToolHandleArray<Trk::IPRD_TruthTrajectorySelector>::const_iterator prdTTSelIterE = m_prdTruthTrajectorySelectors.end();
125  bool passed = true;
126  for ( ; prdTTSelIter != prdTTSelIterE && passed; ++prdTTSelIter ){
127  if (!(*prdTTSelIter)->pass((*ttIter).second)){
128  ATH_MSG_VERBOSE("PRD truth trajectory did not pass the selection cuts. Skipping ... ");
129  passed = false;
130  }
131  }
132  // the consequence of the selection loop
133  if (!passed) continue;
134  }
135  // create the truth track
136  std::unique_ptr<Trk::Track> truthTrack( m_truthTrackBuilder->createTrack(ttIter->second));
137  if (!truthTrack){
138  ATH_MSG_VERBOSE("Track creation for PRD truth trajectory with size " << (*ttIter).second.prds.size() << " failed. Skipping ...");
139  continue;
140  }
141  ATH_MSG_VERBOSE("Track creation for PRD truth trajectory with size " << (*ttIter).second.prds.size() << " successful.");
142  // If configured : update the track summary
143  if (m_trackSummaryTool.isEnabled()){
144  ATH_MSG_VERBOSE("Updating the TrackSummary.");
145  m_trackSummaryTool->computeAndReplaceTrackSummary(*truthTrack,
146  false /* DO NOT suppress hole search*/);
147 
148  }
149  // If configured : check with the TrackSelectors
150  bool passed = m_trackSelectors.empty();
151  if ( !m_trackSelectors.empty() ) {
154  for ( ; ( tsIter != tsIterE && !passed ); ++tsIter){
155  passed = (*tsIter)->decision(*truthTrack);
156  }
157  }
158  // now check the result
159  if (passed){
160  // everything good
161  ATH_MSG_VERBOSE("Track created and pushed into the output track collection.");
162  if (prd_to_track_map && m_assoTool->addPRDs(*prd_to_track_map, *truthTrack).isFailure()) {
163  ATH_MSG_WARNING("Failed to add PRDs to map");
164  }
165  tmp_track_collection.push_back(std::move(truthTrack));
166  } else {
167  ATH_MSG_VERBOSE("Track did not pass the track selection. Putting it into skipped track collection.");
168  skippedTrackCollection->push_back(truthTrack.release());
169  }
170  }
171 
172  // If configured : update the track summary
173  if (m_trackSummaryTool.isEnabled()) {
174  outputTrackCollection->reserve(tmp_track_collection.size());
175  for (std::unique_ptr<Trk::Track> &track : tmp_track_collection) {
176  ATH_MSG_VERBOSE("Updating the TrackSummary with shared hits.");
177  m_trackSummaryTool->computeAndReplaceTrackSummary(*track, false /* DO NOT suppress hole search*/);
178  outputTrackCollection->push_back(std::move(track));
179  }
180  }
181  else {
182  outputTrackCollection->reserve(tmp_track_collection.size());
183  for (std::unique_ptr<Trk::Track> &track : tmp_track_collection) {
184  outputTrackCollection->push_back(std::move(track));
185  }
186  }
187 
188  // ----------------------------------- record & cleanup ---------------------------------------------------------------
189 
190  ATH_CHECK(outputTrackCollectionHandle.record(std::move(outputTrackCollection)));
191 
192  ATH_MSG_VERBOSE("Truth TrackCollection with name " << m_outputTrackCollectionName << " and size " << outputTrackCollectionHandle->size() << " recorded.");
193 
194  ATH_CHECK(skippedTrackCollectionHandle.record(std::move(skippedTrackCollection)));
195 
196  ATH_MSG_VERBOSE("Truth TrackCollection with name " << m_skippedTrackCollectionName << " and size " << skippedTrackCollectionHandle->size() << " recorded.");
197 
198  // job done
199  return StatusCode::SUCCESS;
200 }

◆ extraDeps_update_handler()

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

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ finalize()

StatusCode Trk::TruthTrackCreation::finalize ( )

standard Athena-Algorithm method

Definition at line 84 of file TruthTrackCreation.cxx.

85 {
86  // Code entered here will be executed once at the end of the program run.
87  return StatusCode::SUCCESS;
88 }

◆ initialize()

StatusCode Trk::TruthTrackCreation::initialize ( )

standard Athena-Algorithm method

Definition at line 46 of file TruthTrackCreation.cxx.

47 {
48  // trajectory creator
49  if (m_prdTruthTrajectoryBuilder.retrieve().isFailure()){
50  ATH_MSG_ERROR("Could not retrieve " << m_prdTruthTrajectoryBuilder << ". Aborting ...");
51  return StatusCode::FAILURE;
52  }
53  // truth track builder
54  if (m_truthTrackBuilder.retrieve().isFailure()){
55  ATH_MSG_ERROR("Could not retrieve " << m_truthTrackBuilder << ". Aborting ...");
56  return StatusCode::FAILURE;
57  }
58  // PRD truth trajectory selectors
59  if (!m_prdTruthTrajectorySelectors.empty() && m_prdTruthTrajectorySelectors.retrieve().isFailure()){
60  ATH_MSG_ERROR("Could not retrieve " << m_prdTruthTrajectorySelectors << ". Aborting ...");
61  return StatusCode::FAILURE;
62  }
63  ATH_CHECK( m_assoTool.retrieve( DisableTool {m_assoTool.empty()} ));
64 
65  // track summary tool if configured
66  if (!m_trackSummaryTool.empty() && m_trackSummaryTool.retrieve().isFailure()){
67  ATH_MSG_ERROR("Could not retrieve " << m_trackSummaryTool << ". Aborting ...");
68  return StatusCode::FAILURE;
69  }
70  // track selector if configured
71  if (!m_trackSelectors.empty() && m_trackSelectors.retrieve().isFailure()){
72  ATH_MSG_ERROR("Could not retrieve " << m_trackSelectors << ". Aborting ...");
73  return StatusCode::FAILURE;
74  }
75 
76  ATH_CHECK( m_outputTrackCollectionName.initialize() );
78 
79  return StatusCode::SUCCESS;
80 }

◆ inputHandles()

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

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::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< Algorithm >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::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< Algorithm > >::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_assoTool

ToolHandle<Trk::IPRDtoTrackMapTool> Trk::TruthTrackCreation::m_assoTool {this, "AssociationTool", "InDet::InDetPRDtoTrackMapToolGangedPixels" }
private

Definition at line 73 of file TruthTrackCreation.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_outputTrackCollectionName

SG::WriteHandleKey<TrackCollection> Trk::TruthTrackCreation::m_outputTrackCollectionName {this, "OutputTrackCollection", "TruthTracks", "Output Truth Track Collection"}
private

Definition at line 65 of file TruthTrackCreation.h.

◆ m_prdTruthTrajectoryBuilder

ToolHandle<Trk::IPRD_TruthTrajectoryBuilder> Trk::TruthTrackCreation::m_prdTruthTrajectoryBuilder
private

truth tools

Definition at line 68 of file TruthTrackCreation.h.

◆ m_prdTruthTrajectorySelectors

ToolHandleArray<Trk::IPRD_TruthTrajectorySelector> Trk::TruthTrackCreation::m_prdTruthTrajectorySelectors
private

PRD truth trajectory selectors.

Definition at line 71 of file TruthTrackCreation.h.

◆ m_skippedTrackCollectionName

SG::WriteHandleKey<TrackCollection> Trk::TruthTrackCreation::m_skippedTrackCollectionName {this, "OutputSkippedTrackCollection", "SkippedTruthTracks", "Output Skipped Truth Track Collection"}
private

Definition at line 66 of file TruthTrackCreation.h.

◆ m_trackSelectors

ToolHandleArray<Trk::ITrackSelectorTool> Trk::TruthTrackCreation::m_trackSelectors
private

track selectors for a posteriory track selection

Definition at line 72 of file TruthTrackCreation.h.

◆ m_trackSummaryTool

ToolHandle<Trk::IExtendedTrackSummaryTool> Trk::TruthTrackCreation::m_trackSummaryTool
private

summary tool for completing the track

Definition at line 76 of file TruthTrackCreation.h.

◆ m_truthTrackBuilder

ToolHandle<Trk::ITruthTrackBuilder> Trk::TruthTrackCreation::m_truthTrackBuilder
private

truth tools

Definition at line 69 of file TruthTrackCreation.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
DataVector::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
Trk::TruthTrackCreation::m_outputTrackCollectionName
SG::WriteHandleKey< TrackCollection > m_outputTrackCollectionName
Definition: TruthTrackCreation.h:65
TrigCompositeUtils::passed
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
Definition: TrigCompositeUtilsRoot.cxx:117
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Trk::TruthTrackCreation::m_trackSummaryTool
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trackSummaryTool
summary tool for completing the track
Definition: TruthTrackCreation.h:76
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Trk::TruthTrackCreation::m_skippedTrackCollectionName
SG::WriteHandleKey< TrackCollection > m_skippedTrackCollectionName
Definition: TruthTrackCreation.h:66
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
Trk::TruthTrackCreation::m_truthTrackBuilder
ToolHandle< Trk::ITruthTrackBuilder > m_truthTrackBuilder
truth tools
Definition: TruthTrackCreation.h:69
Trk::TruthTrackCreation::m_prdTruthTrajectoryBuilder
ToolHandle< Trk::IPRD_TruthTrajectoryBuilder > m_prdTruthTrajectoryBuilder
truth tools
Definition: TruthTrackCreation.h:68
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
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
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Trk::TruthTrackCreation::m_prdTruthTrajectorySelectors
ToolHandleArray< Trk::IPRD_TruthTrajectorySelector > m_prdTruthTrajectorySelectors
PRD truth trajectory selectors.
Definition: TruthTrackCreation.h:71
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
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
Trk::TruthTrackCreation::m_assoTool
ToolHandle< Trk::IPRDtoTrackMapTool > m_assoTool
Definition: TruthTrackCreation.h:74
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Trk::TruthTrackCreation::m_trackSelectors
ToolHandleArray< Trk::ITrackSelectorTool > m_trackSelectors
track selectors for a posteriory track selection
Definition: TruthTrackCreation.h:72
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >