ATLAS Offline Software
Loading...
Searching...
No Matches
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
33
35
37#include "GaudiKernel/ITHistSvc.h"
39
42
43#include <tuple>
44typedef std::tuple< Amg::Vector2D, InDet::SiWidth, Amg::MatrixX> ClusterInfo;
45
46class PixelID;
47class SCT_ID;
48class TTree;
49class TFile;
50
51namespace InDetDD{class SiDetectorElement;}
52namespace CLHEP {class HepRandomEngine;}
53
54namespace InDet {
55 class ClusterMakerTool;
56 class PixelCluster;
57 class SCT_Cluster;
58 class SiCluster;
59}
60
62{
63
64public:
65
68 const std::string& type,
69 const std::string& name,
70 const IInterface* parent
71 );
72
73
74 StatusCode initialize();
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;
84 StatusCode mergeClusters(Pixel_detElement_RIO_map * cluster_map);
85 StatusCode mergeClusters(SCT_detElement_RIO_map * cluster_map);
86
87 StatusCode digitize(const EventContext& ctx,
89 StatusCode createAndStoreRIOs(const EventContext& ctx);
90 StatusCode retrieveTruth();
91 StatusCode finalize();
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
114
115 std::string m_randomEngineName;
116
119
121 double m_nSigma;
122
124
125 InDet::PixelClusterContainer* m_pixelClusterContainer;
126
127 InDet::SCT_ClusterContainer* m_sctClusterContainer;
128
132
135
137 std::string m_prdTruthNameSCT;
138
140 std::string m_inputObjectName;
141
142 std::vector<SiHitCollection*> m_siHitCollList;
143
145
147
149
151
154
156
157 ServiceHandle<ITHistSvc> m_thistSvc{this, "THistSvc", "THistSvc"};
160
161 double m_x_pixel;
162 double m_y_pixel;
172
173 double m_x_SCT;
183
187
192
193
196
198
199
200};
201
202#endif // SISMEAREDDDIGITIZATION_SISMEAREDDIGITIZATIONTOOL_H
xAOD::CaloCluster CLUSTER
std::vector< xAOD::EventInfo::SubEvent >::const_iterator SubEventIterator
Definition IPileUpTool.h:22
helper base class IPileUpTool::toProcess().
AtlasHitsVector< SiHit > SiHitCollection
std::tuple< Amg::Vector2D, InDet::SiWidth, Amg::MatrixX > ClusterInfo
A PRD is mapped onto all contributing particles.
PileUpToolBase(const std::string &type, const std::string &name, const IInterface *parent)
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
Class to hold geometrical description of a silicon detector element.
std::string m_randomEngineName
Name of the random number stream.
const SCT_ID * m_sct_ID
Handle to the ID helper.
InDet::SCT_ClusterContainer * m_sctClusterContainer
the SCT_ClusterContainer
double calculateDistance(CLUSTER *clusterA, CLUSTER *clusterB)
StatusCode mergeClusters(Pixel_detElement_RIO_map *cluster_map)
StatusCode createAndStoreRIOs(const EventContext &ctx)
TTree * m_currentTree
the tree to store information from pixel and SCT (before and after smearing)
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
SCT_detElement_RIO_map * m_sctClusterMap
std::multimap< IdentifierHash, InDet::SCT_Cluster * > SCT_detElement_RIO_map
const PixelID * m_pixel_ID
Handle to the ID helper.
SiSmearedDigitizationTool(const SiSmearedDigitizationTool &)
StatusCode digitize(const EventContext &ctx, TimedHitCollection< SiHit > &thpcsi)
PRD_MultiTruthCollection * m_pixelPrdTruth
StatusCode processAllSubEvents(const EventContext &ctx)
ServiceHandle< PileUpMergeSvc > m_mergeSvc
PileUp Merge service.
std::multimap< IdentifierHash, InDet::PixelCluster * > Pixel_detElement_RIO_map
StatusCode processBunchXing(int bunchXing, SubEventIterator bSubEvents, SubEventIterator eSubEvents)
StatusCode FillTruthMap(PRD_MultiTruthCollection *, CLUSTER *, const TimedHitPtr< SiHit > &)
ServiceHandle< IAthRNGSvc > m_rndmSvc
Random number service.
ServiceHandle< ITHistSvc > m_thistSvc
SiSmearedDigitizationTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters.
ClusterInfo calculateNewCluster(CLUSTER *clusterA, CLUSTER *clusterB)
PRD_MultiTruthCollection * m_SCTPrdTruth
SiSmearedDigitizationTool & operator=(const SiSmearedDigitizationTool &)
InDet::PixelClusterContainer * m_pixelClusterContainer
the PixelClusterContainer
std::vector< SiHitCollection * > m_siHitCollList
name of the sub event hit collections.
int m_HardScatterSplittingMode
Process all SiHit or just those from signal or background events.
StatusCode prepareEvent(const EventContext &ctx, unsigned int)
Pixel_detElement_RIO_map * m_pixelClusterMap
StatusCode mergeEvent(const EventContext &ctx)
double calculateSigma(CLUSTER *clusterA, CLUSTER *clusterB)
a smart pointer to a hit that also provides access to the extended timing info of the host event.
Definition TimedHitPtr.h:18
Message Stream Member.
Primary Vertex Finder.