ATLAS Offline Software
StripSurfaceChargesGenerator.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 
12 #ifndef STRIPDIGITIZATION_STRIPSURFACECHARGESGENERATOR_H
13 #define STRIPDIGITIZATION_STRIPSURFACECHARGESGENERATOR_H
14 
15 //Inheritance
18 
20 
25 //Eventually we will want an ITk Strip version of these?
29 
30 // Gaudi
31 #include "GaudiKernel/ITHistSvc.h" // for ITHistSvc
32 #include "GaudiKernel/ServiceHandle.h"
33 #include "GaudiKernel/ToolHandle.h"
34 
35 // CLHEP
36 #include "CLHEP/Units/SystemOfUnits.h"
37 
38 #include <iostream>
39 
40 // Charges and hits
41 class SiHit;
42 
43 // -- do charge trapping histos
44 class ITHistSvc;
45 class TH1F;
46 class TH2F;
47 class TProfile;
48 
49 namespace InDetDD {
50  class SiDetectorElement;
51 }
52 
53 namespace CLHEP {
54  class HepRandomEngine;
55 }
56 
57 template <class HIT> class TimedHitPtr;
58 
59 namespace ITk
60 {
61 
62 class StripSurfaceChargesGenerator : public extends<AthAlgTool, ISurfaceChargesGenerator> {
63  public:
64 
66  StripSurfaceChargesGenerator(const std::string& type, const std::string& name, const IInterface* parent);
67 
69  virtual ~StripSurfaceChargesGenerator() = default;
70 
72  virtual StatusCode initialize() override;
73 
75  virtual StatusCode finalize() override;
76 
77  private:
78 
79  virtual void setFixedTime(float fixedTime) override {m_tfix = fixedTime;}
80 
82  virtual void process(const InDetDD::SiDetectorElement* element,
83  const TimedHitPtr<SiHit>& phit,
84  ISiSurfaceChargesInserter& inserter,
85  CLHEP::HepRandomEngine * rndmEngine,
86  const EventContext& ctx) override;
87  void processSiHit(const InDetDD::SiDetectorElement* element,
88  const SiHit& phit,
89  ISiSurfaceChargesInserter& inserter,
90  float eventTime, unsigned short eventID,
91  CLHEP::HepRandomEngine * rndmEngine,
92  const EventContext& ctx) const;
93 
94  // some diagnostics methods are needed here too
95  float driftTime(float zhit, const InDetDD::SiDetectorElement* element, const EventContext& ctx) const;
96  float diffusionSigma(float zhit, const InDetDD::SiDetectorElement* element, const EventContext& ctx) const;
97  float surfaceDriftTime(float ysurf) const;
98  float maxDriftTime(const InDetDD::SiDetectorElement* element, const EventContext& ctx) const;
99  float maxDiffusionSigma(const InDetDD::SiDetectorElement* element, const EventContext& ctx) const;
100 
101  // trap_pos and drift_time are updated based on spess.
102  bool chargeIsTrapped(double spess, const InDetDD::SiDetectorElement* element, double& trap_pos, double& drift_time) const;
103 
104  IntegerProperty m_numberOfCharges{this, "NumberOfCharges", 1, "number of charges"};
105  FloatProperty m_smallStepLength{this, "SmallStepLength", 5 * CLHEP::micrometer, "max internal step along the larger G4 step"};
106 
108  FloatProperty m_tSurfaceDrift{this, "SurfaceDriftTime", 10 * CLHEP::ns, "max surface drift time"};
109 
110  FloatProperty m_tfix{this, "FixedTime", -999., "fixed time"};
111  FloatProperty m_tsubtract{this, "SubtractTime", -999., "subtract drift time from mid gap"};
112 
113  BooleanProperty m_useSiCondDB{this, "UseSiCondDB", true, "Usage of SiConditions DB values can be disabled to use setable ones"};
114  FloatProperty m_vdepl{this, "DepletionVoltage", 70., "depletion voltage, default 70V"};
115  FloatProperty m_vbias{this, "BiasVoltage", 150., "bias voltage, default 150V"};
116  BooleanProperty m_doTrapping{this, "doTrapping", false, "Flag to set Charge Trapping"};
117  BooleanProperty m_doHistoTrap{this, "doHistoTrap", false, "Histogram the charge trapping effect"};
118  BooleanProperty m_doRamo{this, "doRamo", false, "Ramo Potential for charge trapping effect"};
119  BooleanProperty m_isOverlay{this, "isOverlay", false, "flag for overlay"};
120  BooleanProperty m_doInducedChargeModel{this, "doInducedChargeModel", false, "Flag for Induced Charge Model"};
121 
122  //ToolHandles
123  ToolHandle<ISiPropertiesTool> m_siPropertiesTool{this, "SiPropertiesTool", "StripSiPropertiesTool", "Tool to retrieve SCT silicon properties"};
124  ToolHandle<ISCT_RadDamageSummaryTool> m_radDamageTool{this, "RadDamageSummaryTool", "StripRadDamageSummaryTool", "Tool to retrieve SCT radiation damages"};
125  ToolHandle<ISiliconConditionsTool> m_siConditionsTool{this, "SiConditionsTool", "StripSiliconConditionsTool", "Tool to retrieve SCT silicon information"};
126  ToolHandle<ISiLorentzAngleTool> m_lorentzAngleTool{this, "LorentzAngleTool", "SiLorentzAngleTool/ITkStripLorentzAngleTool", "Tool to retreive Lorentz angle"};
127 
128  ServiceHandle<ITHistSvc> m_thistSvc{this, "THistSvc", "THistSvc"};
129 
131  this, "AtlasFieldCacheCondObj", "fieldCondObj", "Name of the Magnetic Field conditions object key"};
132 
133  float m_tHalfwayDrift{0.};
134  float m_distInterStrip{1.0};
136 
137  bool m_SurfaceDriftFlag{false};
138 
139  // -- Histograms
140  struct Hists {
141  StatusCode book (ITHistSvc& histSvc);
143  TH1F* m_h_efield{nullptr};
144  TH1F* m_h_spess{nullptr};
145  TH1F* m_h_depD{nullptr};
147  TH1F* m_h_ztrap{nullptr};
148  TH1F* m_h_drift_time{nullptr};
150  TH1F* m_h_zhit{nullptr};
151  TH1F* m_h_ztrap_tot{nullptr};
152  TH1F* m_h_no_ztrap{nullptr};
156  TProfile* m_h_vel{nullptr};
157  TProfile* m_h_drift1{nullptr};
158  TProfile* m_h_gen{nullptr};
159  TProfile* m_h_gen1{nullptr};
160  TProfile* m_h_gen2{nullptr};
163  TH1F* m_h_trap_pos{nullptr};
164  };
165  std::unique_ptr<Hists> m_h;
166 
167  // For Induced Charge Module, M.Togawa
168  std::unique_ptr<InducedChargeModel> m_InducedChargeModel;
169 
170  Hists& getHists() const;
171 };
172 
173 } // namespace ITk
174 
175 #endif // STRIPSURFACECHARGESGENERATOR_H
ITk::StripSurfaceChargesGenerator::m_distHalfInterStrip
float m_distHalfInterStrip
Half way distance inter strip.
Definition: StripSurfaceChargesGenerator.h:135
ITk::StripSurfaceChargesGenerator::m_tsubtract
FloatProperty m_tsubtract
Definition: StripSurfaceChargesGenerator.h:111
ITk::StripSurfaceChargesGenerator::m_doTrapping
BooleanProperty m_doTrapping
Definition: StripSurfaceChargesGenerator.h:116
ITk::StripSurfaceChargesGenerator::Hists::m_h_no_ztrap
TH1F * m_h_no_ztrap
Definition: StripSurfaceChargesGenerator.h:152
ITk::StripSurfaceChargesGenerator::getHists
Hists & getHists() const
Definition: StripSurfaceChargesGenerator.cxx:686
ITk::StripSurfaceChargesGenerator::Hists::m_h_t_electrode
TH1F * m_h_t_electrode
Definition: StripSurfaceChargesGenerator.h:149
TH2F
Definition: rootspy.cxx:420
ITk::StripSurfaceChargesGenerator::Hists::m_h_zhit
TH1F * m_h_zhit
Definition: StripSurfaceChargesGenerator.h:150
AtlasFieldCacheCondObj.h
ITk::StripSurfaceChargesGenerator::Hists::m_h_spess
TH1F * m_h_spess
Definition: StripSurfaceChargesGenerator.h:144
ITk::StripSurfaceChargesGenerator::Hists::m_h_trap_drift_t
TH1F * m_h_trap_drift_t
Definition: StripSurfaceChargesGenerator.h:153
ITk::StripSurfaceChargesGenerator::Hists::m_h_ztrap_tot
TH1F * m_h_ztrap_tot
Definition: StripSurfaceChargesGenerator.h:151
InducedChargeModel.h
ITk::StripSurfaceChargesGenerator::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: StripSurfaceChargesGenerator.cxx:193
ITk::StripSurfaceChargesGenerator::Hists::m_h_trap_pos
TH1F * m_h_trap_pos
Definition: StripSurfaceChargesGenerator.h:163
ITk::StripSurfaceChargesGenerator::Hists
Definition: StripSurfaceChargesGenerator.h:140
ITk::StripSurfaceChargesGenerator::m_vdepl
FloatProperty m_vdepl
Definition: StripSurfaceChargesGenerator.h:114
ISiPropertiesTool.h
ITk::StripSurfaceChargesGenerator::m_doHistoTrap
BooleanProperty m_doHistoTrap
Definition: StripSurfaceChargesGenerator.h:117
ITk::StripSurfaceChargesGenerator::initialize
virtual StatusCode initialize() override
AlgTool initialize.
Definition: StripSurfaceChargesGenerator.cxx:49
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
ITk::StripSurfaceChargesGenerator::Hists::m_h_gen1
TProfile * m_h_gen1
Definition: StripSurfaceChargesGenerator.h:159
ITk::StripSurfaceChargesGenerator::m_doInducedChargeModel
BooleanProperty m_doInducedChargeModel
Definition: StripSurfaceChargesGenerator.h:120
ITk::StripSurfaceChargesGenerator::maxDriftTime
float maxDriftTime(const InDetDD::SiDetectorElement *element, const EventContext &ctx) const
max drift charge equivalent to the detector thickness
Definition: StripSurfaceChargesGenerator.cxx:261
ITk::StripSurfaceChargesGenerator::m_useSiCondDB
BooleanProperty m_useSiCondDB
Definition: StripSurfaceChargesGenerator.h:113
ISCT_RadDamageSummaryTool.h
ITk::StripSurfaceChargesGenerator::Hists::m_h_depD
TH1F * m_h_depD
Definition: StripSurfaceChargesGenerator.h:145
ISurfaceChargesGenerator.h
ITk::StripSurfaceChargesGenerator::m_siConditionsTool
ToolHandle< ISiliconConditionsTool > m_siConditionsTool
Definition: StripSurfaceChargesGenerator.h:125
ReadCondHandle.h
ITk::StripSurfaceChargesGenerator::~StripSurfaceChargesGenerator
virtual ~StripSurfaceChargesGenerator()=default
Destructor.
ITk::StripSurfaceChargesGenerator::m_tSurfaceDrift
FloatProperty m_tSurfaceDrift
related to the surface drift
Definition: StripSurfaceChargesGenerator.h:108
ITk::StripSurfaceChargesGenerator::m_tHalfwayDrift
float m_tHalfwayDrift
Surface drift time.
Definition: StripSurfaceChargesGenerator.h:133
SiHit
Definition: SiHit.h:19
ITk::StripSurfaceChargesGenerator::m_doRamo
BooleanProperty m_doRamo
Definition: StripSurfaceChargesGenerator.h:118
ITk::StripSurfaceChargesGenerator::Hists::m_h_efieldz
TProfile * m_h_efieldz
Definition: StripSurfaceChargesGenerator.h:142
ITk::StripSurfaceChargesGenerator::finalize
virtual StatusCode finalize() override
AlgTool finalize.
Definition: StripSurfaceChargesGenerator.cxx:185
ITk::StripSurfaceChargesGenerator::Hists::m_h_vel
TProfile * m_h_vel
Definition: StripSurfaceChargesGenerator.h:156
ITk::StripSurfaceChargesGenerator::m_lorentzAngleTool
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
Definition: StripSurfaceChargesGenerator.h:126
ITk::StripSurfaceChargesGenerator::Hists::m_h_gen2
TProfile * m_h_gen2
Definition: StripSurfaceChargesGenerator.h:160
ITk::StripSurfaceChargesGenerator::Hists::m_h_drift_electrode
TH2F * m_h_drift_electrode
Definition: StripSurfaceChargesGenerator.h:146
ITk::StripSurfaceChargesGenerator::Hists::m_h_mob_Char
TProfile * m_h_mob_Char
Definition: StripSurfaceChargesGenerator.h:155
ITk::StripSurfaceChargesGenerator::m_distInterStrip
float m_distInterStrip
Inter strip distance normalized to 1.
Definition: StripSurfaceChargesGenerator.h:134
ITk::StripSurfaceChargesGenerator::m_numberOfCharges
IntegerProperty m_numberOfCharges
Definition: StripSurfaceChargesGenerator.h:104
ITk::StripSurfaceChargesGenerator::maxDiffusionSigma
float maxDiffusionSigma(const InDetDD::SiDetectorElement *element, const EventContext &ctx) const
max sigma diffusion
Definition: StripSurfaceChargesGenerator.cxx:274
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CLHEP
STD'S.
Definition: IAtRndmGenSvc.h:19
AthAlgTool.h
ITk::StripSurfaceChargesGenerator::Hists::m_h_notrap_drift_t
TH1F * m_h_notrap_drift_t
Definition: StripSurfaceChargesGenerator.h:154
ITk::StripSurfaceChargesGenerator::m_InducedChargeModel
std::unique_ptr< InducedChargeModel > m_InducedChargeModel
Definition: StripSurfaceChargesGenerator.h:168
ITk::StripSurfaceChargesGenerator::Hists::m_h_velocity_trap
TProfile * m_h_velocity_trap
Definition: StripSurfaceChargesGenerator.h:161
test_pyathena.parent
parent
Definition: test_pyathena.py:15
MuonSegmentReaderConfig.histSvc
histSvc
Definition: MuonSegmentReaderConfig.py:96
python.SystemOfUnits.micrometer
int micrometer
Definition: SystemOfUnits.py:71
ITk::StripSurfaceChargesGenerator::m_tfix
FloatProperty m_tfix
Definition: StripSurfaceChargesGenerator.h:110
ITk::StripSurfaceChargesGenerator::Hists::m_h_mobility_trap
TProfile * m_h_mobility_trap
Definition: StripSurfaceChargesGenerator.h:162
ITk
Definition: ITkPixelOfflineCalibCondAlg.cxx:14
ITk::StripSurfaceChargesGenerator::Hists::m_h_drift1
TProfile * m_h_drift1
Definition: StripSurfaceChargesGenerator.h:157
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
IdentifierHash.h
ITk::StripSurfaceChargesGenerator::m_isOverlay
BooleanProperty m_isOverlay
Definition: StripSurfaceChargesGenerator.h:119
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
TProfile
Definition: rootspy.cxx:515
ITk::StripSurfaceChargesGenerator::Hists::m_h_ztrap
TH1F * m_h_ztrap
Definition: StripSurfaceChargesGenerator.h:147
ITk::StripSurfaceChargesGenerator::m_thistSvc
ServiceHandle< ITHistSvc > m_thistSvc
Definition: StripSurfaceChargesGenerator.h:128
ITk::StripSurfaceChargesGenerator::Hists::m_h_drift_time
TH1F * m_h_drift_time
Definition: StripSurfaceChargesGenerator.h:148
ITk::StripSurfaceChargesGenerator::m_vbias
FloatProperty m_vbias
Definition: StripSurfaceChargesGenerator.h:115
SG::ReadCondHandleKey< AtlasFieldCacheCondObj >
ITk::StripSurfaceChargesGenerator::m_smallStepLength
FloatProperty m_smallStepLength
Definition: StripSurfaceChargesGenerator.h:105
ITk::StripSurfaceChargesGenerator::m_h
std::unique_ptr< Hists > m_h
Definition: StripSurfaceChargesGenerator.h:165
ITk::StripSurfaceChargesGenerator::StripSurfaceChargesGenerator
StripSurfaceChargesGenerator(const std::string &type, const std::string &name, const IInterface *parent)
constructor
Definition: StripSurfaceChargesGenerator.cxx:40
TH1F
Definition: rootspy.cxx:320
ITk::StripSurfaceChargesGenerator::diffusionSigma
float diffusionSigma(float zhit, const InDetDD::SiDetectorElement *element, const EventContext &ctx) const
calculate diffusion sigma from a gaussian dist scattered charge
Definition: StripSurfaceChargesGenerator.cxx:242
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
ITk::StripSurfaceChargesGenerator::processSiHit
void processSiHit(const InDetDD::SiDetectorElement *element, const SiHit &phit, ISiSurfaceChargesInserter &inserter, float eventTime, unsigned short eventID, CLHEP::HepRandomEngine *rndmEngine, const EventContext &ctx) const
Definition: StripSurfaceChargesGenerator.cxx:326
ITk::StripSurfaceChargesGenerator::Hists::m_h_gen
TProfile * m_h_gen
Definition: StripSurfaceChargesGenerator.h:158
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ITk::StripSurfaceChargesGenerator::m_SurfaceDriftFlag
bool m_SurfaceDriftFlag
surface drift ON/OFF
Definition: StripSurfaceChargesGenerator.h:137
ITk::StripSurfaceChargesGenerator::m_fieldCacheCondObjInputKey
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheCondObjInputKey
Definition: StripSurfaceChargesGenerator.h:130
ITk::StripSurfaceChargesGenerator::m_siPropertiesTool
ToolHandle< ISiPropertiesTool > m_siPropertiesTool
Definition: StripSurfaceChargesGenerator.h:123
ITk::StripSurfaceChargesGenerator
Definition: StripSurfaceChargesGenerator.h:62
ISiliconConditionsTool.h
ITk::StripSurfaceChargesGenerator::m_radDamageTool
ToolHandle< ISCT_RadDamageSummaryTool > m_radDamageTool
Definition: StripSurfaceChargesGenerator.h:124
python.SystemOfUnits.ns
int ns
Definition: SystemOfUnits.py:130
ITk::StripSurfaceChargesGenerator::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: StripSurfaceChargesGenerator.cxx:313
ITk::StripSurfaceChargesGenerator::Hists::m_h_efield
TH1F * m_h_efield
Definition: StripSurfaceChargesGenerator.h:143
ISiSurfaceChargesInserter
Definition: ISurfaceChargesGenerator.h:32
ITk::StripSurfaceChargesGenerator::Hists::book
StatusCode book(ITHistSvc &histSvc)
Definition: StripSurfaceChargesGenerator.cxx:109
ITk::StripSurfaceChargesGenerator::setFixedTime
virtual void setFixedTime(float fixedTime) override
Definition: StripSurfaceChargesGenerator.h:79
ITk::StripSurfaceChargesGenerator::chargeIsTrapped
bool chargeIsTrapped(double spess, const InDetDD::SiDetectorElement *element, double &trap_pos, double &drift_time) const
Definition: StripSurfaceChargesGenerator.cxx:622
ITk::StripSurfaceChargesGenerator::surfaceDriftTime
float surfaceDriftTime(float ysurf) const
Calculate of the surface drift time.
Definition: StripSurfaceChargesGenerator.cxx:288
ServiceHandle< ITHistSvc >