ATLAS Offline Software
Loading...
Searching...
No Matches
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
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"
35
36// include MaterialEffects classes
42
43// include InDet EDM
49
53
56#include <map>
57
58// Constructor with parameters:
60ISvcLocator *pSvcLocator)
61:
62AthAlgorithm(name,pSvcLocator),
64 m_doInDet(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:
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:
84{
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
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
100 newTracks->push_back(track);
101 ATH_MSG_VERBOSE((*track) );
102
103 if (m_addBrokenTracks) {
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:
117{
118 ATH_MSG_INFO( "TrkTrackFakeWriter::finalize()" );
119 return StatusCode::SUCCESS;
120}
121
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(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.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
static Trk::Track * buildTrack(const InDetDD::SiDetectorElementCollection *elements)
static Trk::Track * buildBrokenTrack(const InDetDD::SiDetectorElementCollection *elements)
Class to hold the SiDetectorElement objects to be put in the detector store.
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.
unsigned int m_eventcounter
TrkTrackFakeWriter()
Avoid use of default constructor.
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
Primary Vertex Finder.
Ensure that the ATLAS eigen extensions are properly loaded.