ATLAS Offline Software
HGTD_SmearedDigitizationTool.h
Go to the documentation of this file.
1 
16 #ifndef HGTD_FASTSIDIGITIZATION_HGTD_SMEAREDDIGITIZATIONTOOL_H
17 #define HGTD_FASTSIDIGITIZATION_HGTD_SMEAREDDIGITIZATIONTOOL_H
18 
20 #include "GaudiKernel/ITHistSvc.h"
21 #include "GaudiKernel/ServiceHandle.h"
22 #include "GaudiKernel/ToolHandle.h"
28 #include "InDetSimEvent/SiHit.h"
31 #include <string>
32 
33 // forward declarations
35 class HGTD_ID;
37 class TFile;
38 class TTree;
39 
40 namespace CLHEP {
41 class HepRandomEngine;
42 }
43 
45 public:
49 
51  std::multimap<IdentifierHash, const Cluster_t*>;
52 
53  HGTD_SmearedDigitizationTool(const std::string& type, const std::string& name,
54  const IInterface* parent);
55 
57 
58  virtual StatusCode initialize() override;
59  virtual StatusCode finalize() override;
60 
61  // main method to be called when using this tool
62  virtual StatusCode processAllSubEvents(const EventContext& ctx) override;
63 
64 private:
65  // methods called within processAllSubEvents
67 
69 
70  // create HGTD_Cluster from SiHit
71  StatusCode digitize(const EventContext& ctx,
72  TimedHitCollection<SiHit>& timed_hit_collection,
73  HGTD_DetElement_RIO_Map_t& det_element_rio_map);
74 
76  const TimedHitPtr<SiHit>&, const EventContext&);
77 
79  ClusterContainer_t& cluster_container);
80 
81  float smearPosition(float pos, float sig, float boundary, CLHEP::HepRandomEngine * rndmEngine);
82 
83  float smearMeanTime(float time, float time_res, CLHEP::HepRandomEngine * rndmEngine);
84 
86  const HGTD_ID* m_hgtd_idhelper{nullptr};
87 
88  std::string m_prd_truth_coll_name{"PRD_MultiTruthPixel"};
89 
90  ServiceHandle<PileUpMergeSvc> m_merge_svc{this, "MergeSvc", "PileUpMergeSvc", "Merge service used in HGTD fast digitization"};
91  ServiceHandle<IAthRNGSvc> m_rndm_svc{this, "RndmSvc", "AthRNGSvc", "Random number service used in HGTD fast digitization"};
92 
93  StringProperty m_cluster_name{this, "HGTD_ClustersContainerName", "HGTD_Cluster", "Name of the HGTD cluster container"};
94 
95  StringProperty m_si_hit_collection_name{this, "SiHitCollectionName", "HGTD_Hits", "Name of the Si Hit collection"};
96 
97  BooleanProperty m_smear_intersection_position{this, "SmearIntersectionPosition", true, ""};
98  BooleanProperty m_smear_mean_time{this, "SmearMeanTime", true, ""};
99  BooleanProperty m_write_tree{this, "WriteTree", false, ""};
100 
101  // will default to 1.3x1.3 pitch size for HGTD, but can be set via property
102  FloatProperty m_pitch_x{this, "pitch_X", 1.3, ""};
103  FloatProperty m_pitch_y{this, "pitch_Y", 1.3, ""};
104  float m_time_res{0.035}; // time resolution in ns
105 
106  // variables used only for writing out validation tree (not written by default)
107 
108  ServiceHandle<ITHistSvc> m_hist_svc{this, "THistSvc", "THistSvc"};
109  std::unique_ptr<TFile> m_output_file;
110  std::unique_ptr<TTree> m_tree;
111 
112  float m_x_hit{};
113  float m_y_hit{};
116 
117  float m_x_entry_hit{};
118  float m_y_entry_hit{};
119  float m_z_entry_hit{};
120  float m_x_exit_hit{};
121  float m_y_exit_hit{};
122  float m_z_exit_hit{};
123 
124  float m_hit_time{};
126 
130 
131  float m_err_x_hit{};
132  float m_err_y_hit{};
133 
134 };
135 
136 #endif // HGTD_FASTSIDIGITIZATION_HGTD_SMEAREDDIGITIZATIONTOOL_H
HGTD_SmearedDigitizationTool::m_cluster_name
StringProperty m_cluster_name
Definition: HGTD_SmearedDigitizationTool.h:93
HGTD_SmearedDigitizationTool::m_tree
std::unique_ptr< TTree > m_tree
Definition: HGTD_SmearedDigitizationTool.h:110
HGTD_SmearedDigitizationTool::m_hist_svc
ServiceHandle< ITHistSvc > m_hist_svc
Definition: HGTD_SmearedDigitizationTool.h:108
HGTD_SmearedDigitizationTool::m_si_hit_collection_name
StringProperty m_si_hit_collection_name
Definition: HGTD_SmearedDigitizationTool.h:95
SiHit.h
HGTD_SmearedDigitizationTool::m_output_file
std::unique_ptr< TFile > m_output_file
Definition: HGTD_SmearedDigitizationTool.h:109
HGTD_SmearedDigitizationTool::~HGTD_SmearedDigitizationTool
~HGTD_SmearedDigitizationTool()
HGTD_SmearedDigitizationTool::smearPosition
float smearPosition(float pos, float sig, float boundary, CLHEP::HepRandomEngine *rndmEngine)
Definition: HGTD_SmearedDigitizationTool.cxx:339
PRD_MultiTruthCollection
A PRD is mapped onto all contributing particles.
Definition: PRD_MultiTruthCollection.h:24
HGTD_SmearedDigitizationTool::m_x_hit
float m_x_hit
Definition: HGTD_SmearedDigitizationTool.h:112
HGTD_SmearedDigitizationTool::m_y_hit_smeared
float m_y_hit_smeared
Definition: HGTD_SmearedDigitizationTool.h:115
HGTD_SmearedDigitizationTool::fillClusterContainer
StatusCode fillClusterContainer(HGTD_DetElement_RIO_Map_t &det_element_rio_map, ClusterContainer_t &cluster_container)
Definition: HGTD_SmearedDigitizationTool.cxx:375
Trk::PrepRawDataCollection
Definition: PrepRawDataCollection.h:36
HGTD_SmearedDigitizationTool::m_hgtd_idhelper
const HGTD_ID * m_hgtd_idhelper
Definition: HGTD_SmearedDigitizationTool.h:86
HGTD_SmearedDigitizationTool::setupTimedHitCollection
TimedHitCollection< SiHit > setupTimedHitCollection()
Definition: HGTD_SmearedDigitizationTool.cxx:126
HGTD_SmearedDigitizationTool::m_err_y_hit
float m_err_y_hit
Definition: HGTD_SmearedDigitizationTool.h:132
TimedHitPtr< SiHit >
HGTD_SmearedDigitizationTool::HGTD_DetElement_RIO_Map_t
std::multimap< IdentifierHash, const Cluster_t * > HGTD_DetElement_RIO_Map_t
Definition: HGTD_SmearedDigitizationTool.h:51
HGTD_SmearedDigitizationTool::m_y_entry_hit
float m_y_entry_hit
Definition: HGTD_SmearedDigitizationTool.h:118
HGTD_SmearedDigitizationTool::m_smear_intersection_position
BooleanProperty m_smear_intersection_position
Definition: HGTD_SmearedDigitizationTool.h:97
HGTD_SmearedDigitizationTool::m_x_entry_hit
float m_x_entry_hit
Definition: HGTD_SmearedDigitizationTool.h:117
HGTD_SmearedDigitizationTool::smearMeanTime
float smearMeanTime(float time, float time_res, CLHEP::HepRandomEngine *rndmEngine)
Definition: HGTD_SmearedDigitizationTool.cxx:355
HGTD_SmearedDigitizationTool::digitize
StatusCode digitize(const EventContext &ctx, TimedHitCollection< SiHit > &timed_hit_collection, HGTD_DetElement_RIO_Map_t &det_element_rio_map)
Definition: HGTD_SmearedDigitizationTool.cxx:161
HGTD_SmearedDigitizationTool::m_pitch_y
FloatProperty m_pitch_y
Definition: HGTD_SmearedDigitizationTool.h:103
HGTD_SmearedDigitizationTool::m_y_exit_hit
float m_y_exit_hit
Definition: HGTD_SmearedDigitizationTool.h:121
HGTD_SmearedDigitizationTool::m_hit_time_smeared
float m_hit_time_smeared
Definition: HGTD_SmearedDigitizationTool.h:125
HGTD_SmearedDigitizationTool::m_hgtd_det_manager
const HGTD_DetectorManager * m_hgtd_det_manager
Definition: HGTD_SmearedDigitizationTool.h:85
HGTD_Cluster.h
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration.
HGTD_SmearedDigitizationTool::HGTD_SmearedDigitizationTool
HGTD_SmearedDigitizationTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: HGTD_SmearedDigitizationTool.cxx:26
HGTD_Cluster
Definition: HGTD_Cluster.h:35
HGTD_SmearedDigitizationTool::m_hit_time
float m_hit_time
Definition: HGTD_SmearedDigitizationTool.h:124
TimedHitPtr.h
HGTD_ClusterCollection.h
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
HGTD_SmearedDigitizationTool::m_z_entry_hit
float m_z_entry_hit
Definition: HGTD_SmearedDigitizationTool.h:119
HGTD_ClusterContainer
Trk::PrepRawDataContainer< HGTD_ClusterCollection > HGTD_ClusterContainer
Definition: HGTD_ClusterContainer.h:20
HGTD_SmearedDigitizationTool::finalize
virtual StatusCode finalize() override
Definition: HGTD_SmearedDigitizationTool.cxx:75
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
HGTD_SmearedDigitizationTool::m_x_exit_hit
float m_x_exit_hit
Definition: HGTD_SmearedDigitizationTool.h:120
CLHEP
STD'S.
Definition: IAtRndmGenSvc.h:19
python.BuildSignatureFlags.sig
sig
Definition: BuildSignatureFlags.py:218
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TimedHitCollection.h
Trk::RIO_OnTrackType::HGTD_Cluster
@ HGTD_Cluster
Definition: RIO_OnTrack.h:63
HGTD_ClusterCollection
Trk::PrepRawDataCollection< HGTD_Cluster > HGTD_ClusterCollection
Definition: HGTD_ClusterCollection.h:19
HGTD_ID
Definition: HGTD_ID.h:47
HGTD_SmearedDigitizationTool::m_prd_truth_coll_name
std::string m_prd_truth_coll_name
Definition: HGTD_SmearedDigitizationTool.h:88
HGTD_SmearedDigitizationTool::m_smear_mean_time
BooleanProperty m_smear_mean_time
Definition: HGTD_SmearedDigitizationTool.h:98
HGTD_SmearedDigitizationTool::m_x_cluster_global
float m_x_cluster_global
Definition: HGTD_SmearedDigitizationTool.h:127
PileUpToolBase
Definition: PileUpToolBase.h:18
HGTD_SmearedDigitizationTool::m_x_hit_smeared
float m_x_hit_smeared
Definition: HGTD_SmearedDigitizationTool.h:114
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
HGTD_SmearedDigitizationTool::m_z_exit_hit
float m_z_exit_hit
Definition: HGTD_SmearedDigitizationTool.h:122
HGTD_SmearedDigitizationTool::initialize
virtual StatusCode initialize() override
Definition: HGTD_SmearedDigitizationTool.cxx:33
HGTD_SmearedDigitizationTool::m_merge_svc
ServiceHandle< PileUpMergeSvc > m_merge_svc
Definition: HGTD_SmearedDigitizationTool.h:90
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
HGTD_SmearedDigitizationTool::m_y_hit
float m_y_hit
Definition: HGTD_SmearedDigitizationTool.h:113
HGTD_SmearedDigitizationTool::processAllSubEvents
virtual StatusCode processAllSubEvents(const EventContext &ctx) override
Definition: HGTD_SmearedDigitizationTool.cxx:88
HGTD_SmearedDigitizationTool::m_pitch_x
FloatProperty m_pitch_x
Definition: HGTD_SmearedDigitizationTool.h:102
HGTD_SmearedDigitizationTool::retrieveTruth
StatusCode retrieveTruth(PRD_MultiTruthCollection *&prd_truth_coll)
Definition: HGTD_SmearedDigitizationTool.cxx:113
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
Trk::PrepRawDataContainer
Definition: PrepRawDataContainer.h:26
PileUpMergeSvc.h
the preferred mechanism to access information from the different event stores in a pileup job.
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
HGTD_SmearedDigitizationTool::fillMultiTruthCollection
StatusCode fillMultiTruthCollection(PRD_MultiTruthCollection *, Cluster_t *, const TimedHitPtr< SiHit > &, const EventContext &)
Definition: HGTD_SmearedDigitizationTool.cxx:359
HGTD_SmearedDigitizationTool::m_y_cluster_global
float m_y_cluster_global
Definition: HGTD_SmearedDigitizationTool.h:128
HGTD_DetectorManager
Definition: HGTD_DetectorManager.h:33
HGTD_SmearedDigitizationTool::m_write_tree
BooleanProperty m_write_tree
Definition: HGTD_SmearedDigitizationTool.h:99
HGTD_SmearedDigitizationTool::m_z_cluster_global
float m_z_cluster_global
Definition: HGTD_SmearedDigitizationTool.h:129
HGTD_SmearedDigitizationTool::m_err_x_hit
float m_err_x_hit
Definition: HGTD_SmearedDigitizationTool.h:131
HGTD_SmearedDigitizationTool::m_time_res
float m_time_res
Definition: HGTD_SmearedDigitizationTool.h:104
PileUpToolBase.h
helper base class IPileUpTool::toProcess().
HGTD_ClusterContainer.h
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
TimedHitCollection< SiHit >
HGTD_SmearedDigitizationTool::m_rndm_svc
ServiceHandle< IAthRNGSvc > m_rndm_svc
Random number service.
Definition: HGTD_SmearedDigitizationTool.h:91
HGTD_SmearedDigitizationTool
Definition: HGTD_SmearedDigitizationTool.h:44
IAthRNGSvc.h
ServiceHandle< PileUpMergeSvc >