ATLAS Offline Software
SiSmearedDigitizationTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // SiSmearedDigitizationTool.h
7 // Header file for class SiSmearedDigitizationTool
9 // (c) ATLAS Detector software
11 // Top algorithm class for Pixel fast smeared digitization
13 
14 #ifndef FASTSIDIGITIZATION_SISMEAREDDIGITIZATIONTOOL_H
15 #define FASTSIDIGITIZATION_SISMEAREDDIGITIZATIONTOOL_H
16 
18 
19 #include "GaudiKernel/ToolHandle.h"
20 #include "GaudiKernel/ServiceHandle.h"
21 #include "GaudiKernel/AlgTool.h"
25 #include <string>
26 
28 #include "InDetSimEvent/SiHit.h"
30 
31 #include "InDetPrepRawData/SCT_ClusterContainer.h" // typedef
33 
35 
37 #include "GaudiKernel/ITHistSvc.h"
39 
42 
43 #include <tuple>
44 typedef std::tuple< Amg::Vector2D, InDet::SiWidth, Amg::MatrixX> ClusterInfo;
45 
46 class PixelID;
47 class SCT_ID;
48 class TTree;
49 class TFile;
50 
51 namespace InDetDD{class SiDetectorElement;}
52 namespace CLHEP {class HepRandomEngine;}
53 
54 namespace InDet {
55  class ClusterMakerTool;
56  class PixelCluster;
57  class SCT_Cluster;
58  class SiCluster;
59 }
60 
62 {
63 
64 public:
65 
68  const std::string& type,
69  const std::string& name,
70  const IInterface* parent
71  );
72 
73 
75  StatusCode prepareEvent(const EventContext& ctx, unsigned int);
76  StatusCode processBunchXing( int bunchXing,
77  SubEventIterator bSubEvents,
78  SubEventIterator eSubEvents );
79  StatusCode processAllSubEvents(const EventContext& ctx);
80  StatusCode mergeEvent(const EventContext& ctx);
81 
82  typedef std::multimap<IdentifierHash, InDet::PixelCluster*> Pixel_detElement_RIO_map;
83  typedef std::multimap<IdentifierHash, InDet::SCT_Cluster*> SCT_detElement_RIO_map;
86 
87  StatusCode digitize(const EventContext& ctx,
89  StatusCode createAndStoreRIOs(const EventContext& ctx);
92 
93  template<typename CLUSTER>
94  double calculateDistance(CLUSTER * clusterA, CLUSTER * clusterB);
95 
96  template<typename CLUSTER>
97  double calculateSigma(CLUSTER * clusterA, CLUSTER * clusterB);
98 
99  template<typename CLUSTER>
100  ClusterInfo calculateNewCluster(CLUSTER * clusterA, CLUSTER * clusterB);
101 
102  template<typename CLUSTER>
104 
105  private:
106 
107  ServiceHandle<IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc", ""};
108 
109  SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_pixelDetEleCollKey{this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"};
110  SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
111 
113  const SCT_ID* m_sct_ID;
114 
115  std::string m_randomEngineName;
116 
117  float m_pitch_X;
118  float m_pitch_Y;
119 
120  bool m_merge;
121  double m_nSigma;
122 
124 
126 
128 
132 
134  std::string m_prdTruthNamePixel;
135 
137  std::string m_prdTruthNameSCT;
138 
140  std::string m_inputObjectName;
141 
142  std::vector<SiHitCollection*> m_siHitCollList;
143 
145 
147 
149 
151 
153  std::string m_Sct_SiClustersName;
154 
156 
157  ServiceHandle<ITHistSvc> m_thistSvc{this, "THistSvc", "THistSvc"};
158  TFile* m_outputFile;
159  TTree* m_currentTree;
160 
161  double m_x_pixel;
162  double m_y_pixel;
172 
173  double m_x_SCT;
174  double m_x_exit_SCT;
175  double m_y_exit_SCT;
176  double m_z_exit_SCT;
183 
187 
190  double m_Err_x_SCT;
191  double m_Err_y_SCT;
192 
193 
196 
198 
199 
200 };
201 
202 #endif // SISMEAREDDDIGITIZATION_SISMEAREDDIGITIZATIONTOOL_H
SiSmearedDigitizationTool::m_y_entry_pixel
double m_y_entry_pixel
Definition: SiSmearedDigitizationTool.h:167
SiSmearedDigitizationTool::m_z_exit_SCT
double m_z_exit_SCT
Definition: SiSmearedDigitizationTool.h:176
SiSmearedDigitizationTool
Definition: SiSmearedDigitizationTool.h:62
SiSmearedDigitizationTool::m_pitch_Y
float m_pitch_Y
Definition: SiSmearedDigitizationTool.h:118
SiSmearedDigitizationTool::m_x_pixel_global
double m_x_pixel_global
Definition: SiSmearedDigitizationTool.h:169
SiSmearedDigitizationTool::m_HardScatterSplittingSkipper
bool m_HardScatterSplittingSkipper
Definition: SiSmearedDigitizationTool.h:131
PixelCluster
Definition: Trigger/TrigAccel/TrigCudaFitter/src/PixelCluster.h:8
SiSmearedDigitizationTool::m_pitch_X
float m_pitch_X
Definition: SiSmearedDigitizationTool.h:117
SiSmearedDigitizationTool::mergeClusters
StatusCode mergeClusters(SCT_detElement_RIO_map *cluster_map)
SiSmearedDigitizationTool::retrieveTruth
StatusCode retrieveTruth()
Definition: SiSmearedDigitizationTool.cxx:439
SiSmearedDigitizationTool::m_x_exit_SCT
double m_x_exit_SCT
Definition: SiSmearedDigitizationTool.h:174
SiSmearedDigitizationTool::m_checkSmear
bool m_checkSmear
Definition: SiSmearedDigitizationTool.h:155
SiSmearedDigitizationTool::m_SmearPixel
bool m_SmearPixel
Definition: SiSmearedDigitizationTool.h:148
SiSmearedDigitizationTool::m_z_exit_pixel
double m_z_exit_pixel
Definition: SiSmearedDigitizationTool.h:165
SiHit.h
SiSmearedDigitizationTool::FillTruthMap
StatusCode FillTruthMap(PRD_MultiTruthCollection *, CLUSTER *, const TimedHitPtr< SiHit > &)
Definition: SiSmearedDigitizationTool.cxx:479
SiSmearedDigitizationTool::m_pixelClusterContainer
InDet::PixelClusterContainer * m_pixelClusterContainer
the PixelClusterContainer
Definition: SiSmearedDigitizationTool.h:125
SiSmearedDigitizationTool::m_merge
bool m_merge
Definition: SiSmearedDigitizationTool.h:120
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
PRD_MultiTruthCollection
A PRD is mapped onto all contributing particles.
Definition: PRD_MultiTruthCollection.h:24
SiSmearedDigitizationTool::m_pixelClusterMap
Pixel_detElement_RIO_map * m_pixelClusterMap
Definition: SiSmearedDigitizationTool.h:144
SiSmearedDigitizationTool::m_thistSvc
ServiceHandle< ITHistSvc > m_thistSvc
Definition: SiSmearedDigitizationTool.h:157
AtlasHitsVector
Definition: AtlasHitsVector.h:33
SiSmearedDigitizationTool::calculateSigma
double calculateSigma(CLUSTER *clusterA, CLUSTER *clusterB)
Definition: SiSmearedDigitizationTool.cxx:521
SiCluster
Definition: Trigger/TrigAccel/TrigCudaFitter/src/SiCluster.h:9
SiSmearedDigitizationTool::m_mergeSvc
ServiceHandle< PileUpMergeSvc > m_mergeSvc
PileUp Merge service.
Definition: SiSmearedDigitizationTool.h:129
SiSmearedDigitizationTool::m_z_SCT_global
double m_z_SCT_global
Definition: SiSmearedDigitizationTool.h:182
SiSmearedDigitizationTool::operator=
SiSmearedDigitizationTool & operator=(const SiSmearedDigitizationTool &)
InDet::SCT_ClusterContainer
Trk::PrepRawDataContainer< SCT_ClusterCollection > SCT_ClusterContainer
Definition: SCT_ClusterContainer.h:27
SiSmearedDigitizationTool::m_pixelDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
Definition: SiSmearedDigitizationTool.h:109
SiSmearedDigitizationTool::calculateDistance
double calculateDistance(CLUSTER *clusterA, CLUSTER *clusterB)
Definition: SiSmearedDigitizationTool.cxx:503
SiSmearedDigitizationTool::calculateNewCluster
ClusterInfo calculateNewCluster(CLUSTER *clusterA, CLUSTER *clusterB)
Definition: SiSmearedDigitizationTool.cxx:538
SiSmearedDigitizationTool::m_y_SCT_global
double m_y_SCT_global
Definition: SiSmearedDigitizationTool.h:181
TimedHitPtr< SiHit >
InDet::PixelClusterContainer
Trk::PrepRawDataContainer< PixelClusterCollection > PixelClusterContainer
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelClusterContainer.h:28
SiSmearedDigitizationTool::m_Err_y_SCT
double m_Err_y_SCT
Definition: SiSmearedDigitizationTool.h:191
SiSmearedDigitizationTool::SiSmearedDigitizationTool
SiSmearedDigitizationTool()
SiSmearedDigitizationTool::mergeClusters
StatusCode mergeClusters(Pixel_detElement_RIO_map *cluster_map)
Definition: SiSmearedDigitizationTool.cxx:583
SiSmearedDigitizationTool::m_sctClusterContainer
InDet::SCT_ClusterContainer * m_sctClusterContainer
the SCT_ClusterContainer
Definition: SiSmearedDigitizationTool.h:127
SCT_Cluster
Definition: Trigger/TrigAccel/TrigCudaFitter/src/SCT_Cluster.h:8
SiSmearedDigitizationTool::processBunchXing
StatusCode processBunchXing(int bunchXing, SubEventIterator bSubEvents, SubEventIterator eSubEvents)
Definition: SiSmearedDigitizationTool.cxx:273
SiSmearedDigitizationTool::m_Err_y_pixel
double m_Err_y_pixel
Definition: SiSmearedDigitizationTool.h:189
SiSmearedDigitizationTool::m_x_pixel
double m_x_pixel
Definition: SiSmearedDigitizationTool.h:161
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
SiSmearedDigitizationTool::m_randomEngineName
std::string m_randomEngineName
Name of the random number stream.
Definition: SiSmearedDigitizationTool.h:115
SiSmearedDigitizationTool::SiSmearedDigitizationTool
SiSmearedDigitizationTool(const SiSmearedDigitizationTool &)
SiSmearedDigitizationTool::m_x_SCT_smeared
double m_x_SCT_smeared
Definition: SiSmearedDigitizationTool.h:186
SiSmearedDigitizationTool::m_useDiscSurface
bool m_useDiscSurface
Definition: SiSmearedDigitizationTool.h:123
SiSmearedDigitizationTool::initialize
StatusCode initialize()
Definition: SiSmearedDigitizationTool.cxx:135
SiSmearedDigitizationTool::m_sctClusterMap
SCT_detElement_RIO_map * m_sctClusterMap
Definition: SiSmearedDigitizationTool.h:146
SiSmearedDigitizationTool::m_z_entry_SCT
double m_z_entry_SCT
Definition: SiSmearedDigitizationTool.h:179
SiSmearedDigitizationTool::digitize
StatusCode digitize(const EventContext &ctx, TimedHitCollection< SiHit > &thpcsi)
Definition: SiSmearedDigitizationTool.cxx:717
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CLHEP
STD'S.
Definition: IAtRndmGenSvc.h:19
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TimedHitCollection.h
SiSmearedDigitizationTool::finalize
StatusCode finalize()
Definition: SiSmearedDigitizationTool.cxx:243
SiSmearedDigitizationTool::m_y_pixel_smeared
double m_y_pixel_smeared
Definition: SiSmearedDigitizationTool.h:185
SiSmearedDigitizationTool::processAllSubEvents
StatusCode processAllSubEvents(const EventContext &ctx)
Definition: SiSmearedDigitizationTool.cxx:314
SiSmearedDigitizationTool::SCT_detElement_RIO_map
std::multimap< IdentifierHash, InDet::SCT_Cluster * > SCT_detElement_RIO_map
Definition: SiSmearedDigitizationTool.h:83
SiSmearedDigitizationTool::m_z_entry_pixel
double m_z_entry_pixel
Definition: SiSmearedDigitizationTool.h:168
PileUpToolBase
Definition: PileUpToolBase.h:18
SiSmearedDigitizationTool::m_x_entry_SCT
double m_x_entry_SCT
Definition: SiSmearedDigitizationTool.h:177
SiSmearedDigitizationTool::m_y_pixel_global
double m_y_pixel_global
Definition: SiSmearedDigitizationTool.h:170
SiSmearedDigitizationTool::m_y_exit_pixel
double m_y_exit_pixel
Definition: SiSmearedDigitizationTool.h:164
SiSmearedDigitizationTool::m_SCTDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
Definition: SiSmearedDigitizationTool.h:110
ReadCondHandleKey.h
SiSmearedDigitizationTool::createAndStoreRIOs
StatusCode createAndStoreRIOs(const EventContext &ctx)
Definition: SiSmearedDigitizationTool.cxx:1125
SiSmearedDigitizationTool::m_prdTruthNamePixel
std::string m_prdTruthNamePixel
Definition: SiSmearedDigitizationTool.h:134
SiSmearedDigitizationTool::m_pixelPrdTruth
PRD_MultiTruthCollection * m_pixelPrdTruth
Definition: SiSmearedDigitizationTool.h:133
EventPrimitives.h
SiSmearedDigitizationTool::m_simHitColl
SiHitCollection * m_simHitColl
Definition: SiSmearedDigitizationTool.h:139
EventAuxInfo.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
PixelClusterContainer.h
SiSmearedDigitizationTool::m_Err_x_pixel
double m_Err_x_pixel
Definition: SiSmearedDigitizationTool.h:188
SiSmearedDigitizationTool::m_HardScatterSplittingMode
int m_HardScatterSplittingMode
Process all SiHit or just those from signal or background events.
Definition: SiSmearedDigitizationTool.h:130
SiSmearedDigitizationTool::m_siHitCollList
std::vector< SiHitCollection * > m_siHitCollList
name of the sub event hit collections.
Definition: SiSmearedDigitizationTool.h:142
SiSmearedDigitizationTool::m_emulateAtlas
bool m_emulateAtlas
Definition: SiSmearedDigitizationTool.h:150
SiDetectorElementCollection.h
SiSmearedDigitizationTool::m_z_pixel_global
double m_z_pixel_global
Definition: SiSmearedDigitizationTool.h:171
SiSmearedDigitizationTool::m_currentTree
TTree * m_currentTree
the tree to store information from pixel and SCT (before and after smearing)
Definition: SiSmearedDigitizationTool.h:159
EventInfo.h
SiSmearedDigitizationTool::m_inputObjectName
std::string m_inputObjectName
Definition: SiSmearedDigitizationTool.h:140
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection >
SiSmearedDigitizationTool::m_pixel_SiClustersName
std::string m_pixel_SiClustersName
Definition: SiSmearedDigitizationTool.h:152
SCT_ID
Definition: SCT_ID.h:68
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
SiSmearedDigitizationTool::m_rndmSvc
ServiceHandle< IAthRNGSvc > m_rndmSvc
Random number service.
Definition: SiSmearedDigitizationTool.h:107
SiSmearedDigitizationTool::m_y_exit_SCT
double m_y_exit_SCT
Definition: SiSmearedDigitizationTool.h:175
InDetSimDataCollection.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
SiSmearedDigitizationTool::m_Err_x_SCT
double m_Err_x_SCT
Definition: SiSmearedDigitizationTool.h:190
SiSmearedDigitizationTool::m_x_SCT
double m_x_SCT
Definition: SiSmearedDigitizationTool.h:173
SCT_ClusterContainer.h
PRD_MultiTruthCollection.h
SiSmearedDigitizationTool::m_Sct_SiClustersName
std::string m_Sct_SiClustersName
Definition: SiSmearedDigitizationTool.h:153
SubEventIterator
std::vector< xAOD::EventInfo::SubEvent >::const_iterator SubEventIterator
Definition: IPileUpTool.h:22
SiSmearedDigitizationTool::m_x_SCT_global
double m_x_SCT_global
Definition: SiSmearedDigitizationTool.h:180
SiSmearedDigitizationTool::m_x_entry_pixel
double m_x_entry_pixel
Definition: SiSmearedDigitizationTool.h:166
SiSmearedDigitizationTool::prepareEvent
StatusCode prepareEvent(const EventContext &ctx, unsigned int)
Definition: SiSmearedDigitizationTool.cxx:261
SiSmearedDigitizationTool::m_pixel_ID
const PixelID * m_pixel_ID
Handle to the ID helper.
Definition: SiSmearedDigitizationTool.h:112
SiSmearedDigitizationTool::m_y_pixel
double m_y_pixel
Definition: SiSmearedDigitizationTool.h:162
SiSmearedDigitizationTool::m_x_pixel_smeared
double m_x_pixel_smeared
Definition: SiSmearedDigitizationTool.h:184
SiSmearedDigitizationTool::m_sct_ID
const SCT_ID * m_sct_ID
Handle to the ID helper.
Definition: SiSmearedDigitizationTool.h:113
PixelID
Definition: PixelID.h:67
PileUpToolBase.h
helper base class IPileUpTool::toProcess().
SiSmearedDigitizationTool::mergeEvent
StatusCode mergeEvent(const EventContext &ctx)
Definition: SiSmearedDigitizationTool.cxx:494
SiSmearedDigitizationTool::m_nSigma
double m_nSigma
Definition: SiSmearedDigitizationTool.h:121
SiSmearedDigitizationTool::Pixel_detElement_RIO_map
std::multimap< IdentifierHash, InDet::PixelCluster * > Pixel_detElement_RIO_map
Definition: SiSmearedDigitizationTool.h:82
SiSmearedDigitizationTool::m_y_entry_SCT
double m_y_entry_SCT
Definition: SiSmearedDigitizationTool.h:178
TimedHitCollection< SiHit >
SiSmearedDigitizationTool::m_outputFile
TFile * m_outputFile
the root file
Definition: SiSmearedDigitizationTool.h:158
SiSmearedDigitizationTool::m_SCTPrdTruth
PRD_MultiTruthCollection * m_SCTPrdTruth
Definition: SiSmearedDigitizationTool.h:136
IAthRNGSvc.h
ServiceHandle< IAthRNGSvc >
ClusterInfo
std::tuple< Amg::Vector2D, InDet::SiWidth, Amg::MatrixX > ClusterInfo
Definition: SiSmearedDigitizationTool.h:44
SiSmearedDigitizationTool::m_prdTruthNameSCT
std::string m_prdTruthNameSCT
Definition: SiSmearedDigitizationTool.h:137
SiSmearedDigitizationTool::m_x_exit_pixel
double m_x_exit_pixel
Definition: SiSmearedDigitizationTool.h:163
SiHitCollection.h