ATLAS Offline Software
Loading...
Searching...
No Matches
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"
23
29
32
33
38
39typedef unsigned int index_type;
40
45class FPGATrackSimSGToRawHitsTool : public extends<AthAlgTool, IFPGATrackSimInputTool> {
46
47public:
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
56private:
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", "ITkStripClusters" };
64
65 SG::ReadHandleKey<xAOD::TrackParticleContainer> m_offlineTracksKey { this, "OfflineTracks", "InDetTrackParticles"};
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", 5.0 };
84 Gaudi::Property<double> m_minPt { this, "minPt", .8*CLHEP::GeV };
85 Gaudi::Property<bool> m_doMultiTruth { this, "doMultiTruth", true };
86
87 //internal pointers
88 const PixelID* m_pixelId = nullptr;
89 const SCT_ID* m_sctId = nullptr;
90
93 const HepPDT::ParticleDataTable* m_particleDataTable = nullptr;
94
95 typedef std::map<Identifier, int> HitIndexMap;
96 StatusCode readRawSilicon(HitIndexMap& hitIndexMap, const EventContext& eventContext); // dump raw silicon data to text file and populate hitIndexMap for rec. track processing
97 StatusCode readTruthTracks(std::vector<FPGATrackSimTruthTrack>& truth, const EventContext& eventContext);
98 StatusCode readOfflineTracks(std::vector<FPGATrackSimOfflineTrack>& Track, const EventContext& eventContext);
99 StatusCode readOfflineClusters(std::vector<FPGATrackSimCluster>& Clusters, const EventContext& eventContext);
100 StatusCode readPixelSimulation(HitIndexMap& hitIndexMap, unsigned int& hitIndex, const EventContext& eventContext);
101 StatusCode readStripSimulation(HitIndexMap& hitIndexMap, unsigned int& hitIndex, const EventContext& eventContext);
102 StatusCode dumpPixelClusters(HitIndexMap& pixelClusterIndexMap, const EventContext& eventContext);
103
104 // To get truth information from simulation
105 const HepMcParticleLink* getTruthInformation(InDetSimDataCollection::const_iterator& iter, FPGATrackSimInputUtils::ParentBitmask& parentMask);
107};
108
109
110
111#endif
unsigned int index_type
Extrapolation for HepMC particles.
This is an Identifier helper class for the Pixel subdetector.
This is an Identifier helper class for the SCT subdetector.
SG::ReadHandleKey< InDet::SiClusterContainer > m_pixelClusterContainerKey
Gaudi::Property< bool > m_readOfflineTracks
StatusCode readRawSilicon(HitIndexMap &hitIndexMap, const EventContext &eventContext)
ToolHandle< Trk::ITruthToTrack > m_truthToTrack
tool to create track parameters from a gen particle
StatusCode readPixelSimulation(HitIndexMap &hitIndexMap, unsigned int &hitIndex, const EventContext &eventContext)
const InDetDD::SiDetectorManager * m_SCT_mgr
SG::ReadHandleKey< InDetSimDataCollection > m_stripSDOKey
const HepMcParticleLink * getTruthInformation(InDetSimDataCollection::const_iterator &iter, FPGATrackSimInputUtils::ParentBitmask &parentMask)
SG::ReadHandleKey< SCT_RDO_Container > m_stripRDOKey
StatusCode dumpPixelClusters(HitIndexMap &pixelClusterIndexMap, const EventContext &eventContext)
Gaudi::Property< bool > m_readOfflineClusters
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
StatusCode readOfflineClusters(std::vector< FPGATrackSimCluster > &Clusters, const EventContext &eventContext)
StatusCode readStripSimulation(HitIndexMap &hitIndexMap, unsigned int &hitIndex, const EventContext &eventContext)
Gaudi::Property< std::string > m_tracksTruthName
const InDetDD::SiDetectorManager * m_PIX_mgr
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_offlineTracksKey
ToolHandle< Trk::IExtrapolator > m_extrapolator
ToolHandle for Extrapolator.
FPGATrackSimEventInputHeader * m_eventHeader
std::map< Identifier, int > HitIndexMap
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
SG::ReadHandleKey< InDet::SiClusterContainer > m_sctClusterContainerKey
Gaudi::Property< bool > m_readTruthTracks
virtual StatusCode finalize() override
SG::ReadHandleKey< PixelRDO_Container > m_pixelRDOKey
FPGATrackSimSGToRawHitsTool(const std::string &, const std::string &, const IInterface *)
Gaudi::Property< bool > m_UseNominalOrigin
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...
Gaudi::Property< bool > m_dumpTruthIntersections
StatusCode readOfflineTracks(std::vector< FPGATrackSimOfflineTrack > &Track, const EventContext &eventContext)
StatusCode readTruthTracks(std::vector< FPGATrackSimTruthTrack > &truth, const EventContext &eventContext)
Gaudi::Property< bool > m_dumpHitsOnTracks
SG::ReadHandleKey< McEventCollection > m_mcCollectionKey
const HepPDT::ParticleDataTable * m_particleDataTable
SG::ReadHandleKey< InDetSimDataCollection > m_pixelSDOKey
virtual StatusCode initialize() override
Base class for Pixel and SCT Detector managers.
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:67
This is an Identifier helper class for the SCT subdetector.
Definition SCT_ID.h:68
Property holding a SG store/key/clid from which a ReadHandle is made.
std::bitset< NBITS > ParentBitmask