ATLAS Offline Software
Loading...
Searching...
No Matches
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
31
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
60class SiHit;
61
62// -- do charge trapping histos
63class ITHistSvc;
64class TH1F;
65class TH2F;
66class TProfile;
67
68namespace InDetDD {
71}
72
73namespace CLHEP {
74 class HepRandomEngine;
75}
76
77template <class HIT> class TimedHitPtr;
78
79class 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
148 TProfile* m_h_efieldz{nullptr};
149 TH1F* m_h_efield{nullptr};
150 TH1F* m_h_spess{nullptr};
151 TH1F* m_h_depD{nullptr};
152 TH2F* m_h_drift_electrode{nullptr};
153 TH1F* m_h_ztrap{nullptr};
154 TH1F* m_h_drift_time{nullptr};
155 TH1F* m_h_t_electrode{nullptr};
156 TH1F* m_h_zhit{nullptr};
157 TH1F* m_h_ztrap_tot{nullptr};
158 TH1F* m_h_no_ztrap{nullptr};
159 TH1F* m_h_trap_drift_t{nullptr};
160 TH1F* m_h_notrap_drift_t{nullptr};
161 TProfile* m_h_mob_Char{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};
167 TProfile* m_h_velocity_trap{nullptr};
168 TProfile* m_h_mobility_trap{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
Base class for the SCT module side design, extended by the Forward and Barrel module design.
Class to hold geometrical description of a silicon detector element.
virtual void setFixedTime(float fixedTime) override
virtual ~SCT_SurfaceChargesGenerator()=default
Destructor.
float diffusionSigma(float zhit, const InDetDD::SiDetectorElement *element, const EventContext &ctx) const
calculate diffusion sigma from a gaussian dist scattered charge
ToolHandle< ISCT_RadDamageSummaryTool > m_radDamageTool
float maxDiffusionSigma(const InDetDD::SiDetectorElement *element, const EventContext &ctx) const
max sigma diffusion
SCT_SurfaceChargesGenerator(const std::string &type, const std::string &name, const IInterface *parent)
constructor
std::unique_ptr< InducedChargeModel > m_InducedChargeModel
bool m_SurfaceDriftFlag
surface drift ON/OFF
float m_distHalfInterStrip
Half way distance inter strip.
float maxDriftTime(const InDetDD::SiDetectorElement *element, const EventContext &ctx) const
max drift charge equivalent to the detector thickness
ToolHandle< ISiliconConditionsTool > m_siConditionsTool
void processSiHit(const InDetDD::SiDetectorElement *element, const SiHit &phit, ISiSurfaceChargesInserter &inserter, float eventTime, unsigned short eventID, CLHEP::HepRandomEngine *rndmEngine, const EventContext &ctx)
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
ServiceHandle< ITHistSvc > m_thistSvc
virtual StatusCode initialize() override
AlgTool initialize.
bool chargeIsTrapped(double spess, const InDetDD::SiDetectorElement *element, double &trap_pos, double &drift_time)
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheCondObjInputKey
virtual StatusCode finalize() override
AlgTool finalize.
FloatProperty m_tSurfaceDrift
related to the surface drift
float m_distInterStrip
Inter strip distance normalized to 1.
float surfaceDriftTime(float ysurf) const
Calculate of the surface drift time.
ToolHandle< ISiPropertiesTool > m_siPropertiesTool
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 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)