ATLAS Offline Software
Loading...
Searching...
No Matches
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
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
39//#include "InDetDetDescr/InDet_DetDescrManager.h"
40
41// test includes
42#include "TrkTrack/Track.h"
47
48#include <map>
49#include "TrkTrackFakeWriter.h"
50
52
53// Constructor with parameters:
55ISvcLocator *pSvcLocator) :
56 AthAlgorithm(name,pSvcLocator)
57 {}
58
59// Initialize method:
61{
62 ATH_MSG_INFO( "TrkTrackFakeReader::initialize()" );
63 ATH_CHECK( m_pixelDetEleCollKey.initialize() );
64 return StatusCode::SUCCESS;
65}
66
67// Execute method:
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
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
89 // compareTracks(track,*it);
90
91 delete track;
92 }
93 return StatusCode::SUCCESS;
94}
95
96
97// Finalize method:
99{
100 ATH_MSG_INFO( "TrkTrackFakeReader::finalize()" );
101 return StatusCode::SUCCESS;
102}
103
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
const boost::regex ref(r_ef)
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
This is an Identifier helper class for the Pixel subdetector.
This is an Identifier helper class for the SCT subdetector.
This is an Identifier helper class for the TRT subdetector.
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
Test Algorithm for POOL I/O uses TrkTracks as test data.
Test Algorithm for POOL I/O uses TrkTracks as test data.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
static Trk::Track * buildTrack(const InDetDD::SiDetectorElementCollection *elements)
Class to hold the SiDetectorElement objects to be put in the detector store.
void compareTracks(const Trk::Track *ref, const Trk::Track *readTrk)
virtual StatusCode initialize()
Algorithm initialize at begin of job.
virtual StatusCode execute()
Algorithm execute once per event.
virtual StatusCode finalize()
Algorithm finalize at end of job.
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
TrkTrackFakeReader(const std::string &name, ISvcLocator *pSvcLocator)
Algorithm constructor.
int numberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as integer
Definition FitQuality.h:60
double chiSquared() const
returns the of the overall track fit
Definition FitQuality.h:56
const FitQuality * fitQuality() const
return a pointer to the fit quality const-overload
Primary Vertex Finder.
Ensure that the ATLAS eigen extensions are properly loaded.