ATLAS Offline Software
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 
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 
51 #include "InDetIdentifier/SCT_ID.h"
52 #include "InDetIdentifier/TRT_ID.h"
53 
56 #include <map>
57 
58 // Constructor with parameters:
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:
73 {
74  // Get the messaging service, print where you are
75  ATH_MSG_INFO( "TrkTrackFakeWriter::initialize()" );
76 
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 
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
EstimatedBremOnTrack.h
EnergyLoss.h
ScatteringAngles.h
SCT_ID.h
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
TrackParameters.h
InDetDD::SiDetectorElementCollection
Definition: SiDetectorElementCollection.h:30
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CompetingRIOsOnTrack.h
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
TrkTrackFakeWriter::initialize
virtual StatusCode initialize()
Algorithm initialize at begin of job.
Definition: TrkTrackFakeWriter.cxx:72
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
TrkTrackFakeWriter::finalize
virtual StatusCode finalize()
Algorithm finalize at end of job.
Definition: TrkTrackFakeWriter.cxx:116
TRT_ID.h
This is an Identifier helper class for the TRT subdetector. This class is a factory for creating comp...
SG::ReadCondHandle::isValid
bool isValid()
Definition: ReadCondHandle.h:206
TrkTrackFakeWriter::m_doInDet
bool m_doInDet
Definition: TrkTrackFakeWriter.h:81
TrkTrackFakeWriter::m_eventcounter
unsigned int m_eventcounter
Definition: TrkTrackFakeWriter.h:80
FakeTrackBuilder::buildTrack
static Trk::Track * buildTrack(const InDetDD::SiDetectorElementCollection *elements)
Definition: FakeTrackBuilder.cxx:45
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
TrkTrackFakeWriter::TrkTrackFakeWriter
TrkTrackFakeWriter()
Avoid use of default constructor.
MaterialEffectsBase.h
ReadCondHandle.h
TrkTrackFakeWriter::m_addBrokenTracks
bool m_addBrokenTracks
Definition: TrkTrackFakeWriter.h:82
TrkTrackFakeWriter.h
Test Algorithm for POOL I/O uses TrkTracks as test data.
Track.h
MaterialEffectsOnTrack.h
DiamondBounds.h
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
TrackCollection
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
Definition: TrackCollection.h:19
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TrackCollection.h
CylinderSurface.h
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TrkTrackFakeWriter::m_pixelDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
Definition: TrkTrackFakeWriter.h:78
AthAlgorithm
Definition: AthAlgorithm.h:47
TrkTrackFakeWriter::execute
virtual StatusCode execute()
Algorithm execute once per event.
Definition: TrkTrackFakeWriter.cxx:83
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
IdentifierHash.h
SiClusterCollection.h
SiCluster.h
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
SiDetectorElement.h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
PlaneSurface.h
DiscSurface.h
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
FitQuality.h
PixelClusterOnTrack.h
CompetingPixelClustersOnTrack.h
FakeTrackBuilder::buildBrokenTrack
static Trk::Track * buildBrokenTrack(const InDetDD::SiDetectorElementCollection *elements)
Definition: FakeTrackBuilder.cxx:159
TrackStateOnSurface.h