ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
AtlasTest
DatabaseTest
AthenaPoolTest
src
TrkTrackFakeWriter.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3
*/
4
16
17
#include "
InDetRIO_OnTrack/PixelClusterOnTrack.h
"
18
#include "
TrkTrackFakeWriter.h
"
19
20
21
// Gaudi includes
22
#include "GaudiKernel/MsgStream.h"
23
#include "GaudiKernel/SmartDataPtr.h"
24
25
// include Tracking EDM
26
#include "
TrkTrack/Track.h
"
27
#include "
TrkTrack/TrackCollection.h
"
28
#include "
TrkTrack/TrackStateOnSurface.h
"
29
#include "
TrkEventPrimitives/FitQuality.h
"
30
#include "
TrkParameters/TrackParameters.h
"
31
#include "
TrkSurfaces/CylinderSurface.h
"
32
#include "
TrkSurfaces/DiscSurface.h
"
33
#include "
TrkSurfaces/PlaneSurface.h
"
34
#include "
TrkSurfaces/DiamondBounds.h
"
35
36
// include MaterialEffects classes
37
#include "
TrkMaterialOnTrack/MaterialEffectsBase.h
"
38
#include "
TrkMaterialOnTrack/MaterialEffectsOnTrack.h
"
39
#include "
TrkMaterialOnTrack/EnergyLoss.h
"
40
#include "
TrkMaterialOnTrack/ScatteringAngles.h
"
41
#include "
TrkMaterialOnTrack/EstimatedBremOnTrack.h
"
42
43
// include InDet EDM
44
#include "
InDetPrepRawData/SiClusterCollection.h
"
45
#include "
InDetPrepRawData/SiCluster.h
"
46
#include "
Identifier/IdentifierHash.h
"
47
#include "
TrkCompetingRIOsOnTrack/CompetingRIOsOnTrack.h
"
48
#include "
InDetCompetingRIOsOnTrack/CompetingPixelClustersOnTrack.h
"
49
50
#include "
InDetIdentifier/PixelID.h
"
51
#include "
InDetIdentifier/SCT_ID.h
"
52
#include "
InDetIdentifier/TRT_ID.h
"
53
54
#include "
InDetReadoutGeometry/SiDetectorElement.h
"
55
#include "
StoreGate/ReadCondHandle.h
"
56
#include <map>
57
58
// Constructor with parameters:
59
TrkTrackFakeWriter::TrkTrackFakeWriter
(
const
std::string &name,
60
ISvcLocator *pSvcLocator)
61
:
62
AthAlgorithm
(name,pSvcLocator),
63
m_eventcounter
(0),
64
m_doInDet
(true),
65
m_addBrokenTracks
(true)
66
{
67
declareProperty
(
"WithInDetEDM"
,
m_doInDet
,
"flag if to add indet things to fake track"
);
68
declareProperty
(
"AddBrokenTracks"
,
m_addBrokenTracks
,
"flag if to add broken objects to fake track (i.e. to test convertors)"
);
69
}
70
71
// Initialize method:
72
StatusCode
TrkTrackFakeWriter::initialize
()
73
{
74
// Get the messaging service, print where you are
75
ATH_MSG_INFO
(
"TrkTrackFakeWriter::initialize()"
);
76
77
ATH_CHECK
(
m_pixelDetEleCollKey
.initialize() );
78
79
return
StatusCode::SUCCESS;
80
}
81
82
// Execute method:
83
StatusCode
TrkTrackFakeWriter::execute
(
const
EventContext& ctx)
84
{
85
++
m_eventcounter
;
86
ATH_MSG_DEBUG
(
"TrkTrackFakeWriter::execute()"
);
87
88
using namespace
Trk
;
89
using namespace
InDet
;
90
//create a demo track collection
91
TrackCollection
* newTracks =
new
TrackCollection
;
92
93
SG::ReadCondHandle<InDetDD::SiDetectorElementCollection>
pixelDetEleHandle(
m_pixelDetEleCollKey
, ctx);
94
const
InDetDD::SiDetectorElementCollection
* elements = *pixelDetEleHandle;
95
if
(not pixelDetEleHandle.
isValid
() or elements==
nullptr
) {
96
ATH_MSG_WARNING
(
m_pixelDetEleCollKey
.fullKey() <<
" is not available."
);
97
}
98
99
Trk::Track
* track =
FakeTrackBuilder::buildTrack
(elements);
100
newTracks->
push_back
(track);
101
ATH_MSG_VERBOSE
((*track) );
102
103
if
(
m_addBrokenTracks
) {
104
Trk::Track
* track =
FakeTrackBuilder::buildBrokenTrack
(elements);
105
newTracks->
push_back
(track);
106
}
107
108
ATH_CHECK
(
evtStore
()->record(newTracks,
"Tracks"
,
false
) );
109
ATH_MSG_DEBUG
(
"TrkTrackFakeWriter::execute() ended"
);
110
111
//now try PRD collections
112
return
StatusCode::SUCCESS;
113
}
114
115
// Finalize method:
116
StatusCode
TrkTrackFakeWriter::finalize
()
117
{
118
ATH_MSG_INFO
(
"TrkTrackFakeWriter::finalize()"
);
119
return
StatusCode::SUCCESS;
120
}
121
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CompetingPixelClustersOnTrack.h
CompetingRIOsOnTrack.h
CylinderSurface.h
DiamondBounds.h
DiscSurface.h
EnergyLoss.h
EstimatedBremOnTrack.h
FitQuality.h
IdentifierHash.h
MaterialEffectsBase.h
MaterialEffectsOnTrack.h
PixelClusterOnTrack.h
PixelID.h
This is an Identifier helper class for the Pixel subdetector.
PlaneSurface.h
ReadCondHandle.h
SCT_ID.h
This is an Identifier helper class for the SCT subdetector.
ScatteringAngles.h
SiClusterCollection.h
SiCluster.h
SiDetectorElement.h
TRT_ID.h
This is an Identifier helper class for the TRT subdetector.
TrackCollection.h
TrackCollection
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
Definition
TrackCollection.h:19
TrackStateOnSurface.h
TrackParameters.h
Track.h
TrkTrackFakeWriter.h
Test Algorithm for POOL I/O uses TrkTracks as test data.
AthAlgorithm::AthAlgorithm
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthAlgorithm.cxx:10
AthCommonAlgorithm< Gaudi::Algorithm >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
AthCommonAlgorithm< Gaudi::Algorithm >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
Definition
AthCommonDataStore.h:85
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
FakeTrackBuilder::buildTrack
static Trk::Track * buildTrack(const InDetDD::SiDetectorElementCollection *elements)
Definition
FakeTrackBuilder.cxx:45
FakeTrackBuilder::buildBrokenTrack
static Trk::Track * buildBrokenTrack(const InDetDD::SiDetectorElementCollection *elements)
Definition
FakeTrackBuilder.cxx:159
InDetDD::SiDetectorElementCollection
Class to hold the SiDetectorElement objects to be put in the detector store.
Definition
SiDetectorElementCollection.h:27
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
SG::ReadCondHandle::isValid
bool isValid()
Definition
ReadCondHandle.h:205
TrkTrackFakeWriter::initialize
virtual StatusCode initialize()
Algorithm initialize at begin of job.
Definition
TrkTrackFakeWriter.cxx:72
TrkTrackFakeWriter::finalize
virtual StatusCode finalize()
Algorithm finalize at end of job.
Definition
TrkTrackFakeWriter.cxx:116
TrkTrackFakeWriter::execute
virtual StatusCode execute(const EventContext &ctx)
Algorithm execute once per event.
Definition
TrkTrackFakeWriter.cxx:83
TrkTrackFakeWriter::m_doInDet
bool m_doInDet
Definition
TrkTrackFakeWriter.h:81
TrkTrackFakeWriter::m_addBrokenTracks
bool m_addBrokenTracks
Definition
TrkTrackFakeWriter.h:82
TrkTrackFakeWriter::m_eventcounter
unsigned int m_eventcounter
Definition
TrkTrackFakeWriter.h:80
TrkTrackFakeWriter::TrkTrackFakeWriter
TrkTrackFakeWriter()
Avoid use of default constructor.
TrkTrackFakeWriter::m_pixelDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
Definition
TrkTrackFakeWriter.h:78
Trk::Track
The ATLAS Track class.
Definition
Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
InDet
Primary Vertex Finder.
Definition
VP1ErrorUtils.h:36
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition
FakeTrackBuilder.h:9
Generated on
for ATLAS Offline Software by
1.17.0