ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
AtlasTest
DatabaseTest
AthenaPoolTest
src
TrkTrackFakeReader.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
// Silicon trackers includes
18
#include "
TrkTrackFakeReader.h
"
19
20
//InDetRawData includes
21
#include "
InDetRawData/PixelRDO_Container.h
"
22
#include "
InDetRawData/SCT_RDO_Container.h
"
23
#include "
InDetRawData/TRT_RDO_Container.h
"
24
#include "
InDetRawData/PixelRDO_Collection.h
"
25
#include "
InDetRawData/SCT_RDO_Collection.h
"
26
#include "
InDetRawData/TRT_RDO_Collection.h
"
27
28
// #include "InDetRawData/InDetRawDataContainer.h"
29
// #include "InDetRawData/InDetRawDataCollection.h"
30
// #include "InDetRawData/Pixel1RawData.h"
31
// #include "InDetRawData/InDetRawDataCLASS_DEF.h"
32
// #include "InDetRawData/PixelRDORawData.h"
33
// #include "InDetRawUtils/PixelHid2RESrcID.h"
34
35
// Id includes
36
#include "
InDetIdentifier/PixelID.h
"
37
#include "
InDetIdentifier/SCT_ID.h
"
38
#include "
InDetIdentifier/TRT_ID.h
"
39
//#include "InDetDetDescr/InDet_DetDescrManager.h"
40
41
// test includes
42
#include "
TrkTrack/Track.h
"
43
#include "
TrkTrack/TrackCollection.h
"
44
#include "
InDetPrepRawData/SiClusterCollection.h
"
45
#include "
InDetPrepRawData/SiClusterContainer.h
"
46
#include "
InDetPrepRawData/SiCluster.h
"
47
48
#include <map>
49
#include "
TrkTrackFakeWriter.h
"
50
51
#include "
StoreGate/ReadCondHandle.h
"
52
53
// Constructor with parameters:
54
TrkTrackFakeReader::TrkTrackFakeReader
(
const
std::string &name,
55
ISvcLocator *pSvcLocator) :
56
AthAlgorithm
(name,pSvcLocator)
57
{}
58
59
// Initialize method:
60
StatusCode
TrkTrackFakeReader::initialize
()
61
{
62
ATH_MSG_INFO
(
"TrkTrackFakeReader::initialize()"
);
63
ATH_CHECK
(
m_pixelDetEleCollKey
.initialize() );
64
return
StatusCode::SUCCESS;
65
}
66
67
// Execute method:
68
StatusCode
TrkTrackFakeReader::execute
(
const
EventContext& ctx)
69
{
70
ATH_MSG_DEBUG
(
"TrkTrackFakeReader::execute()"
);
71
72
using namespace
Trk
;
73
using namespace
InDet
;
74
75
//Get tracks
76
const
TrackCollection
* tracks =
nullptr
;
77
ATH_CHECK
(
evtStore
()->retrieve(tracks,
"Tracks"
) );
78
79
SG::ReadCondHandle<InDetDD::SiDetectorElementCollection>
pixelDetEleHandle(
m_pixelDetEleCollKey
, ctx);
80
const
InDetDD::SiDetectorElementCollection
* elements = *pixelDetEleHandle;
81
if
(not pixelDetEleHandle.
isValid
() or elements==
nullptr
) {
82
ATH_MSG_WARNING
(
m_pixelDetEleCollKey
.fullKey() <<
" is not available."
);
83
}
84
85
for
(
TrackCollection::const_iterator
it = tracks->
begin
(); it!=tracks->
end
(); ++it)
86
{
87
//compare tracks
88
Trk::Track
* track =
FakeTrackBuilder::buildTrack
(elements);
89
// compareTracks(track,*it);
90
91
delete
track;
92
}
93
return
StatusCode::SUCCESS;
94
}
95
96
97
// Finalize method:
98
StatusCode
TrkTrackFakeReader::finalize
()
99
{
100
ATH_MSG_INFO
(
"TrkTrackFakeReader::finalize()"
);
101
return
StatusCode::SUCCESS;
102
}
103
104
void
TrkTrackFakeReader::compareTracks
(
const
Trk::Track
*
ref
,
const
Trk::Track
* readTrk) {
105
// if (**it!=*track) {
106
// log<<MSG::ERROR<<"Tracks differ!"<<endmsg;
107
//
108
// log<<MSG::INFO<<"Reference track: "<<(*track)<<endmsg;
109
// log<<MSG::INFO<<"Track from ESD: "<<(**it)<<endmsg;
110
// }
111
// Get the messaging service, print where you are
112
MsgStream log(msgSvc(), name());
113
if
( !(
ref
->fitQuality () && readTrk->
fitQuality
()
114
&&
ref
->fitQuality()->chiSquared()==readTrk->
fitQuality
()->
chiSquared
()
115
&&
ref
->fitQuality()->numberDoF()==readTrk->
fitQuality
()->
numberDoF
())) {
116
ATH_MSG_WARNING
(
"Track fitqualities differ"
);
117
}
118
}
119
ref
const std::regex ref(r_ef)
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x,...)
Definition
AthMsgStreamMacros.h:43
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x,...)
Definition
AthMsgStreamMacros.h:46
ATH_MSG_INFO
#define ATH_MSG_INFO(x,...)
Definition
AthMsgStreamMacros.h:45
PixelID.h
This is an Identifier helper class for the Pixel subdetector.
PixelRDO_Collection.h
PixelRDO_Container.h
ReadCondHandle.h
SCT_ID.h
This is an Identifier helper class for the SCT subdetector.
SCT_RDO_Collection.h
SCT_RDO_Container.h
SiClusterCollection.h
SiClusterContainer.h
SiCluster.h
TRT_ID.h
This is an Identifier helper class for the TRT subdetector.
TRT_RDO_Collection.h
TRT_RDO_Container.h
TrackCollection.h
TrackCollection
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
Definition
TrackCollection.h:19
Track.h
TrkTrackFakeReader.h
Test Algorithm for POOL I/O uses TrkTracks as test data.
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 >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
Definition
AthCommonDataStore.h:85
DataVector< Trk::Track >::const_iterator
DataModel_detail::const_iterator< DataVector > const_iterator
Definition
DataVector.h:838
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
FakeTrackBuilder::buildTrack
static Trk::Track * buildTrack(const InDetDD::SiDetectorElementCollection *elements)
Definition
FakeTrackBuilder.cxx:45
InDetDD::SiDetectorElementCollection
Class to hold the SiDetectorElement objects to be put in the detector store.
Definition
SiDetectorElementCollection.h:27
SG::ReadCondHandle
Definition
ReadCondHandle.h:39
SG::ReadCondHandle::isValid
bool isValid()
Definition
ReadCondHandle.h:204
TrkTrackFakeReader::compareTracks
void compareTracks(const Trk::Track *ref, const Trk::Track *readTrk)
Definition
TrkTrackFakeReader.cxx:104
TrkTrackFakeReader::initialize
virtual StatusCode initialize()
Algorithm initialize at begin of job.
Definition
TrkTrackFakeReader.cxx:60
TrkTrackFakeReader::execute
virtual StatusCode execute(const EventContext &ctx)
Algorithm execute once per event.
Definition
TrkTrackFakeReader.cxx:68
TrkTrackFakeReader::finalize
virtual StatusCode finalize()
Algorithm finalize at end of job.
Definition
TrkTrackFakeReader.cxx:98
TrkTrackFakeReader::m_pixelDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
Definition
TrkTrackFakeReader.h:68
TrkTrackFakeReader::TrkTrackFakeReader
TrkTrackFakeReader(const std::string &name, ISvcLocator *pSvcLocator)
Algorithm constructor.
Definition
TrkTrackFakeReader.cxx:54
Trk::FitQuality::numberDoF
int numberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as integer
Definition
FitQuality.h:60
Trk::FitQuality::chiSquared
double chiSquared() const
returns the of the overall track fit
Definition
FitQuality.h:56
Trk::Track
The ATLAS Track class.
Definition
Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
Trk::Track::fitQuality
const FitQuality * fitQuality() const
return a pointer to the fit quality const-overload
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