ATLAS Offline Software
Loading...
Searching...
No Matches
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
11
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
41class SiHit;
42
43// -- do charge trapping histos
44class ITHistSvc;
45class TH1F;
46class TH2F;
47class TProfile;
48
49namespace InDetDD {
51}
52
53namespace CLHEP {
54 class HepRandomEngine;
55}
56
57template <class HIT> class TimedHitPtr;
58
59namespace ITk
60{
61
62class 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,
85 CLHEP::HepRandomEngine * rndmEngine,
86 const EventContext& ctx) override;
87 void processSiHit(const InDetDD::SiDetectorElement* element,
88 const SiHit& phit,
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);
142 TProfile* m_h_efieldz{nullptr};
143 TH1F* m_h_efield{nullptr};
144 TH1F* m_h_spess{nullptr};
145 TH1F* m_h_depD{nullptr};
146 TH2F* m_h_drift_electrode{nullptr};
147 TH1F* m_h_ztrap{nullptr};
148 TH1F* m_h_drift_time{nullptr};
149 TH1F* m_h_t_electrode{nullptr};
150 TH1F* m_h_zhit{nullptr};
151 TH1F* m_h_ztrap_tot{nullptr};
152 TH1F* m_h_no_ztrap{nullptr};
153 TH1F* m_h_trap_drift_t{nullptr};
154 TH1F* m_h_notrap_drift_t{nullptr};
155 TProfile* m_h_mob_Char{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};
161 TProfile* m_h_velocity_trap{nullptr};
162 TProfile* m_h_mobility_trap{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
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
float maxDriftTime(const InDetDD::SiDetectorElement *element, const EventContext &ctx) const
max drift charge equivalent to the detector thickness
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheCondObjInputKey
bool chargeIsTrapped(double spess, const InDetDD::SiDetectorElement *element, double &trap_pos, double &drift_time) const
virtual StatusCode initialize() override
AlgTool initialize.
float surfaceDriftTime(float ysurf) const
Calculate of the surface drift time.
float diffusionSigma(float zhit, const InDetDD::SiDetectorElement *element, const EventContext &ctx) const
calculate diffusion sigma from a gaussian dist scattered charge
void processSiHit(const InDetDD::SiDetectorElement *element, const SiHit &phit, ISiSurfaceChargesInserter &inserter, float eventTime, unsigned short eventID, CLHEP::HepRandomEngine *rndmEngine, const EventContext &ctx) const
ToolHandle< ISiPropertiesTool > m_siPropertiesTool
virtual StatusCode finalize() override
AlgTool finalize.
FloatProperty m_tSurfaceDrift
related to the surface drift
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
ToolHandle< ISiliconConditionsTool > m_siConditionsTool
virtual ~StripSurfaceChargesGenerator()=default
Destructor.
float m_distInterStrip
Inter strip distance normalized to 1.
float maxDiffusionSigma(const InDetDD::SiDetectorElement *element, const EventContext &ctx) const
max sigma diffusion
std::unique_ptr< InducedChargeModel > m_InducedChargeModel
StripSurfaceChargesGenerator(const std::string &type, const std::string &name, const IInterface *parent)
constructor
virtual void setFixedTime(float fixedTime) override
float m_distHalfInterStrip
Half way distance inter strip.
ToolHandle< ISCT_RadDamageSummaryTool > m_radDamageTool
Class to hold geometrical description of a silicon detector element.
Definition SiHit.h:19
a smart pointer to a hit that also provides access to the extended timing info of the host event.
Definition TimedHitPtr.h:18
const std::string process
Message Stream Member.
TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)