ATLAS Offline Software
Loading...
Searching...
No Matches
ProtoTrackReportingAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
7
8
9ActsTrk::ProtoTrackReportingAlg::ProtoTrackReportingAlg( const std::string& name, ISvcLocator* pSvcLocator ) : AthReentrantAlgorithm( name, pSvcLocator ){
10}
11
13 ATH_CHECK(m_EFTracks.initialize());
14 ATH_CHECK(m_xAODTracks.initialize());
15
16
17 return StatusCode::SUCCESS;
18}
19
20
21StatusCode ActsTrk::ProtoTrackReportingAlg::execute(const EventContext & ctx) const {
22
23 auto trackContainerHandle = SG::makeHandle(m_EFTracks, ctx);
24 if (!trackContainerHandle.isValid())
25 {
26 ATH_MSG_FATAL("Failed to read EF track collection with key " << m_EFTracks.key());
27 return StatusCode::FAILURE;
28 }
29
30 // Print the numberr of candidates we found in the Trk and the xAOD containers, as well as the
31 // properties of the xAOD candidates.
32 ATH_MSG_INFO("I found the track collection, with "<<trackContainerHandle->size()<<" entries");
33
34
35 auto xAODTrackHandle = SG::makeHandle(m_xAODTracks, ctx);
36 if (!xAODTrackHandle.isValid())
37 {
38 ATH_MSG_FATAL("Failed to read xAOD EF track collection with key " << m_xAODTracks.key());
39 return StatusCode::FAILURE;
40 }
41 ATH_MSG_INFO("I found the xAOD track collection, with "<<xAODTrackHandle->size()<<" entries");
42 for (const xAOD::TrackParticle* t : *xAODTrackHandle){
43 ATH_MSG_INFO("-----------------------------");
44 auto param = t->perigeeParameters();
45 ATH_MSG_INFO("xAOD Track param: d0 "<<t->d0()<<" z0 "<<t->z0()<<" pt "<<t->pt()<<" eta "<<t->eta()<<" phi "<<t->phi());
46
47 }
48
49
50 return StatusCode::SUCCESS;
51}
52
53
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
virtual StatusCode execute(const EventContext &ctx) const override final
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_xAODTracks
SG::ReadHandleKey< TrackCollection > m_EFTracks
virtual StatusCode initialize() override final
uncomment and implement methods as required
ProtoTrackReportingAlg(const std::string &name, ISvcLocator *pSvcLocator)
An algorithm that can be simultaneously executed in multiple threads.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
TrackParticle_v1 TrackParticle
Reference the current persistent version: