ATLAS Offline Software
TrackParticleCnvAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // $Id: TrackParticleCnvAlg.cxx 298303 2013-12-05 08:41:30Z emoyse $
6 
7 // Gaudi/Athena include(s):
9 
10 // EDM include(s):
11 
14 
18 
19 
20 // Local include(s):
21 #include "TrackParticleCnvAlg.h"
22 
23 
24 
25 namespace xAODMaker {
27  ISvcLocator* svcLoc)
28  : AthReentrantAlgorithm(name, svcLoc) {}
29 
32 {
33 
34  ATH_MSG_DEBUG("Initializing TrackParticleCnvAlg");
35  ATH_MSG_DEBUG("AODContainerName = " << m_aod.key());
36  ATH_MSG_DEBUG("xAODContainerName = " << m_xaodTrackParticlesout.key());
37  ATH_CHECK(m_particleCreator.retrieve());
38  if (m_addTruthLink)
39  ATH_CHECK(m_truthClassifier.retrieve());
40  else
41  m_truthClassifier.disable();
42  ATH_CHECK(m_TrackCollectionCnvTool.retrieve(DisableTool{ !m_convertTracks }));
44  DisableTool{ !m_convertAODTrackParticles }));
45  // to preserve the inisialised parameters of the ParticleCreatorTool:
46  ATH_MSG_DEBUG("Overriding particle creator tool settings.");
47  if (m_convertTracks)
48  ATH_CHECK(
49  m_TrackCollectionCnvTool->setParticleCreatorTool(&m_particleCreator));
51  ATH_CHECK(m_RecTrackParticleContainerCnvTool->setParticleCreatorTool(
53 
57  ATH_CHECK(m_tracks.initialize(m_convertTracks));
60  ATH_CHECK(
63  if (m_addTruthLink) {
64  const std::string container_key = m_convertTracks ? m_xaodout.key() : m_xaodTrackParticlesout.key();
65  m_xaodTruthOriginKey = container_key+".truthOrigin";
66  m_xaodTruthTypeKey = container_key+".truthType";
67  m_xaodTruthLinkKey = container_key+".truthParticleLink";
68  m_xaodTruthMatchProbKey = container_key+".truthMatchProbability";
69  }
70  const bool init_truthKey = m_addTruthLink;
71  ATH_CHECK(m_xaodTruthOriginKey.initialize(init_truthKey && !m_truthClassifier.empty()));
72  ATH_CHECK(m_xaodTruthTypeKey.initialize(init_truthKey && !m_truthClassifier.empty()));
73  ATH_CHECK(m_xaodTruthLinkKey.initialize(init_truthKey));
75 
76  // Retrieve monitoring tools if provided
77  ATH_CHECK(m_trackMonitoringTool.retrieve(DisableTool{ !m_doMonitoring }));
78  ATH_CHECK(m_monTool.retrieve(DisableTool{ !m_doMonitoring }));
79 
81 
82  // Return gracefully:
83  return StatusCode::SUCCESS;
84 }
85 
87 TrackParticleCnvAlg::execute(const EventContext& ctx) const
88 {
89 
90  const Rec::TrackParticleContainer* aod = nullptr;
91  const TrackCollection* tracks = nullptr;
92  const xAODTruthParticleLinkVector* truthLinks = nullptr;
93  const TrackParticleTruthCollection* aodTruth = nullptr;
94  const TrackTruthCollection* trackTruth = nullptr;
95  const ObservedTrackMap* tracksMap = nullptr;
96  const xAOD::Vertex* primaryVertex = nullptr;
97 
98  //timer object for total execution time
99  auto mnt_timer_Total = Monitored::Timer<std::chrono::milliseconds>("TIME_Total");
100 
101  // Retrieve the AOD particles:
104  if (!rh_aod.isValid()) {
105  ATH_MSG_ERROR(m_aod.key() << " not found");
106  return StatusCode::FAILURE;
107  } else {
108  aod = rh_aod.cptr();
109  ATH_MSG_VERBOSE("Got TrackParticleContainer with key " << m_aod.key()
110  << " found.");
111  }
112  }
113  // Retrieve the Tracks:
114  if (m_convertTracks) {
116  if (!rh_tracks.isValid()) {
117  ATH_MSG_ERROR(m_tracks.key() << " not found");
118  return StatusCode::SUCCESS;
119  } else {
120  tracks = rh_tracks.cptr();
121  ATH_MSG_VERBOSE("Got TrackCollection with key " << m_tracks.key()
122  << " found.");
123 
124  }
125  }
126  if (m_addTruthLink) {
129  if (!rh_aodTruth.isValid()) {
130  ATH_MSG_WARNING("No TrackParticleTruthCollection with key "
131  << m_aodTruth.key() << " found. Do nothing.");
132  return StatusCode::SUCCESS;
133  } else
134  aodTruth = rh_aodTruth.cptr();
135  }
136  if (m_convertTracks) {
138  if (!rh_trackTruth.isValid()) {
139  ATH_MSG_WARNING("No DetailedTrackTruthCollection with key "
140  << m_trackTruth.key() << " found. Do nothing.");
141  return StatusCode::SUCCESS;
142  } else
143  trackTruth = rh_trackTruth.cptr();
144  }
145 
146  SG::ReadHandle<xAODTruthParticleLinkVector> rh_truthParticleLinkVec(
148  if (!rh_truthParticleLinkVec.isValid()) {
149  ATH_MSG_WARNING("No xAODTruthParticleLinkVector with key "
150  << m_truthParticleLinkVec.key() << " found. Do nothing.");
151  return StatusCode::SUCCESS;
152  } else
153  truthLinks = rh_truthParticleLinkVec.cptr();
154  }
155 
156  if(!m_primaryVertexContainer.key().empty())
157  {
159  if (!vtx_container.isValid()) {
160  ATH_MSG_WARNING("No xAOD::VertexContainer with key "<< m_primaryVertexContainer.key() << " found. Do nothing.");
161  return StatusCode::SUCCESS;
162  }
163  const xAOD::Vertex* dummyVertex = nullptr;
164  for(auto vtx : *vtx_container) {
165  if(vtx->vertexType()==xAOD::VxType::PriVtx) {
166  primaryVertex = vtx;
167  break;
168  }
169  if(vtx->vertexType()==xAOD::VxType::NoVtx) {
170  // in case of no primary vertex
171  dummyVertex = vtx;
172  }
173  }
174  if(!primaryVertex)
175  {
176  if(dummyVertex)
177  {
178  ATH_MSG_INFO("No primary vertex found, will use dummy vertex at "<<dummyVertex->x()<<","<<dummyVertex->y()<<","<<dummyVertex->z());
179  primaryVertex=dummyVertex;
180  }
181  else
182  {
183  ATH_MSG_WARNING("Neither primary nor dummy vertex found. Do Nothing.");
184  return StatusCode::SUCCESS;
185  }
186  }
187  }
188 
189  if (m_convertTracks) {
191  ATH_CHECK(
192  wh_xaodout.record(std::make_unique<xAOD::TrackParticleContainer>(),
193  std::make_unique<xAOD::TrackParticleAuxContainer>()));
194 
195  // Augment track particles with information from observer tool
198  if (!rh_tracksMap.isValid()) {
199  ATH_MSG_ERROR(m_tracksMap.key() << " not found");
200  return StatusCode::FAILURE;
201  }
202  else {
203  tracksMap = rh_tracksMap.cptr();
204  ATH_MSG_VERBOSE("Got ObservedTrackMap with key " << m_tracksMap.key()
205  << " found.");
206  }
207 
208  convert(
209  (*tracks), trackTruth, m_TrackCollectionCnvTool, wh_xaodout, truthLinks, primaryVertex, tracksMap);
210  }
211  else{
212  convert(
213  (*tracks), trackTruth, m_TrackCollectionCnvTool, wh_xaodout, truthLinks, primaryVertex);
214  }
215  // Monitor track parameters
216  if (m_doMonitoring)
217  m_trackMonitoringTool->monitor_tracks("Track", "Pass", *wh_xaodout);
218  }
220  SG::WriteHandle<xAOD::TrackParticleContainer> wh_xaodTrackParticlesout(
222  ATH_CHECK(wh_xaodTrackParticlesout.record(
223  std::make_unique<xAOD::TrackParticleContainer>(),
224  std::make_unique<xAOD::TrackParticleAuxContainer>()));
225  convert((*aod),
226  aodTruth,
228  wh_xaodTrackParticlesout,
229  truthLinks);
230  }
231 
232  //extra scope needed to trigger the monitoring
233  {auto monTime = Monitored::Group(m_monTool, mnt_timer_Total);}
234 
235  return StatusCode::SUCCESS;
236 }
237 
238 template<typename CONT>
240 
241 template<>
243 {
244 public:
246  const Trk::Track* operator()(xAOD::TrackParticle* track_particle,
247  unsigned int) const
248  {
249  return track_particle->track();
250  }
251 };
252 
253 template<>
255 {
256 public:
258  xAOD::TrackParticleContainer* cont_dest)
259  : m_contSrc(&cont_src)
260  {
261  if (cont_src.size() != cont_dest->size()) {
262  std::stringstream message;
263  message << __FILE__ << ":" << __LINE__
264  << " Expected one-to-one conversion from AOD to xAOD "
265  "TrackParticles but sizes differ: "
266  << cont_src.size() << " != " << cont_dest->size();
267  throw std::runtime_error(message.str());
268  }
269  }
270 
272  unsigned int idx) const
273  {
274  return m_contSrc->at(idx);
275  }
276 
277 private:
279 };
280 
281 template<typename CONT, typename TRUTHCONT, typename CONVTOOL>
282 int
284  const CONT& container,
285  const TRUTHCONT& truth,
286  CONVTOOL& conv_tool,
288  const xAODTruthParticleLinkVector* truthLinkVec,
289  const xAOD::Vertex* primaryVertex,
290  const ObservedTrackMap* obs_track_map /*=0*/) const
291 {
292  // Create the xAOD container and its auxiliary store:
293 
294  // convert the track containers separately with the converting tools that are
295  // also used by TrigHLTtoxAODTool
296  ATH_MSG_DEBUG("calling the converting tool for " << xaod.name());
297  // Augment track particles using track map if available
298  if (obs_track_map){
299  if (conv_tool->convertAndAugment(&container, xaod.ptr(), obs_track_map, primaryVertex).isFailure()) {
300  ATH_MSG_ERROR("Couldn't convert and augment aod to xaod ("
301  << xaod.name() << ") with the converting tool");
302  return -1;
303  }
304  }
305  else{
306  if (conv_tool->convert(&container, xaod.ptr(), primaryVertex).isFailure()) {
307  ATH_MSG_ERROR("Couldn't convert aod to xaod ("
308  << xaod.name() << ") with the converting tool");
309  return -1;
310  }
311  }
312  // Create the xAOD objects:
314  xAOD::TrackParticleContainer::iterator end_xaod = xaod->end();
315 
316  AssociationHelper<CONT> association_to_src(container, xaod.ptr());
317  unsigned int trackCounter(0);
318  // loop over AOD and converted xAOD for summary info and truth links
319  for (; itr_xaod != end_xaod; ++itr_xaod) {
320  // protect if something went wrong and there is no converted xaod equivalent
321 
322  if (!(*itr_xaod)) {
323  ATH_MSG_WARNING("Empty element in xAOD container!");
324  continue;
325  }
326 
327  xAOD::TrackParticle* particle = *itr_xaod;
328 
329  if (!particle) {
330  ATH_MSG_WARNING("Failed to get an xAOD::TrackParticle");
331  continue;
332  }
333 
334  trackCounter++;
335  if(msgLvl(MSG::DEBUG)){
336  int npix, nsct, ntrt, npixh, nscth, npixshim, npixsplit;
337  npix = nsct = ntrt = npixh = nscth = npixshim = npixsplit = -1;
338  const Trk::Track *tr = particle->track();
339  if (tr){
340  const Trk::TrackSummary *ts = tr->trackSummary();
341  if (ts){
342  npix = ts->get(Trk::numberOfPixelHits);
343  nsct = ts->get(Trk::numberOfSCTHits);
344  ntrt = ts->get(Trk::numberOfTRTHits);
345  nscth= ts->get(Trk::numberOfSCTHoles);
346  npixh= ts->get(Trk::numberOfPixelHoles);
347  }
348  }
349  msg() << MSG::DEBUG << "REGTEST: " << std::setw(5) << trackCounter
350  << " pT: " << std::setw(10) << particle->pt()
351  << " eta: " << particle->eta()
352  << " phi: " << particle->phi()
353  << " d0: " << particle->d0()
354  << " z0: " << particle->z0()
355  << "\t" << npix << "/" << nsct << "/" << ntrt << "/holes/" << npixh << "/" << nscth
356  << endmsg;
357 
358  }
359 
360 
361  //
362  // --------- statistics
363  //
364 
365  if (m_addTruthLink) {
366  MCTruthPartClassifier::ParticleType type = MCTruthPartClassifier::Unknown;
369  float probability = -1.0;
371 
372  ElementLink<CONT> tpLink(
373  association_to_src(*itr_xaod, itr_xaod - xaod->begin()), container);
374  if (!tpLink.isValid()) {
375  ATH_MSG_WARNING("Failed to create ElementLink to Track/TrackParticle");
376  } else if(truth->empty()){
377  // This can happen if there is no HS track
378  ATH_MSG_DEBUG("No truth available");
379  } else {
380  auto result = truth->find(tpLink);
381  if (result == truth->end()) {
383  "Failed find truth associated with Track/TrackParticle");
384  } else {
385  // setTruthLink(link,result->second, type, origin);
386  ATH_MSG_VERBOSE("Found track Truth: uniqueID "
387  << HepMC::uniqueID(result->second.particleLink()) << " evt "
388  << result->second.particleLink().eventIndex());
389  probability = result->second.probability();
390  link = truthLinkVec->find(result->second.particleLink());
391  if (link.isValid()) {
392  ATH_MSG_DEBUG("Found matching xAOD Truth: uniqueID "
393  << HepMC::uniqueID(*link) << " pt " << (*link)->pt()
394  << " eta " << (*link)->eta() << " phi "
395  << (*link)->phi());
396  // if configured also get truth classification
397  if (result->second.particleLink().cptr() &&
398  !m_truthClassifier.empty()) {
399  auto truthClass = m_truthClassifier->particleTruthClassifier(
400  result->second.particleLink());
401  type = truthClass.first;
402  origin = truthClass.second;
403  ATH_MSG_VERBOSE("Got truth type " << static_cast<int>(type)
404  << " origin "
405  << static_cast<int>(origin));
406  }
407  } else {
408  if (HepMC::uniqueID(result->second.particleLink()) > 0) {
409  ATH_MSG_WARNING("No associated xAOD truth for valid truth link "
410  << result->second.particleLink());
411  }
412  }
413  }
414  }
415  static const SG::AuxElement::Accessor<
417  theLink("truthParticleLink");
418  static const SG::AuxElement::Accessor<float> theProbability(
419  "truthMatchProbability");
420  theLink(*particle) = link;
421  theProbability(*particle) = probability;
422  if (!m_truthClassifier.empty()) {
423  static const SG::AuxElement::Accessor<int> theType("truthType");
424  static const SG::AuxElement::Accessor<int> theOrigin("truthOrigin");
425  theType(*particle) = static_cast<int>(type);
426  theOrigin(*particle) = static_cast<int>(origin);
427  }
428  }
429  } // loop over aod tracks
430 
431  ATH_MSG_DEBUG("Converted [" << container.size() << " -> " << xaod->size()
432  << "] TrackParticles and stored in "
433  << xaod.name());
434  if (container.size() != xaod->size()) {
435  ATH_MSG_WARNING("number of items in the AOD container: "
436  << container.size()
437  << " is not equal to the number of items in its converted "
438  "xAOD equivalent: "
439  << xaod->size());
440  }
441 
442  return 1;
443 }
444 
449  const Rec::TrackParticle& tp)
450 {
451  // create the xAOD::TrackParticle, the pointer is added to the container in
452  // the function
453  xAOD::TrackParticle* xp = m_particleCreator->createParticle(tp, &xaod);
454  return xp;
455 } // createParticleAndTruth
456 
459  const TrackCollection& container,
460  const Trk::Track& tp,
461  const EventContext& ctx)
462 {
463  // create the xAOD::TrackParticle, the pointer is added to the container in
464  // the function
465  ElementLink<TrackCollection> trackLink(&tp, container,ctx);
466  return m_particleCreator->createParticle(trackLink, &xaod);
467 }
468 
469 } // namespace xAODMaker
Trk::numberOfPixelHits
@ numberOfPixelHits
number of pixel layers on track with absence of hits
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:57
xAOD::Vertex_v1::x
float x() const
Returns the x position.
xAODMaker::TrackParticleCnvAlg::m_xaodTruthLinkKey
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_xaodTruthLinkKey
Definition: TrackParticleCnvAlg.h:100
xAODMaker::TrackParticleCnvAlg::m_xaodTruthOriginKey
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_xaodTruthOriginKey
Definition: TrackParticleCnvAlg.h:98
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
xAODMaker::TrackParticleCnvAlg::m_trackMonitoringTool
ToolHandle< ITrackParticleMonitoring > m_trackMonitoringTool
Definition: TrackParticleCnvAlg.h:110
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
get_generator_info.result
result
Definition: get_generator_info.py:21
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
xAODMaker::TrackParticleCnvAlg::initialize
virtual StatusCode initialize()
Function initialising the algorithm.
Definition: TrackParticleCnvAlg.cxx:31
AthCUDAExamples::TrackParticleContainer
vecmem::edm::container< TrackParticleInterface, vecmem::edm::type::vector< float >, vecmem::edm::type::vector< float >, vecmem::edm::type::vector< float > > TrackParticleContainer
SoA, GPU friendly TrackParticleContainer.
Definition: Control/AthenaExamples/AthExCUDA/src/TrackParticleContainer.h:46
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
xAODMaker::TrackParticleCnvAlg::m_augmentObservedTracks
Gaudi::Property< bool > m_augmentObservedTracks
Definition: TrackParticleCnvAlg.h:116
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
SG::VarHandleBase::name
const std::string & name() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleBase.cxx:75
xAODMaker::AssociationHelper< TrackCollection >::operator()
const Trk::Track * operator()(xAOD::TrackParticle *track_particle, unsigned int) const
Definition: TrackParticleCnvAlg.cxx:246
EventPrimitivesHelpers.h
xAODTruthParticleLinkVector::find
ElementLink< xAOD::TruthParticleContainer > find(const HepMcParticleLink &hepMCLink) const
Definition: xAODTruthParticleLink.h:28
TrackParticleTruth.h
xAODMaker::TrackParticleCnvAlg::createParticle
xAOD::TrackParticle * createParticle(xAOD::TrackParticleContainer &xaod, const Rec::TrackParticleContainer &container, const Rec::TrackParticle &tp)
Definition: TrackParticleCnvAlg.cxx:446
ParticleTest.tp
tp
Definition: ParticleTest.py:25
AthCommonMsg< Gaudi::Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
xAODMaker::TrackParticleCnvAlg::m_truthClassifier
ToolHandle< IMCTruthClassifier > m_truthClassifier
ToolHandle to truth classifier.
Definition: TrackParticleCnvAlg.h:75
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
xAODMaker
Definition: StoreGateSvc.h:72
xAODMaker::AssociationHelper< TrackCollection >::AssociationHelper
AssociationHelper(const TrackCollection &, xAOD::TrackParticleContainer *)
Definition: TrackParticleCnvAlg.cxx:245
xAODMaker::TrackParticleCnvAlg::m_convertAODTrackParticles
Gaudi::Property< bool > m_convertAODTrackParticles
toggle on converting AOD track particles to xAOD
Definition: TrackParticleCnvAlg.h:121
Trk::numberOfSCTHoles
@ numberOfSCTHoles
number of Holes in both sides of a SCT module
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:73
ReweightUtils.message
message
Definition: ReweightUtils.py:15
xAOD::VxType::NoVtx
@ NoVtx
Dummy vertex. TrackParticle was not used in vertex fit.
Definition: TrackingPrimitives.h:570
xAODMaker::TrackParticleCnvAlg::m_xaodTrackParticlesout
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_xaodTrackParticlesout
Definition: TrackParticleCnvAlg.h:97
xAODMaker::AssociationHelper
Definition: TrackParticleCnvAlg.cxx:239
xAODMaker::TrackParticleCnvAlg::m_xaodTruthMatchProbKey
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_xaodTruthMatchProbKey
Definition: TrackParticleCnvAlg.h:101
xAODMaker::TrackParticleCnvAlg::m_tracksMap
SG::ReadHandleKey< ObservedTrackMap > m_tracksMap
Definition: TrackParticleCnvAlg.h:117
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
xAODMaker::AssociationHelper< Rec::TrackParticleContainer >::operator()
const Rec::TrackParticle * operator()(xAOD::TrackParticle *, unsigned int idx) const
Definition: TrackParticleCnvAlg.cxx:271
ObservedTrackMap
std::map< int, std::tuple< Trk::Track *, double, xAOD::RejectionStep, xAOD::RejectionReason, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, float, float, int, std::vector< xAOD::RejectionStep >, std::vector< xAOD::RejectionReason > > > ObservedTrackMap
Definition: ObservedTrackMap.h:50
NonDefined
@ NonDefined
Definition: TruthClasses.h:52
TrackTruthCollection
Definition: TrackTruthCollection.h:21
xAODMaker::TrackParticleCnvAlg::m_aod
SG::ReadHandleKey< Rec::TrackParticleContainer > m_aod
Definition: TrackParticleCnvAlg.h:88
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAODMaker::TrackParticleCnvAlg::m_trackTruth
SG::ReadHandleKey< TrackTruthCollection > m_trackTruth
Definition: TrackParticleCnvAlg.h:106
TrackParticleTruthKey.h
EventPrimitivesToStringConverter.h
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
Rec
Name: MuonSpContainer.h Package : offline/Reconstruction/MuonIdentification/muonEvent.
Definition: FakeTrackBuilder.h:10
xAODMaker::AssociationHelper< Rec::TrackParticleContainer >::m_contSrc
const Rec::TrackParticleContainer * m_contSrc
Definition: TrackParticleCnvAlg.cxx:278
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Trk::numberOfSCTHits
@ numberOfSCTHits
number of SCT holes
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:71
SG::WriteHandle::ptr
pointer_type ptr()
Dereference the pointer.
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ParticleOrigin
ParticleOrigin
Definition: TruthClasses.h:51
xAODMaker::TrackParticleCnvAlg::m_addTruthLink
Gaudi::Property< bool > m_addTruthLink
toggle on adding truth links
Definition: TrackParticleCnvAlg.h:68
TrackParticleCnvAlg.h
xAOD::VxType::PriVtx
@ PriVtx
Primary vertex.
Definition: TrackingPrimitives.h:571
HepMC::uniqueID
int uniqueID(const T &p)
Definition: MagicNumbers.h:116
xAODMaker::TrackParticleCnvAlg::m_aodTruth
SG::ReadHandleKey< TrackParticleTruthCollection > m_aodTruth
Definition: TrackParticleCnvAlg.h:105
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
xAODMaker::TrackParticleCnvAlg::m_xaodTruthTypeKey
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_xaodTruthTypeKey
Definition: TrackParticleCnvAlg.h:99
xAOD::Vertex_v1::z
float z() const
Returns the z position.
xAODMaker::TrackParticleCnvAlg::execute
virtual StatusCode execute(const EventContext &ctx) const
Function executing the algorithm.
Definition: TrackParticleCnvAlg.cxx:87
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
DataVector< Trk::Track >
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
xAODMaker::TrackParticleCnvAlg::m_TrackCollectionCnvTool
ToolHandle< xAODMaker::ITrackCollectionCnvTool > m_TrackCollectionCnvTool
Definition: TrackParticleCnvAlg.h:83
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Trk::numberOfPixelHoles
@ numberOfPixelHoles
number of pixels which have a ganged ambiguity.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:59
xAODMaker::AssociationHelper< Rec::TrackParticleContainer >::AssociationHelper
AssociationHelper(const Rec::TrackParticleContainer &cont_src, xAOD::TrackParticleContainer *cont_dest)
Definition: TrackParticleCnvAlg.cxx:257
xAODMaker::TrackParticleCnvAlg::m_doMonitoring
Gaudi::Property< bool > m_doMonitoring
Definition: TrackParticleCnvAlg.h:109
Trk::numberOfTRTHits
@ numberOfTRTHits
number of TRT outliers
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:79
xAODMaker::TrackParticleCnvAlg::convert
int convert(const CONT &, const TRUTHCONT &, CONVTOOL &tool, SG::WriteHandle< xAOD::TrackParticleContainer > &, const xAODTruthParticleLinkVector *, const xAOD::Vertex *primaryVertex=nullptr, const ObservedTrackMap *obs_track_map=0) const
Definition: TrackParticleCnvAlg.cxx:283
Trk::TrackSummary
A summary of the information contained by a track.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:287
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
xAODMaker::TrackParticleCnvAlg::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: TrackParticleCnvAlg.h:113
xAODMaker::TrackParticleCnvAlg::m_RecTrackParticleContainerCnvTool
ToolHandle< xAODMaker::IRecTrackParticleContainerCnvTool > m_RecTrackParticleContainerCnvTool
Definition: TrackParticleCnvAlg.h:85
errorcheck.h
Helpers for checking error return status codes and reporting errors.
Rec::TrackParticleContainer
Definition: Reconstruction/Particle/Particle/TrackParticleContainer.h:33
xAODMaker::TrackParticleCnvAlg::m_truthParticleLinkVec
SG::ReadHandleKey< xAODTruthParticleLinkVector > m_truthParticleLinkVec
Definition: TrackParticleCnvAlg.h:104
xAODMaker::TrackParticleCnvAlg::m_convertTracks
Gaudi::Property< bool > m_convertTracks
toggle on converting tracks to xAOD
Definition: TrackParticleCnvAlg.h:124
Rec::TrackParticle
Definition: Reconstruction/Particle/Particle/TrackParticle.h:47
xAODMaker::TrackParticleCnvAlg::m_tracks
SG::ReadHandleKey< TrackCollection > m_tracks
Definition: TrackParticleCnvAlg.h:90
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
SG::WriteDecorHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Trk::Track::trackSummary
const Trk::TrackSummary * trackSummary() const
Returns a pointer to the const Trk::TrackSummary owned by this const track (could be nullptr)
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAODTruthParticleLinkVector
Definition: xAODTruthParticleLink.h:26
TrackParticleTruthCollection
Definition: TrackParticleTruthCollection.h:18
DEBUG
#define DEBUG
Definition: page_access.h:11
xAOD::Vertex_v1::y
float y() const
Returns the y position.
AthCommonMsg< Gaudi::Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
xAODMaker::TrackParticleCnvAlg::m_particleCreator
ToolHandle< Trk::ITrackParticleCreatorTool > m_particleCreator
The key for the input TrackParticleTruthCollection.
Definition: TrackParticleCnvAlg.h:73
xAODMaker::TrackParticleCnvAlg::m_primaryVertexContainer
SG::ReadHandleKey< xAOD::VertexContainer > m_primaryVertexContainer
Definition: TrackParticleCnvAlg.h:92
xAODMaker::TrackParticleCnvAlg::TrackParticleCnvAlg
TrackParticleCnvAlg(const std::string &name, ISvcLocator *svcLoc)
Regular algorithm constructor.
Definition: TrackParticleCnvAlg.cxx:26
xAODMaker::TrackParticleCnvAlg::m_xaodout
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_xaodout
Definition: TrackParticleCnvAlg.h:94
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
xAOD::TrackParticle_v1::track
const Trk::Track * track() const
Returns a pointer (which can be NULL) to the Trk::Track which was used to make this TrackParticle.
Definition: TrackParticle_v1.cxx:805
python.CaloScaleNoiseConfig.ts
ts
Definition: CaloScaleNoiseConfig.py:86
ParticleType
ParticleType
Definition: TruthClasses.h:8
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
Monitored::Timer
A monitored timer.
Definition: MonitoredTimer.h:32
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.