ATLAS Offline Software
SCT_FastDigitizationTool.h
Go to the documentation of this file.
1 /* -*- C++ -*- */
2 
3 
4 /*
5  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
6 */
7 
8 #ifndef FASTSIDIGITZATION_SCT_FASTDIGITZATIONTOOL_H
9 #define FASTSIDIGITZATION_SCT_FASTDIGITZATIONTOOL_H
10 
17 
19 #include "InDetSimEvent/SiHit.h"
21 
22 #include "InDetPrepRawData/SCT_ClusterContainer.h" // typedef
24 
26 
28 
30 #include "StoreGate/WriteHandle.h"
32 
35 
36 // Gaudi
37 #include "GaudiKernel/ToolHandle.h"
38 #include "GaudiKernel/ServiceHandle.h"
39 #include "GaudiKernel/AlgTool.h"
40 
41 #include <vector>
42 #include <utility> /* pair */
43 #include <map>
44 #include <string>
45 
46 //FIXME - not used anywhere?
47 // #ifndef MAXSTEPS
48 // #define MAXSTEPS 15
49 // #endif
50 
51 // #ifndef MAXDRIFTSTEPS
52 // #define MAXDRIFTSTEPS 15
53 // #endif
54 
55 
57 
58 class SCT_ID;
59 
61 class StoreGateService;
62 
63 namespace InDet {
64  class ClusterMakerTool;
65  class SCT_Cluster;
66  class SiCluster;
67 }
68 
69 namespace CLHEP
70 {
71  class HepRandomEngine;
72 }
73 
74 namespace Trk {
75  class Surface;
76 }
77 
78 namespace CLHEP {
79  class HepSymMatrix ;
80 }
81 
83  virtual public PileUpToolBase
84 {
85 
86 public:
87  SCT_FastDigitizationTool(const std::string& type,
88  const std::string& name,
89  const IInterface* parent);
93  virtual StatusCode initialize();
94  StatusCode prepareEvent(const EventContext& ctx, unsigned int );
95  StatusCode processBunchXing( int bunchXing,
96  SubEventIterator bSubEvents,
97  SubEventIterator eSubEvents );
98  StatusCode mergeEvent(const EventContext& ctx);
99  StatusCode processAllSubEvents(const EventContext& ctx);
100  StatusCode createAndStoreRIOs(const EventContext& ctx);
101 
102 private:
103 
104  StatusCode digitize(const EventContext& ctx,
105  TimedHitCollection<SiHit>& thpcsi);
106  bool NeighbouringClusters(const std::vector<Identifier>& potentialClusterRDOList, const InDet::SCT_Cluster *existingCluster) const;
107  static void Diffuse(HepGeom::Point3D<double>& localEntry, HepGeom::Point3D<double>& localExit, double shiftX, double shiftY ) ;
108 
109  StringProperty m_inputObjectName{this, "InputObjectName", "SCT_Hits", "Input Object name"};
110 
111  std::vector<SiHitCollection*> m_siHitCollList;
112 
113  const SCT_ID* m_sct_ID{};
114  ServiceHandle<PileUpMergeSvc> m_mergeSvc{this, "MergeSvc", "PileUpMergeSvc", "Merge service"};
115  IntegerProperty m_HardScatterSplittingMode{this, "HardScatterSplittingMode", 0, "Control pileup & signal splitting"};
117 
118  ServiceHandle<IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc", ""};
119  StringProperty m_randomEngineName{this, "RndmEngine", "FastSCT_Digitization"};
120 
122 
123  PublicToolHandle<InDet::ClusterMakerTool> m_clusterMaker{this, "ClusterMaker", "InDet::ClusterMakerTool"};
124  ToolHandle<ISiLorentzAngleTool> m_lorentzAngleTool{this, "LorentzAngleTool", "SiLorentzAngleTool/SCTLorentzAngleTool", "Tool to retreive Lorentz angle"};
125 
126  typedef std::multimap<IdentifierHash, InDet::SCT_Cluster*> SCT_detElement_RIO_map;
128 
129  SG::WriteHandleKey<InDet::SCT_ClusterContainer> m_sctClusterContainerKey{this, "SCT_ClusterContainerName", "SCT_Clusters"};
130  SG::WriteHandleKey<PRD_MultiTruthCollection> m_sctPrdTruthKey{this, "TruthNameSCT", "PRD_MultiTruthSCT"};
131  SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
132 
133  DoubleProperty m_sctSmearPathLength{this, "SCT_SmearPathSigma", 0.01};
134  BooleanProperty m_sctSmearLandau{this, "SCT_SmearLandau", true};
135  BooleanProperty m_sctEmulateSurfaceCharge{this, "EmulateSurfaceCharge", true};
136  DoubleProperty m_sctTanLorentzAngleScalor{this, "SCT_ScaleTanLorentzAngle", 1.};
137  BooleanProperty m_sctAnalogStripClustering{this, "SCT_AnalogClustering", false};
138  IntegerProperty m_sctErrorStrategy{this, "SCT_ErrorStrategy", 2};
139  BooleanProperty m_sctRotateEC{this, "SCT_RotateEndcapClusters", true};
140 
141  bool m_mergeCluster{true};
142  DoubleProperty m_DiffusionShiftX_barrel{this, "DiffusionShiftX_barrel",4 };
143  DoubleProperty m_DiffusionShiftY_barrel{this, "DiffusionShiftY_barrel", 4};
144  DoubleProperty m_DiffusionShiftX_endcap{this, "DiffusionShiftX_endcap", 15};
145  DoubleProperty m_DiffusionShiftY_endcap{this, "DiffusionShiftY_endcap", 15};
146  DoubleProperty m_sctMinimalPathCut{this, "SCT_MinimalPathLength", 90.};
147 
149  //const Trk::Surface& surface,
150  double localStartX, double localStartY,
151  double localEndX, double localEndY,
152  double slopeYX,
153  double slopeZX,
154  const Amg::Vector2D& stripCenter,
155  int direction) ;
156 
157 
158 
159 
160 };
161 #endif // FASTSIDIGITZATION_SCT_FASTDIGITZATIONTOOL_H
SCT_FastDigitizationTool::m_sctPrdTruthKey
SG::WriteHandleKey< PRD_MultiTruthCollection > m_sctPrdTruthKey
the PRD truth map for SCT measurements
Definition: SCT_FastDigitizationTool.h:130
SCT_FastDigitizationTool::m_DiffusionShiftY_endcap
DoubleProperty m_DiffusionShiftY_endcap
Definition: SCT_FastDigitizationTool.h:145
SCT_FastDigitizationTool::Diffuse
static void Diffuse(HepGeom::Point3D< double > &localEntry, HepGeom::Point3D< double > &localExit, double shiftX, double shiftY)
Definition: SCT_FastDigitizationTool.cxx:1026
SCT_FastDigitizationTool::mergeEvent
StatusCode mergeEvent(const EventContext &ctx)
Definition: SCT_FastDigitizationTool.cxx:205
SCT_FastDigitizationTool::m_SCTDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
Definition: SCT_FastDigitizationTool.h:131
SiHit.h
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
SCT_FastDigitizationTool::m_sctAnalogStripClustering
BooleanProperty m_sctAnalogStripClustering
not being done in ATLAS: analog strip clustering
Definition: SCT_FastDigitizationTool.h:137
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
SCT_FastDigitizationTool::stepToStripBorder
static Amg::Vector3D stepToStripBorder(const InDetDD::SiDetectorElement &sidetel, double localStartX, double localStartY, double localEndX, double localEndY, double slopeYX, double slopeZX, const Amg::Vector2D &stripCenter, int direction)
Definition: SCT_FastDigitizationTool.cxx:946
SCT_FastDigitizationTool::m_mergeSvc
ServiceHandle< PileUpMergeSvc > m_mergeSvc
PileUp Merge service.
Definition: SCT_FastDigitizationTool.h:114
SiCluster
Definition: Trigger/TrigAccel/TrigCudaFitter/src/SiCluster.h:9
Surface
Definition: Trigger/TrigAccel/TrigCudaFitter/src/Surface.h:8
InDetSimDataCollection
Definition: InDetSimDataCollection.h:25
ISiLorentzAngleTool.h
SCT_FastDigitizationTool::m_thpcsi
TimedHitCollection< SiHit > * m_thpcsi
Definition: SCT_FastDigitizationTool.h:121
SCT_FastDigitizationTool::createAndStoreRIOs
StatusCode createAndStoreRIOs(const EventContext &ctx)
Definition: SCT_FastDigitizationTool.cxx:891
SCT_FastDigitizationTool::m_inputObjectName
StringProperty m_inputObjectName
Definition: SCT_FastDigitizationTool.h:109
SCT_FastDigitizationTool::m_lorentzAngleTool
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
Definition: SCT_FastDigitizationTool.h:124
SCT_FastDigitizationTool::prepareEvent
StatusCode prepareEvent(const EventContext &ctx, unsigned int)
Definition: SCT_FastDigitizationTool.cxx:104
SCT_FastDigitizationTool::m_sctSmearLandau
BooleanProperty m_sctSmearLandau
if true : landau else: gauss
Definition: SCT_FastDigitizationTool.h:134
SCT_Cluster
Definition: Trigger/TrigAccel/TrigCudaFitter/src/SCT_Cluster.h:8
WriteHandle.h
Handle class for recording to StoreGate.
SG::WriteHandleKey< InDet::SCT_ClusterContainer >
SCT_FastDigitizationTool::m_sctClusterContainerKey
SG::WriteHandleKey< InDet::SCT_ClusterContainer > m_sctClusterContainerKey
the SCT_ClusterContainer
Definition: SCT_FastDigitizationTool.h:129
SiChargedDiodeCollection
Definition: SiChargedDiodeCollection.h:109
SCT_FastDigitizationTool::m_sctSmearPathLength
DoubleProperty m_sctSmearPathLength
the 2.
Definition: SCT_FastDigitizationTool.h:133
SCT_FastDigitizationTool::m_sctRotateEC
BooleanProperty m_sctRotateEC
Definition: SCT_FastDigitizationTool.h:139
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CLHEP
STD'S.
Definition: IAtRndmGenSvc.h:19
SCT_FastDigitizationTool::initialize
virtual StatusCode initialize()
Called before processing physics events.
Definition: SCT_FastDigitizationTool.cxx:65
SCT_FastDigitizationTool::processBunchXing
StatusCode processBunchXing(int bunchXing, SubEventIterator bSubEvents, SubEventIterator eSubEvents)
Definition: SCT_FastDigitizationTool.cxx:114
SCT_FastDigitizationTool::m_mergeCluster
bool m_mergeCluster
enable the merging of neighbour SCT clusters >
Definition: SCT_FastDigitizationTool.h:141
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TimedHitCollection.h
SCT_FastDigitizationTool::m_DiffusionShiftY_barrel
DoubleProperty m_DiffusionShiftY_barrel
Definition: SCT_FastDigitizationTool.h:143
SCT_FastDigitizationTool::processAllSubEvents
StatusCode processAllSubEvents(const EventContext &ctx)
Definition: SCT_FastDigitizationTool.cxx:155
SCT_FastDigitizationTool::digitize
StatusCode digitize(const EventContext &ctx, TimedHitCollection< SiHit > &thpcsi)
Definition: SCT_FastDigitizationTool.cxx:226
SCT_FastDigitizationTool::m_randomEngineName
StringProperty m_randomEngineName
Name of the random number stream.
Definition: SCT_FastDigitizationTool.h:119
InDet::SCT_Cluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SCT_Cluster.h:34
SCT_FastDigitizationTool::m_HardScatterSplittingSkipper
bool m_HardScatterSplittingSkipper
Definition: SCT_FastDigitizationTool.h:116
SCT_FastDigitizationTool::m_sctEmulateSurfaceCharge
BooleanProperty m_sctEmulateSurfaceCharge
emulate the surface charge
Definition: SCT_FastDigitizationTool.h:135
PileUpToolBase
Definition: PileUpToolBase.h:18
ReadCondHandleKey.h
EventPrimitives.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
SCT_FastDigitizationTool::m_clusterMaker
PublicToolHandle< InDet::ClusterMakerTool > m_clusterMaker
Definition: SCT_FastDigitizationTool.h:123
SCT_FastDigitizationTool::SCT_FastDigitizationTool
SCT_FastDigitizationTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: SCT_FastDigitizationTool.cxx:54
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
SiDetectorElementCollection.h
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection >
SiClusterContainer.h
SCT_FastDigitizationTool
Definition: SCT_FastDigitizationTool.h:84
SCT_ID
Definition: SCT_ID.h:68
SCT_FastDigitizationTool::m_HardScatterSplittingMode
IntegerProperty m_HardScatterSplittingMode
Process all SiHit or just those from signal or background events.
Definition: SCT_FastDigitizationTool.h:115
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
SCT_FastDigitizationTool::m_sctClusterMap
SCT_detElement_RIO_map * m_sctClusterMap
Definition: SCT_FastDigitizationTool.h:127
SCT_ClusterContainer.h
PRD_MultiTruthCollection.h
SubEventIterator
std::vector< xAOD::EventInfo::SubEvent >::const_iterator SubEventIterator
Definition: IPileUpTool.h:22
SCT_FastDigitizationTool::m_siHitCollList
std::vector< SiHitCollection * > m_siHitCollList
name of the sub event hit collections.
Definition: SCT_FastDigitizationTool.h:111
SCT_FastDigitizationTool::SCT_detElement_RIO_map
std::multimap< IdentifierHash, InDet::SCT_Cluster * > SCT_detElement_RIO_map
Definition: SCT_FastDigitizationTool.h:126
PileUpToolBase.h
helper base class IPileUpTool::toProcess().
SCT_FastDigitizationTool::m_sctMinimalPathCut
DoubleProperty m_sctMinimalPathCut
the 1.
Definition: SCT_FastDigitizationTool.h:146
SCT_FastDigitizationTool::NeighbouringClusters
bool NeighbouringClusters(const std::vector< Identifier > &potentialClusterRDOList, const InDet::SCT_Cluster *existingCluster) const
Definition: SCT_FastDigitizationTool.cxx:991
TimedHitCollection< SiHit >
SCT_FastDigitizationTool::m_DiffusionShiftX_endcap
DoubleProperty m_DiffusionShiftX_endcap
Definition: SCT_FastDigitizationTool.h:144
SCT_FastDigitizationTool::m_sct_ID
const SCT_ID * m_sct_ID
Handle to the ID helper.
Definition: SCT_FastDigitizationTool.h:113
SCT_FastDigitizationTool::m_sctTanLorentzAngleScalor
DoubleProperty m_sctTanLorentzAngleScalor
scale the lorentz angle effect
Definition: SCT_FastDigitizationTool.h:136
SCT_FastDigitizationTool::m_DiffusionShiftX_barrel
DoubleProperty m_DiffusionShiftX_barrel
Definition: SCT_FastDigitizationTool.h:142
SCT_FastDigitizationTool::m_sctErrorStrategy
IntegerProperty m_sctErrorStrategy
error strategy for the ClusterMaker
Definition: SCT_FastDigitizationTool.h:138
SCT_FastDigitizationTool::m_rndmSvc
ServiceHandle< IAthRNGSvc > m_rndmSvc
Random number service.
Definition: SCT_FastDigitizationTool.h:118
IAthRNGSvc.h
ServiceHandle< PileUpMergeSvc >
SiHitCollection.h