ATLAS Offline Software
Loading...
Searching...
No Matches
InducedChargeModel.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef SIDIGITIZATION_INDUCEDCHARGEDMODEL_H
6#define SIDIGITIZATION_INDUCEDCHARGEDMODEL_H
7
8//-----------------------------------------------
9// 2020.8.12 Implementation in Athena by Manabu Togawa
10// 2017.7.24 update for the case of negative VD (type-P)
11// 2017.7.17 updated
12// 2016.4.3 for ICM (induced charge model) by Taka Kondo (KEK)
13//-----------------------------------------------
14
15// Athena
23
24// Gaudi
25#include "GaudiKernel/PhysicalConstants.h"
26#include "GaudiKernel/ToolHandle.h"
27#include "GaudiKernel/ServiceHandle.h"
29// Random number
30#include "CLHEP/Random/RandFlat.h"
31#include "CLHEP/Random/RandGaussZiggurat.h" // for RandGaussZiggurat
32#include "CLHEP/Random/RandPoisson.h"
33#include "CLHEP/Units/SystemOfUnits.h"
34
35// C++ Standard Library
36#include <array>
37#include <memory>
38#include <mutex>
39#include <string>
40#include <utility>
41#include <vector>
42
44
45 public:
50
52 float m_VD; // full depletion voltage [Volt] negative for type-P
53 float m_VB; // applied bias voltage [Volt]
54 float m_T; // temperature
59 CLHEP::HepRandomEngine* m_rndmEngine;
60 std::array<std::array<double, NDepthPoints>, NEFieldPoints> m_ExValue;
61 std::array<std::array<double, NDepthPoints>, NEFieldPoints> m_EyValue;
62
63 SCT_InducedChargeModelData(const float vdepl,
64 const float vbias,
66 const Amg::Vector3D& magneticField, // in kTesla
67 const float bulk_depth,
68 const EFieldModel model,
69 const ToolHandle<ISiliconConditionsTool> siConditionsTool,
70 CLHEP::HepRandomEngine* rndmEngine,
71 const EventContext& ctx) :
72 m_VD (vdepl), // full depletion voltage [Volt] negative for type-P
73 m_VB (vbias), // applied bias voltage [Volt]
74 m_element (element),
75 m_magneticField (magneticField)
76 {
77 //------------ find delepletion deph for model=0 and 1 -------------
78 m_depletion_depth = bulk_depth;
79 // for type N (before type inversion)
80 if (m_VD >= 0.) {
81 if (m_VB < m_VD) m_depletion_depth = std::sqrt(m_VB/m_VD) * bulk_depth;
82 } else {
83 // for type P
84 if (m_VB <= std::abs(m_VD)) m_depletion_depth = 0.;
85 }
86
87 m_EFieldModel = model;
88 m_T = siConditionsTool->temperature(m_element->identifyHash(), ctx) + Gaudi::Units::STP_Temperature;
89 m_rndmEngine = rndmEngine;
90 }
91 };
92
93 InducedChargeModel(size_t maxHash, EFieldModel model=FEMsolutions);
94
95 SCT_InducedChargeModelData*
96 setWaferData(const float vdepl,
97 const float vbias,
99 const AtlasFieldCacheCondObj* fieldCondObj,
100 const ToolHandle<ISiliconConditionsTool>& siConditionsTool,
101 CLHEP::HepRandomEngine* rndmEngine,
102 const EventContext& ctx) const;
103
104 void setEField(SCT_InducedChargeModelData& data) const;
105
106 void transport(const SCT_InducedChargeModelData& data,
107 const bool isElectron,
108 const double x0, const double y0,
109 double* Q_m2, double* Q_m1, double* Q_00, double* Q_p1, double* Q_p2,
110 const IdentifierHash hashId,
111 const ToolHandle<ISiPropertiesTool>& siPropertiesTool,
112 const EventContext& ctx) const;
113 void holeTransport(const SCT_InducedChargeModelData& data,
114 const double x0, const double y0,
115 double* Q_m2, double* Q_m1, double* Q_00, double* Q_p1, double* Q_p2,
116 const IdentifierHash hashId,
117 const ToolHandle<ISiPropertiesTool>& siPropertiesTool,
118 const EventContext& ctx) const;
119 void electronTransport(const SCT_InducedChargeModelData& data,
120 const double x0, const double y0,
121 double* Q_m2, double* Q_m1, double* Q_00, double* Q_p1, double* Q_p2,
122 const IdentifierHash hashId,
123 const ToolHandle<ISiPropertiesTool>& siPropertiesTool,
124 const EventContext& ctx) const;
125
126 private:
127
128 void loadICMParameters();
129
130 bool getVxVyD(const SCT_InducedChargeModelData& data,
131 const bool isElectron,
132 const double x, const double y, double& vx, double& vy, double& D,
133 const IdentifierHash hashId,
134 const ToolHandle<ISiPropertiesTool>& siPropertiesTool,
135 const EventContext& ctx) const;
136 double induced(const SCT_InducedChargeModelData& data,
137 const int istrip, const double x, const double y) const;
138 void getEField(const SCT_InducedChargeModelData& data,
139 const double x, const double y, double& Ex, double& Ey) const;
140
141 static size_t getFEMIndex(SCT_InducedChargeModelData& data) ;
142
143 //-------- parameters for e, h transport --------------------------------
144 static const double s_kB; // [m^2*kg/s^2/K]
145 static const double s_e; // [Coulomb]
146
147 //------parameters given externally by jobOptions ------------------
148 EFieldModel m_EFieldModel; // 0 (flat diode model), 1 (FEM solusions), 2 (uniform E)
149 double m_transportTimeStep = 0.50; // one step side in time [nsec]
150 double m_transportTimeMax = m_transportTimeStep*NTransportSteps; // maximun tracing time [nsec]
151
152 //------parameters mostly fixed but can be changed externally ------------
153 double m_bulk_depth = 0.0285; // in [cm]
154 double m_strip_pitch = 0.0080; // in [cm]
155 double m_y_origin_min = 0.;
156
157 //---------- arrays of FEM analysis -----------------------------------
158 // Storages for Ramo potential and Electric field.
159 // In strip pitch directions :
160 // Ramo potential : 80 divisions (81 points) with 5 um intervals from 40-440 um.
161 // Electric field : 16 divisions (17 points) with 2.5 um intervals from 0-40 um.
162 // In sensor depth directions (for both potential and Electric field):
163 // 114 divisions (115 points) with 2.5 nm intervals for 285 um.
164
165 std::vector<std::array<std::array<double, NDepthPoints>, NRamoPoints>> m_PotentialValue;
166 std::vector<std::array<std::array<double, NDepthPoints>, NEFieldPoints>> m_ExValue;
167 std::vector<std::array<std::array<double, NDepthPoints>, NEFieldPoints>> m_EyValue;
168
169 // Cache of SCT_InducedChargeModelData for each wafer.
170 // Assuming wafer parameters do not change during a job.
171 // This should be almost always satisfied.
172 mutable std::vector<std::unique_ptr<SCT_InducedChargeModelData>> m_data ATLAS_THREAD_SAFE; // Guarded by m_mutex
173 // To protect concurrent access to m_data
174 mutable std::mutex m_mutex;
175
176 static const std::vector<float> s_VFD0;
177 static const std::vector<std::string> s_VFD0str;
178};
179
180#endif // SIDIGITIZATION_INDUCEDCHARGEDMODEL_H
bool isElectron(const T &p)
Definition AtlasPID.h:202
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
#define y
#define x
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
This is a "hash" representation of an Identifier.
Class to hold geometrical description of a solid state detector element.
std::vector< std::array< std::array< double, NDepthPoints >, NEFieldPoints > > m_EyValue
double induced(const SCT_InducedChargeModelData &data, const int istrip, const double x, const double y) const
bool getVxVyD(const SCT_InducedChargeModelData &data, const bool isElectron, const double x, const double y, double &vx, double &vy, double &D, const IdentifierHash hashId, const ToolHandle< ISiPropertiesTool > &siPropertiesTool, const EventContext &ctx) const
std::vector< std::unique_ptr< SCT_InducedChargeModelData > > m_data ATLAS_THREAD_SAFE
static const std::vector< std::string > s_VFD0str
static size_t getFEMIndex(SCT_InducedChargeModelData &data)
void holeTransport(const SCT_InducedChargeModelData &data, const double x0, const double y0, double *Q_m2, double *Q_m1, double *Q_00, double *Q_p1, double *Q_p2, const IdentifierHash hashId, const ToolHandle< ISiPropertiesTool > &siPropertiesTool, const EventContext &ctx) const
void getEField(const SCT_InducedChargeModelData &data, const double x, const double y, double &Ex, double &Ey) const
static const std::vector< float > s_VFD0
void electronTransport(const SCT_InducedChargeModelData &data, const double x0, const double y0, double *Q_m2, double *Q_m1, double *Q_00, double *Q_p1, double *Q_p2, const IdentifierHash hashId, const ToolHandle< ISiPropertiesTool > &siPropertiesTool, const EventContext &ctx) const
static const double s_e
void transport(const SCT_InducedChargeModelData &data, const bool isElectron, const double x0, const double y0, double *Q_m2, double *Q_m1, double *Q_00, double *Q_p1, double *Q_p2, const IdentifierHash hashId, const ToolHandle< ISiPropertiesTool > &siPropertiesTool, const EventContext &ctx) const
void setEField(SCT_InducedChargeModelData &data) const
std::vector< std::array< std::array< double, NDepthPoints >, NRamoPoints > > m_PotentialValue
static const double s_kB
SCT_InducedChargeModelData * setWaferData(const float vdepl, const float vbias, const InDetDD::SolidStateDetectorElementBase *element, const AtlasFieldCacheCondObj *fieldCondObj, const ToolHandle< ISiliconConditionsTool > &siConditionsTool, CLHEP::HepRandomEngine *rndmEngine, const EventContext &ctx) const
std::vector< std::array< std::array< double, NDepthPoints >, NEFieldPoints > > m_ExValue
InducedChargeModel(size_t maxHash, EFieldModel model=FEMsolutions)
Eigen::Matrix< double, 3, 1 > Vector3D
const InDetDD::SolidStateDetectorElementBase * m_element
SCT_InducedChargeModelData(const float vdepl, const float vbias, const InDetDD::SolidStateDetectorElementBase *element, const Amg::Vector3D &magneticField, const float bulk_depth, const EFieldModel model, const ToolHandle< ISiliconConditionsTool > siConditionsTool, CLHEP::HepRandomEngine *rndmEngine, const EventContext &ctx)
std::array< std::array< double, NDepthPoints >, NEFieldPoints > m_EyValue
std::array< std::array< double, NDepthPoints >, NEFieldPoints > m_ExValue