ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
Acts
ActsTrackReconstruction
src
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
5
#include "
ProtoTrackReportingAlg.h
"
6
#include "
xAODEventInfo/EventInfo.h
"
7
8
9
ActsTrk::ProtoTrackReportingAlg::ProtoTrackReportingAlg
(
const
std::string& name, ISvcLocator* pSvcLocator ) :
AthReentrantAlgorithm
( name, pSvcLocator ){
10
}
11
12
StatusCode
ActsTrk::ProtoTrackReportingAlg::initialize
() {
13
ATH_CHECK
(
m_EFTracks
.initialize());
14
ATH_CHECK
(
m_xAODTracks
.initialize());
15
16
17
return
StatusCode::SUCCESS;
18
}
19
20
21
StatusCode
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
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition
AthMsgStreamMacros.h:34
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ProtoTrackReportingAlg.h
ActsTrk::ProtoTrackReportingAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Definition
ProtoTrackReportingAlg.cxx:21
ActsTrk::ProtoTrackReportingAlg::m_xAODTracks
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_xAODTracks
Definition
ProtoTrackReportingAlg.h:30
ActsTrk::ProtoTrackReportingAlg::m_EFTracks
SG::ReadHandleKey< TrackCollection > m_EFTracks
Definition
ProtoTrackReportingAlg.h:29
ActsTrk::ProtoTrackReportingAlg::initialize
virtual StatusCode initialize() override final
uncomment and implement methods as required
Definition
ProtoTrackReportingAlg.cxx:12
ActsTrk::ProtoTrackReportingAlg::ProtoTrackReportingAlg
ProtoTrackReportingAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
ProtoTrackReportingAlg.cxx:9
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition
ReadCondHandle.h:269
xAOD::TrackParticle
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Definition
Event/xAOD/xAODTracking/xAODTracking/TrackParticle.h:13
EventInfo.h
Generated on
for ATLAS Offline Software by
1.17.0