ATLAS Offline Software
SCT_SurfaceChargesGenerator.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*
4  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5 */
6 
32 #ifndef SCT_DIGITIZATION_SCT_SURFACECHARGESGENERATOR_H
33 #define SCT_DIGITIZATION_SCT_SURFACECHARGESGENERATOR_H
34 
35 //Inheritance
38 
40 
48 
49 // Gaudi
50 #include "GaudiKernel/ITHistSvc.h" // for ITHistSvc
51 #include "GaudiKernel/ServiceHandle.h"
52 #include "GaudiKernel/ToolHandle.h"
53 
54 // CLHEP
55 #include "CLHEP/Units/SystemOfUnits.h"
56 
57 #include <iostream>
58 
59 // Charges and hits
60 class SiHit;
61 
62 // -- do charge trapping histos
63 class ITHistSvc;
64 class TH1F;
65 class TH2F;
66 class TProfile;
67 
68 namespace InDetDD {
69  class SiDetectorElement;
70  class SCT_ModuleSideDesign;
71 }
72 
73 namespace CLHEP {
74  class HepRandomEngine;
75 }
76 
77 template <class HIT> class TimedHitPtr;
78 
79 class SCT_SurfaceChargesGenerator : public extends<AthAlgTool, ISurfaceChargesGenerator> {
80  public:
81 
83  SCT_SurfaceChargesGenerator(const std::string& type, const std::string& name, const IInterface* parent);
84 
86  virtual ~SCT_SurfaceChargesGenerator() = default;
87 
89  virtual StatusCode initialize() override;
90 
92  virtual StatusCode finalize() override;
93 
94  private:
95 
96  virtual void setFixedTime(float fixedTime) override {m_tfix = fixedTime;}
97 
99  virtual void process(const InDetDD::SiDetectorElement* element, const TimedHitPtr<SiHit>& phit, ISiSurfaceChargesInserter& inserter, CLHEP::HepRandomEngine * rndmEngine, const EventContext& ctx) override;
100  void processSiHit(const InDetDD::SiDetectorElement* element, const SiHit& phit, ISiSurfaceChargesInserter& inserter, float eventTime, unsigned short eventID, CLHEP::HepRandomEngine * rndmEngine, const EventContext& ctx);
101 
102  // some diagnostics methods are needed here too
103  float driftTime(float zhit, const InDetDD::SiDetectorElement* element, const EventContext& ctx) const;
104  float diffusionSigma(float zhit, const InDetDD::SiDetectorElement* element, const EventContext& ctx) const;
105  float surfaceDriftTime(float ysurf) const;
106  float maxDriftTime(const InDetDD::SiDetectorElement* element, const EventContext& ctx) const;
107  float maxDiffusionSigma(const InDetDD::SiDetectorElement* element, const EventContext& ctx) const;
108 
109  // trap_pos and drift_time are updated based on spess.
110  bool chargeIsTrapped(double spess, const InDetDD::SiDetectorElement* element, double& trap_pos, double& drift_time);
111 
112  IntegerProperty m_numberOfCharges{this, "NumberOfCharges", 1, "number of charges"};
113  FloatProperty m_smallStepLength{this, "SmallStepLength", 5 * CLHEP::micrometer, "max internal step along the larger G4 step"};
114 
116  FloatProperty m_tSurfaceDrift{this, "SurfaceDriftTime", 10 * CLHEP::ns, "max surface drift time"};
117 
118  FloatProperty m_tfix{this, "FixedTime", -999., "fixed time"};
119  FloatProperty m_tsubtract{this, "SubtractTime", -999., "subtract drift time from mid gap"};
120 
121  BooleanProperty m_useSiCondDB{this, "UseSiCondDB", true, "Usage of SiConditions DB values can be disabled to use setable ones"};
122  FloatProperty m_vdepl{this, "DepletionVoltage", 70., "depletion voltage, default 70V"};
123  FloatProperty m_vbias{this, "BiasVoltage", 150., "bias voltage, default 150V"};
124  BooleanProperty m_doTrapping{this, "doTrapping", false, "Flag to set Charge Trapping"};
125  BooleanProperty m_doHistoTrap{this, "doHistoTrap", false, "Histogram the charge trapping effect"};
126  BooleanProperty m_doRamo{this, "doRamo", false, "Ramo Potential for charge trapping effect"};
127  BooleanProperty m_isOverlay{this, "isOverlay", false, "flag for overlay"};
128  BooleanProperty m_doInducedChargeModel{this, "doInducedChargeModel", false, "Flag for Induced Charge Model"};
129 
130  //ToolHandles
131  ToolHandle<ISiPropertiesTool> m_siPropertiesTool{this, "SiPropertiesTool", "SCT_SiPropertiesTool", "Tool to retrieve SCT silicon properties"};
132  ToolHandle<ISCT_RadDamageSummaryTool> m_radDamageTool{this, "RadDamageSummaryTool", "SCT_RadDamageSummaryTool", "Tool to retrieve SCT radiation damages"};
133  ToolHandle<ISiliconConditionsTool> m_siConditionsTool{this, "SiConditionsTool", "SCT_SiliconConditionsTool", "Tool to retrieve SCT silicon information"};
134  ToolHandle<ISiLorentzAngleTool> m_lorentzAngleTool{this, "LorentzAngleTool", "SiLorentzAngleTool/SCTLorentzAngleTool", "Tool to retreive Lorentz angle"};
135 
136  ServiceHandle<ITHistSvc> m_thistSvc{this, "THistSvc", "THistSvc"};
137 
139  this, "AtlasFieldCacheCondObj", "fieldCondObj", "Name of the Magnetic Field conditions object key"};
140 
141  float m_tHalfwayDrift{0.};
142  float m_distInterStrip{1.0};
144 
145  bool m_SurfaceDriftFlag{false};
146 
147  // -- Histograms
149  TH1F* m_h_efield{nullptr};
150  TH1F* m_h_spess{nullptr};
151  TH1F* m_h_depD{nullptr};
153  TH1F* m_h_ztrap{nullptr};
154  TH1F* m_h_drift_time{nullptr};
156  TH1F* m_h_zhit{nullptr};
157  TH1F* m_h_ztrap_tot{nullptr};
158  TH1F* m_h_no_ztrap{nullptr};
162  TProfile* m_h_vel{nullptr};
163  TProfile* m_h_drift1{nullptr};
164  TProfile* m_h_gen{nullptr};
165  TProfile* m_h_gen1{nullptr};
166  TProfile* m_h_gen2{nullptr};
169  TH1F* m_h_trap_pos{nullptr};
170 
171  // For Induced Charge Module, M.Togawa
172  std::unique_ptr<InducedChargeModel> m_InducedChargeModel;
173 };
174 
175 #endif // SCT_SURFACECHARGESGENERATOR_H
SCT_SurfaceChargesGenerator::m_tSurfaceDrift
FloatProperty m_tSurfaceDrift
related to the surface drift
Definition: SCT_SurfaceChargesGenerator.h:116
SCT_SurfaceChargesGenerator::m_numberOfCharges
IntegerProperty m_numberOfCharges
Definition: SCT_SurfaceChargesGenerator.h:112
SCT_SurfaceChargesGenerator::m_h_vel
TProfile * m_h_vel
Definition: SCT_SurfaceChargesGenerator.h:162
SCT_SurfaceChargesGenerator::m_lorentzAngleTool
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
Definition: SCT_SurfaceChargesGenerator.h:134
SCT_SurfaceChargesGenerator::m_h_gen1
TProfile * m_h_gen1
Definition: SCT_SurfaceChargesGenerator.h:165
SCT_SurfaceChargesGenerator::m_doTrapping
BooleanProperty m_doTrapping
Definition: SCT_SurfaceChargesGenerator.h:124
SCT_SurfaceChargesGenerator::setFixedTime
virtual void setFixedTime(float fixedTime) override
Definition: SCT_SurfaceChargesGenerator.h:96
SCT_SurfaceChargesGenerator::finalize
virtual StatusCode finalize() override
AlgTool finalize.
Definition: SCT_SurfaceChargesGenerator.cxx:167
SCT_SurfaceChargesGenerator::m_vbias
FloatProperty m_vbias
Definition: SCT_SurfaceChargesGenerator.h:123
SCT_SurfaceChargesGenerator::m_h_mob_Char
TProfile * m_h_mob_Char
Definition: SCT_SurfaceChargesGenerator.h:161
SCT_SurfaceChargesGenerator::m_h_gen
TProfile * m_h_gen
Definition: SCT_SurfaceChargesGenerator.h:164
AtlasFieldCacheCondObj.h
SCT_SurfaceChargesGenerator::maxDriftTime
float maxDriftTime(const InDetDD::SiDetectorElement *element, const EventContext &ctx) const
max drift charge equivalent to the detector thickness
Definition: SCT_SurfaceChargesGenerator.cxx:243
InducedChargeModel.h
SCT_SurfaceChargesGenerator::m_distHalfInterStrip
float m_distHalfInterStrip
Half way distance inter strip.
Definition: SCT_SurfaceChargesGenerator.h:143
SCT_SurfaceChargesGenerator::m_h_efield
TH1F * m_h_efield
Definition: SCT_SurfaceChargesGenerator.h:149
SCT_SurfaceChargesGenerator::m_h_no_ztrap
TH1F * m_h_no_ztrap
Definition: SCT_SurfaceChargesGenerator.h:158
SCT_SurfaceChargesGenerator::m_h_spess
TH1F * m_h_spess
Definition: SCT_SurfaceChargesGenerator.h:150
SCT_SurfaceChargesGenerator::m_h_t_electrode
TH1F * m_h_t_electrode
Definition: SCT_SurfaceChargesGenerator.h:155
SCT_SurfaceChargesGenerator::m_InducedChargeModel
std::unique_ptr< InducedChargeModel > m_InducedChargeModel
Definition: SCT_SurfaceChargesGenerator.h:172
ISiPropertiesTool.h
SCT_SurfaceChargesGenerator::m_h_zhit
TH1F * m_h_zhit
Definition: SCT_SurfaceChargesGenerator.h:156
SCT_SurfaceChargesGenerator::m_thistSvc
ServiceHandle< ITHistSvc > m_thistSvc
Definition: SCT_SurfaceChargesGenerator.h:136
ISiLorentzAngleTool.h
TimedHitPtr
a smart pointer to a hit that also provides access to the extended timing info of the host event....
Definition: SCT_SurfaceChargesGenerator.h:77
SCT_SurfaceChargesGenerator::m_tfix
FloatProperty m_tfix
Definition: SCT_SurfaceChargesGenerator.h:118
python.TrigEgammaMonitorHelper.TH2F
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:45
SCT_SurfaceChargesGenerator::process
virtual void process(const InDetDD::SiDetectorElement *element, const TimedHitPtr< SiHit > &phit, ISiSurfaceChargesInserter &inserter, CLHEP::HepRandomEngine *rndmEngine, const EventContext &ctx) override
create a list of surface charges from a hit
Definition: SCT_SurfaceChargesGenerator.cxx:295
SCT_SurfaceChargesGenerator::m_h_drift1
TProfile * m_h_drift1
Definition: SCT_SurfaceChargesGenerator.h:163
ISCT_RadDamageSummaryTool.h
SCT_SurfaceChargesGenerator::m_doRamo
BooleanProperty m_doRamo
Definition: SCT_SurfaceChargesGenerator.h:126
SCT_SurfaceChargesGenerator::m_distInterStrip
float m_distInterStrip
Inter strip distance normalized to 1.
Definition: SCT_SurfaceChargesGenerator.h:142
ISurfaceChargesGenerator.h
ReadCondHandle.h
SiHit
Definition: SiHit.h:19
SCT_SurfaceChargesGenerator::m_tsubtract
FloatProperty m_tsubtract
Definition: SCT_SurfaceChargesGenerator.h:119
SCT_SurfaceChargesGenerator::m_isOverlay
BooleanProperty m_isOverlay
Definition: SCT_SurfaceChargesGenerator.h:127
SCT_SurfaceChargesGenerator::m_h_ztrap
TH1F * m_h_ztrap
Definition: SCT_SurfaceChargesGenerator.h:153
python.TrigEgammaMonitorHelper.TProfile
def TProfile(*args, **kwargs)
Definition: TrigEgammaMonitorHelper.py:81
SCT_SurfaceChargesGenerator::m_h_ztrap_tot
TH1F * m_h_ztrap_tot
Definition: SCT_SurfaceChargesGenerator.h:157
SCT_SurfaceChargesGenerator::m_radDamageTool
ToolHandle< ISCT_RadDamageSummaryTool > m_radDamageTool
Definition: SCT_SurfaceChargesGenerator.h:132
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SCT_SurfaceChargesGenerator::m_useSiCondDB
BooleanProperty m_useSiCondDB
Definition: SCT_SurfaceChargesGenerator.h:121
SCT_SurfaceChargesGenerator::m_h_gen2
TProfile * m_h_gen2
Definition: SCT_SurfaceChargesGenerator.h:166
CLHEP
STD'S.
Definition: IAtRndmGenSvc.h:19
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
SCT_SurfaceChargesGenerator::m_h_velocity_trap
TProfile * m_h_velocity_trap
Definition: SCT_SurfaceChargesGenerator.h:167
python.SystemOfUnits.micrometer
int micrometer
Definition: SystemOfUnits.py:71
SCT_SurfaceChargesGenerator::m_SurfaceDriftFlag
bool m_SurfaceDriftFlag
surface drift ON/OFF
Definition: SCT_SurfaceChargesGenerator.h:145
SCT_SurfaceChargesGenerator::m_smallStepLength
FloatProperty m_smallStepLength
Definition: SCT_SurfaceChargesGenerator.h:113
SCT_SurfaceChargesGenerator::m_tHalfwayDrift
float m_tHalfwayDrift
Surface drift time.
Definition: SCT_SurfaceChargesGenerator.h:141
SCT_SurfaceChargesGenerator::m_h_trap_drift_t
TH1F * m_h_trap_drift_t
Definition: SCT_SurfaceChargesGenerator.h:159
SCT_SurfaceChargesGenerator::m_siPropertiesTool
ToolHandle< ISiPropertiesTool > m_siPropertiesTool
Definition: SCT_SurfaceChargesGenerator.h:131
SCT_SurfaceChargesGenerator::driftTime
float driftTime(float zhit, const InDetDD::SiDetectorElement *element, const EventContext &ctx) const
calculate drift time perpandicular to the surface for a charge at distance zhit from mid gap
Definition: SCT_SurfaceChargesGenerator.cxx:175
SCT_SurfaceChargesGenerator::m_h_trap_pos
TH1F * m_h_trap_pos
Definition: SCT_SurfaceChargesGenerator.h:169
SCT_SurfaceChargesGenerator::m_h_drift_electrode
TH2F * m_h_drift_electrode
Definition: SCT_SurfaceChargesGenerator.h:152
SCT_SurfaceChargesGenerator::surfaceDriftTime
float surfaceDriftTime(float ysurf) const
Calculate of the surface drift time.
Definition: SCT_SurfaceChargesGenerator.cxx:270
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
IdentifierHash.h
SCT_SurfaceChargesGenerator::m_doHistoTrap
BooleanProperty m_doHistoTrap
Definition: SCT_SurfaceChargesGenerator.h:125
SCT_SurfaceChargesGenerator::initialize
virtual StatusCode initialize() override
AlgTool initialize.
Definition: SCT_SurfaceChargesGenerator.cxx:44
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
SCT_SurfaceChargesGenerator::m_h_mobility_trap
TProfile * m_h_mobility_trap
Definition: SCT_SurfaceChargesGenerator.h:168
SG::ReadCondHandleKey< AtlasFieldCacheCondObj >
SCT_SurfaceChargesGenerator::m_h_notrap_drift_t
TH1F * m_h_notrap_drift_t
Definition: SCT_SurfaceChargesGenerator.h:160
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
SCT_SurfaceChargesGenerator
Definition: SCT_SurfaceChargesGenerator.h:79
ISiliconConditionsTool.h
SCT_SurfaceChargesGenerator::m_fieldCacheCondObjInputKey
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheCondObjInputKey
Definition: SCT_SurfaceChargesGenerator.h:138
SCT_SurfaceChargesGenerator::processSiHit
void processSiHit(const InDetDD::SiDetectorElement *element, const SiHit &phit, ISiSurfaceChargesInserter &inserter, float eventTime, unsigned short eventID, CLHEP::HepRandomEngine *rndmEngine, const EventContext &ctx)
Definition: SCT_SurfaceChargesGenerator.cxx:308
SCT_SurfaceChargesGenerator::SCT_SurfaceChargesGenerator
SCT_SurfaceChargesGenerator(const std::string &type, const std::string &name, const IInterface *parent)
constructor
Definition: SCT_SurfaceChargesGenerator.cxx:35
python.SystemOfUnits.ns
int ns
Definition: SystemOfUnits.py:130
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
SCT_SurfaceChargesGenerator::m_doInducedChargeModel
BooleanProperty m_doInducedChargeModel
Definition: SCT_SurfaceChargesGenerator.h:128
SCT_SurfaceChargesGenerator::maxDiffusionSigma
float maxDiffusionSigma(const InDetDD::SiDetectorElement *element, const EventContext &ctx) const
max sigma diffusion
Definition: SCT_SurfaceChargesGenerator.cxx:256
SCT_SurfaceChargesGenerator::m_vdepl
FloatProperty m_vdepl
Definition: SCT_SurfaceChargesGenerator.h:122
SCT_SurfaceChargesGenerator::~SCT_SurfaceChargesGenerator
virtual ~SCT_SurfaceChargesGenerator()=default
Destructor.
ISiSurfaceChargesInserter
Definition: ISurfaceChargesGenerator.h:32
SCT_SurfaceChargesGenerator::m_h_drift_time
TH1F * m_h_drift_time
Definition: SCT_SurfaceChargesGenerator.h:154
SCT_SurfaceChargesGenerator::m_siConditionsTool
ToolHandle< ISiliconConditionsTool > m_siConditionsTool
Definition: SCT_SurfaceChargesGenerator.h:133
SCT_SurfaceChargesGenerator::chargeIsTrapped
bool chargeIsTrapped(double spess, const InDetDD::SiDetectorElement *element, double &trap_pos, double &drift_time)
Definition: SCT_SurfaceChargesGenerator.cxx:570
SCT_SurfaceChargesGenerator::m_h_depD
TH1F * m_h_depD
Definition: SCT_SurfaceChargesGenerator.h:151
SCT_SurfaceChargesGenerator::diffusionSigma
float diffusionSigma(float zhit, const InDetDD::SiDetectorElement *element, const EventContext &ctx) const
calculate diffusion sigma from a gaussian dist scattered charge
Definition: SCT_SurfaceChargesGenerator.cxx:224
ServiceHandle< ITHistSvc >
SCT_SurfaceChargesGenerator::m_h_efieldz
TProfile * m_h_efieldz
Definition: SCT_SurfaceChargesGenerator.h:148