ATLAS Offline Software
FPGATrackSimSGToRawHitsTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef FPGATrackSimSGInput_FPGATrackSimSGTORAWHITSTOOL_H
6 #define FPGATrackSimSGInput_FPGATrackSimSGTORAWHITSTOOL_H
7 
9 #include "GaudiKernel/ServiceHandle.h"
13 
14 
15 #include "HepPDT/ParticleDataTable.hh"
16 #include "HepPDT/ParticleData.hh"
18 #include "InDetIdentifier/SCT_ID.h"
23 
29 
32 
33 
38 
39 typedef unsigned int index_type;
40 
45 class FPGATrackSimSGToRawHitsTool : public extends<AthAlgTool, IFPGATrackSimInputTool> {
46 
47 public:
48  FPGATrackSimSGToRawHitsTool(const std::string&, const std::string&, const IInterface*);
50 
51  virtual StatusCode initialize() override;
52  virtual StatusCode finalize() override;
53  virtual StatusCode readData(FPGATrackSimEventInputHeader* header, const EventContext& eventContext) override;
54 
55 
56 private:
57  ToolHandle<Trk::ITruthToTrack> m_truthToTrack {this, "TruthToTrackTool", "Trk::TruthToTrack/InDetTruthToTrack" };
58  ToolHandle<Trk::IExtrapolator> m_extrapolator {this, "Extrapolator", "Trk::Extrapolator/AtlasExtrapolator"};
59 
60  SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
61  SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey { this, "EventInfo", "EventInfo" };
62  SG::ReadHandleKey<InDet::SiClusterContainer> m_pixelClusterContainerKey { this, "pixelClustersName", "ITkPixelClusters" };
63  SG::ReadHandleKey<InDet::SiClusterContainer> m_sctClusterContainerKey { this, "SCT_ClustersName", "SCT_Clusters" };
64 
65  SG::ReadHandleKey<xAOD::TrackParticleContainer> m_offlineTracksKey { this, "OfflineTracks", "InDetTrackParticles"};
66  SG::ReadHandleKey<McEventCollection> m_mcCollectionKey { this, "McTruth", "TruthEvent" };
67  SG::ReadHandleKey<InDetSimDataCollection> m_pixelSDOKey { this, "PixelSDO", "ITkPixelSDO_Map" };
68  SG::ReadHandleKey<InDetSimDataCollection> m_stripSDOKey { this, "StripSDO", "ITkStripSDO_Map" };
69  SG::ReadHandleKey<PixelRDO_Container> m_pixelRDOKey { this, "PixelRDO", "ITkPixelRDOs" };
70  SG::ReadHandleKey<SCT_RDO_Container> m_stripRDOKey { this, "StripRDO", "ITkStripRDOs" };
71 
72 
73 
74 
75 
76  Gaudi::Property<std::string> m_tracksTruthName { this, "OfflineName", "InDetTrackParticles", "name of offline tracks collection" };
77  Gaudi::Property<bool> m_dumpHitsOnTracks { this, "dumpHitsOnTracks", false };
78  Gaudi::Property<bool> m_dumpTruthIntersections { this, "dumpTruthIntersections", false };
79  Gaudi::Property<bool> m_readOfflineClusters { this, "ReadOfflineClusters", true, "flag to enable the offline cluster save" };
80  Gaudi::Property<bool> m_readTruthTracks { this, "ReadTruthTracks", true, "flag to enable the truth tracking save" };
81  Gaudi::Property<bool> m_readOfflineTracks { this, "ReadOfflineTracks", true, "flag to enable the offline tracking save" };
82  Gaudi::Property<bool> m_UseNominalOrigin { this, "UseNominalOrigin", false, "if true truth values are always with respect to (0,0,0)" };
83  Gaudi::Property<double> m_maxEta { this, "maxEta", 3.3 };
84  Gaudi::Property<double> m_minPt { this, "minPt", .8*CLHEP::GeV };
85 
86  //internal pointers
87  const PixelID* m_pixelId = nullptr;
88  const SCT_ID* m_sctId = nullptr;
89 
92  const HepPDT::ParticleDataTable* m_particleDataTable = nullptr;
93 
94  typedef std::map<Identifier, int> HitIndexMap;
95  StatusCode readRawSilicon(HitIndexMap& hitIndexMap, const EventContext& eventContext); // dump raw silicon data to text file and populate hitIndexMap for rec. track processing
96  StatusCode readTruthTracks(std::vector<FPGATrackSimTruthTrack>& truth, const EventContext& eventContext);
97  StatusCode readOfflineTracks(std::vector<FPGATrackSimOfflineTrack>& Track, const EventContext& eventContext);
98  StatusCode readOfflineClusters(std::vector<FPGATrackSimCluster>& Clusters, const EventContext& eventContext);
99  StatusCode readPixelSimulation(HitIndexMap& hitIndexMap, unsigned int& hitIndex, const EventContext& eventContext);
100  StatusCode readStripSimulation(HitIndexMap& hitIndexMap, unsigned int& hitIndex, const EventContext& eventContext);
101  StatusCode dumpPixelClusters(HitIndexMap& pixelClusterIndexMap, const EventContext& eventContext);
102 
103  // To get truth information from simulation
104  const HepMcParticleLink* getTruthInformation(InDetSimDataCollection::const_iterator& iter, FPGATrackSimInputUtils::ParentBitmask& parentMask);
106 };
107 
108 
109 
110 #endif
FPGATrackSimInputUtils.h
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
FPGATrackSimSGToRawHitsTool::~FPGATrackSimSGToRawHitsTool
virtual ~FPGATrackSimSGToRawHitsTool()
Definition: FPGATrackSimSGToRawHitsTool.h:49
FPGATrackSimSGToRawHitsTool::m_readTruthTracks
Gaudi::Property< bool > m_readTruthTracks
Definition: FPGATrackSimSGToRawHitsTool.h:80
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
SCT_ID.h
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
FPGATrackSimInputUtils::ParentBitmask
std::bitset< NBITS > ParentBitmask
Definition: FPGATrackSimInputUtils.h:16
FPGATrackSimSGToRawHitsTool::m_truthToTrack
ToolHandle< Trk::ITruthToTrack > m_truthToTrack
tool to create track parameters from a gen particle
Definition: FPGATrackSimSGToRawHitsTool.h:57
IFPGATrackSimInputTool.h
header
Definition: hcg.cxx:526
FPGATrackSimSGToRawHitsTool
Extract the raw hists from info in SG.
Definition: FPGATrackSimSGToRawHitsTool.h:45
FPGATrackSimSGToRawHitsTool::m_UseNominalOrigin
Gaudi::Property< bool > m_UseNominalOrigin
Definition: FPGATrackSimSGToRawHitsTool.h:82
FPGATrackSimCluster
Definition: FPGATrackSimCluster.h:24
FPGATrackSimTruthTrack
Definition: FPGATrackSimTruthTrack.h:14
FPGATrackSimSGToRawHitsTool::m_offlineTracksKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_offlineTracksKey
Definition: FPGATrackSimSGToRawHitsTool.h:65
FPGATrackSimSGToRawHitsTool::dumpPixelClusters
StatusCode dumpPixelClusters(HitIndexMap &pixelClusterIndexMap, const EventContext &eventContext)
Definition: FPGATrackSimSGToRawHitsTool.cxx:491
FPGATrackSimSGToRawHitsTool::HitIndexMap
std::map< Identifier, int > HitIndexMap
Definition: FPGATrackSimSGToRawHitsTool.h:94
FPGATrackSimSGToRawHitsTool::m_pixelClusterContainerKey
SG::ReadHandleKey< InDet::SiClusterContainer > m_pixelClusterContainerKey
Definition: FPGATrackSimSGToRawHitsTool.h:62
FPGATrackSimSGToRawHitsTool::readTruthTracks
StatusCode readTruthTracks(std::vector< FPGATrackSimTruthTrack > &truth, const EventContext &eventContext)
Definition: FPGATrackSimSGToRawHitsTool.cxx:704
IExtrapolator.h
FPGATrackSimSGToRawHitsTool::m_stripSDOKey
SG::ReadHandleKey< InDetSimDataCollection > m_stripSDOKey
Definition: FPGATrackSimSGToRawHitsTool.h:68
SG::ReadHandleKey< xAOD::EventInfo >
FPGATrackSimSGToRawHitsTool::m_pixelId
const PixelID * m_pixelId
Definition: FPGATrackSimSGToRawHitsTool.h:87
FPGATrackSimSGToRawHitsTool::m_minPt
Gaudi::Property< double > m_minPt
Definition: FPGATrackSimSGToRawHitsTool.h:84
FPGATrackSimSGToRawHitsTool::m_readOfflineClusters
Gaudi::Property< bool > m_readOfflineClusters
Definition: FPGATrackSimSGToRawHitsTool.h:79
FPGATrackSimSGToRawHitsTool::m_maxEta
Gaudi::Property< double > m_maxEta
Definition: FPGATrackSimSGToRawHitsTool.h:83
FPGATrackSimSGToRawHitsTool::m_dumpTruthIntersections
Gaudi::Property< bool > m_dumpTruthIntersections
Definition: FPGATrackSimSGToRawHitsTool.h:78
FPGATrackSimSGToRawHitsTool::m_readOfflineTracks
Gaudi::Property< bool > m_readOfflineTracks
Definition: FPGATrackSimSGToRawHitsTool.h:81
FPGATrackSimSGToRawHitsTool::m_particleDataTable
const HepPDT::ParticleDataTable * m_particleDataTable
Definition: FPGATrackSimSGToRawHitsTool.h:92
FPGATrackSimSGToRawHitsTool::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: FPGATrackSimSGToRawHitsTool.h:61
SCT_RDO_Container.h
FPGATrackSimSGToRawHitsTool::readRawSilicon
StatusCode readRawSilicon(HitIndexMap &hitIndexMap, const EventContext &eventContext)
Definition: FPGATrackSimSGToRawHitsTool.cxx:210
McEventCollection.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
FPGATrackSimSGToRawHitsTool::m_SCT_mgr
const InDetDD::SiDetectorManager * m_SCT_mgr
Definition: FPGATrackSimSGToRawHitsTool.h:91
AthAlgTool.h
FPGATrackSimEventInputHeader
Definition: FPGATrackSimEventInputHeader.h:22
FPGATrackSimOfflineTrack
Definition: FPGATrackSimOfflineTrack.h:12
FPGATrackSimSGToRawHitsTool::m_PIX_mgr
const InDetDD::SiDetectorManager * m_PIX_mgr
Definition: FPGATrackSimSGToRawHitsTool.h:90
FPGATrackSimSGToRawHitsTool::m_pixelRDOKey
SG::ReadHandleKey< PixelRDO_Container > m_pixelRDOKey
Definition: FPGATrackSimSGToRawHitsTool.h:69
FPGATrackSimSGToRawHitsTool::m_sctClusterContainerKey
SG::ReadHandleKey< InDet::SiClusterContainer > m_sctClusterContainerKey
Definition: FPGATrackSimSGToRawHitsTool.h:63
FPGATrackSimSGToRawHitsTool::m_mcCollectionKey
SG::ReadHandleKey< McEventCollection > m_mcCollectionKey
Definition: FPGATrackSimSGToRawHitsTool.h:66
FPGATrackSimSGToRawHitsTool::finalize
virtual StatusCode finalize() override
Definition: FPGATrackSimSGToRawHitsTool.cxx:87
PixelClusterContainer.h
FPGATrackSimSGToRawHitsTool::m_pixelSDOKey
SG::ReadHandleKey< InDetSimDataCollection > m_pixelSDOKey
Definition: FPGATrackSimSGToRawHitsTool.h:67
FPGATrackSimSGToRawHitsTool::readStripSimulation
StatusCode readStripSimulation(HitIndexMap &hitIndexMap, unsigned int &hitIndex, const EventContext &eventContext)
Definition: FPGATrackSimSGToRawHitsTool.cxx:323
FPGATrackSimSGToRawHitsTool::m_tracksTruthName
Gaudi::Property< std::string > m_tracksTruthName
Definition: FPGATrackSimSGToRawHitsTool.h:76
FPGATrackSimSGToRawHitsTool::readOfflineClusters
StatusCode readOfflineClusters(std::vector< FPGATrackSimCluster > &Clusters, const EventContext &eventContext)
Definition: FPGATrackSimSGToRawHitsTool.cxx:534
PixelRDO_Container.h
EventInfo.h
FPGATrackSimSGToRawHitsTool::m_sctId
const SCT_ID * m_sctId
Definition: FPGATrackSimSGToRawHitsTool.h:88
SG::ReadCondHandleKey< InDet::BeamSpotData >
SiClusterContainer.h
FPGATrackSimSGToRawHitsTool::FPGATrackSimSGToRawHitsTool
FPGATrackSimSGToRawHitsTool(const std::string &, const std::string &, const IInterface *)
Definition: FPGATrackSimSGToRawHitsTool.cxx:49
SCT_ID
Definition: SCT_ID.h:68
ITruthToTrack.h
FPGATrackSimSGToRawHitsTool::readOfflineTracks
StatusCode readOfflineTracks(std::vector< FPGATrackSimOfflineTrack > &Track, const EventContext &eventContext)
Definition: FPGATrackSimSGToRawHitsTool.cxx:143
InDetSimDataCollection.h
FPGATrackSimSGToRawHitsTool::m_eventHeader
FPGATrackSimEventInputHeader * m_eventHeader
Definition: FPGATrackSimSGToRawHitsTool.h:105
FPGATrackSimSGToRawHitsTool::readPixelSimulation
StatusCode readPixelSimulation(HitIndexMap &hitIndexMap, unsigned int &hitIndex, const EventContext &eventContext)
Definition: FPGATrackSimSGToRawHitsTool.cxx:223
InDetDD::SiDetectorManager
Definition: SiDetectorManager.h:60
FPGATrackSimSGToRawHitsTool::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Definition: FPGATrackSimSGToRawHitsTool.h:60
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
BeamSpotData.h
SiDetectorManager.h
FPGATrackSimSGToRawHitsTool::getTruthInformation
const HepMcParticleLink * getTruthInformation(InDetSimDataCollection::const_iterator &iter, FPGATrackSimInputUtils::ParentBitmask &parentMask)
Definition: FPGATrackSimSGToRawHitsTool.cxx:819
FPGATrackSimSGToRawHitsTool::initialize
virtual StatusCode initialize() override
Definition: FPGATrackSimSGToRawHitsTool.cxx:53
FPGATrackSimSGToRawHitsTool::m_dumpHitsOnTracks
Gaudi::Property< bool > m_dumpHitsOnTracks
Definition: FPGATrackSimSGToRawHitsTool.h:77
PixelID
Definition: PixelID.h:67
FPGATrackSimSGToRawHitsTool::m_stripRDOKey
SG::ReadHandleKey< SCT_RDO_Container > m_stripRDOKey
Definition: FPGATrackSimSGToRawHitsTool.h:70
FPGATrackSimSGToRawHitsTool::readData
virtual StatusCode readData(FPGATrackSimEventInputHeader *header, const EventContext &eventContext) override
This function get from the SG the inner detector raw hits and prepares them for FPGATrackSim simulati...
Definition: FPGATrackSimSGToRawHitsTool.cxx:94
TrackParticleContainer.h
index_type
unsigned int index_type
Definition: FPGATrackSimSGToRawHitsTool.h:37
FPGATrackSimSGToRawHitsTool::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
ToolHandle for Extrapolator.
Definition: FPGATrackSimSGToRawHitsTool.h:58