ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetDigitization
SCT_Digitization
src
SCT_Amp.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
SCT_Amp.h
"
6
7
// CLHEP
8
#include "CLHEP/Units/SystemOfUnits.h"
9
10
//STD includes
11
#include <cmath>
12
#include <fstream>
13
14
//#define SCT_DIG_DEBUG
15
16
// constructor
17
SCT_Amp::SCT_Amp
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent)
18
: base_class(
type
, name, parent)
19
{
20
}
21
22
//----------------------------------------------------------------------
23
// Initialize
24
//----------------------------------------------------------------------
25
StatusCode
SCT_Amp::initialize
() {
26
27
StatusCode
sc
{AthAlgTool::initialize()};
28
if
(
sc
.isFailure()) {
29
ATH_MSG_FATAL
(
"SCT_Amp::initialize() failed"
);
30
return
sc
;
31
}
32
ATH_MSG_DEBUG
(
"SCT_Amp::initialize()"
);
33
35
m_PeakTime
.setValue(
m_PeakTime
.value() * CLHEP::ns);
36
m_dt
.setValue(
m_dt
.value() * CLHEP::ns);
37
m_tmin
.setValue(
m_tmin
.value() * CLHEP::ns);
38
m_tmax
.setValue(
m_tmax
.value() * CLHEP::ns);
39
40
m_NormConstCentral
= (exp(3.0)/27.0)*(1.0-
m_CrossFactor2sides
)*(1.0-
m_CrossFactorBack
);
41
m_NormConstNeigh
= exp(3.0-sqrt(3.0))/(6*(2.0*sqrt(3.0)-3.0));
42
m_NormConstNeigh
*= (
m_CrossFactor2sides
/2.0)*(1.0-
m_CrossFactorBack
);
43
44
#ifdef SCT_DIG_DEBUG
45
ATH_MSG_INFO
(
"\tAmp created, PeakTime = "
<<
m_PeakTime
);
46
ATH_MSG_INFO
(
"\tResponse will be CR-RC^3 with tp = "
<<
m_PeakTime
/3.0);
47
ATH_MSG_INFO
(
"\tCoupling to both neighbours = "
<<
m_CrossFactor2sides
);
48
ATH_MSG_INFO
(
"\tCoupling to backplane = "
<<
m_CrossFactorBack
);
49
ATH_MSG_INFO
(
"\tNormalization for central "
<<
m_NormConstCentral
);
50
ATH_MSG_INFO
(
"\tNormalization for neighbour "
<<
m_NormConstNeigh
);
51
#endif
52
53
return
sc
;
54
}
55
56
//----------------------------------------------------------------------
57
// Finalize
58
//----------------------------------------------------------------------
59
StatusCode
SCT_Amp::finalize
() {
60
StatusCode
sc
{AthAlgTool::finalize()};
61
if
(
sc
.isFailure()) {
62
ATH_MSG_FATAL
(
"SCT_Amp::finalize() failed"
);
63
return
sc
;
64
}
65
ATH_MSG_DEBUG
(
"SCT_Amp::finalize()"
);
66
return
sc
;
67
}
68
69
//----------------------------------------------------------------------
70
// Electronique response is now CR-RC^3 of the charge diode
71
//----------------------------------------------------------------------
72
float
SCT_Amp::response
(
const
list_t& Charges,
const
float
timeOfThreshold)
const
{
73
float
resp{0.0};
74
float
tp{
static_cast<
float
>
(
m_PeakTime
/3.0)};
// for CR-RC^3
75
for
(
const
SiCharge
&
charge
: Charges) {
76
float
ch{
static_cast<
float
>
(
charge
.charge())};
77
float
tC{
static_cast<
float
>
(timeOfThreshold -
charge
.time())};
78
if
(tC > 0.0) {
79
tC/=tp;
//to avoid doing it four times
80
resp += ch*tC*tC*tC*std::exp(-tC);
//faster than pow
81
}
82
}
83
return
resp*
m_NormConstCentral
;
84
}
85
86
void
SCT_Amp::response
(
const
list_t& Charges,
const
float
timeOfThreshold, std::vector<float>&
response
)
const
{
87
short
bin_max{
static_cast<
short
>
(
response
.size())};
88
std::fill(
response
.begin(),
response
.end(), 0.0);
89
float
tp{
static_cast<
float
>
(
m_PeakTime
/3.0)};
// for CR-RC^3
90
for
(
const
SiCharge
&
charge
: Charges) {
91
float
ch{
static_cast<
float
>
(
charge
.charge())};
92
float
ch_time{
static_cast<
float
>
(
charge
.time())};
93
short
bin_end{
static_cast<
short
>
(bin_max-1)};
94
for
(
short
bin
{-1};
bin
<bin_end; ++
bin
) {
95
float
bin_timeOfThreshold{timeOfThreshold +
bin
*25};
//25, fix me
96
float
tC{bin_timeOfThreshold - ch_time};
97
if
(tC > 0.0) {
98
tC/=tp;
//to avoid doing it four times
99
response
[
bin
+1] += ch*tC*tC*tC*std::exp(-tC);
//faster than pow
100
}
101
}
102
}
103
for
(
short
bin
{0};
bin
<bin_max; ++
bin
)
response
[
bin
] =
response
[
bin
]*
m_NormConstCentral
;
104
}
105
106
//----------------------------------------------------------------------
107
// differenciated and scaled pulse on the neighbour strip!
108
//----------------------------------------------------------------------
109
float
SCT_Amp::crosstalk
(
const
list_t& Charges,
const
float
timeOfThreshold)
const
{
110
float
resp{0};
111
float
tp{
static_cast<
float
>
(
m_PeakTime
/3.0)};
// for CR-RC^3
112
for
(
const
SiCharge
&
charge
: Charges) {
113
float
ch{
static_cast<
float
>
(
charge
.charge())};
114
float
tC{
static_cast<
float
>
(timeOfThreshold -
charge
.time())};
115
if
(tC > 0.0) {
116
tC/=tp;
//to avoid doing it four times
117
resp += ch*tC*tC*std::exp(-tC)*(3.0-tC);
//faster than pow
118
}
119
}
120
return
resp*
m_NormConstNeigh
;
121
}
122
123
void
SCT_Amp::crosstalk
(
const
list_t& Charges,
const
float
timeOfThreshold, std::vector<float>&
response
)
const
{
124
short
bin_max{
static_cast<
short
>
(
response
.size())};
125
std::fill(
response
.begin(),
response
.end(), 0.0);
126
float
tp{
static_cast<
float
>
(
m_PeakTime
/3.0)};
// for CR-RC^3
127
for
(
const
SiCharge
&
charge
: Charges) {
128
float
ch{
static_cast<
float
>
(
charge
.charge())};
129
float
ch_time{
static_cast<
float
>
(
charge
.time())};
130
short
bin_end{
static_cast<
short
>
(bin_max-1)};
131
for
(
short
bin
{-1};
bin
<bin_end; ++
bin
) {
132
float
bin_timeOfThreshold{timeOfThreshold +
bin
*25};
// 25, fix me
133
float
tC{bin_timeOfThreshold - ch_time};
134
if
(tC > 0.0) {
135
tC/=tp;
//to avoid doing it four times
136
response
[
bin
+1] += ch*tC*tC*std::exp(-tC)*(3.0-tC);
//faster than pow
137
}
138
}
139
}
140
for
(
short
bin
{0};
bin
<bin_max; ++
bin
)
response
[
bin
] =
response
[
bin
]*
m_NormConstNeigh
;
141
}
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition
AthMsgStreamMacros.h:34
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
charge
double charge(const T &p)
Definition
AtlasPID.h:1003
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
SCT_Amp.h
SCT_Amp::response
virtual float response(const list_t &Charges, const float timeOverThreshold) const override
main purpose: CR-RC^3 response to a list of charges with times
Definition
SCT_Amp.cxx:72
SCT_Amp::m_NormConstNeigh
float m_NormConstNeigh
Normalisation factor for the neighbour strip signal response.
Definition
SCT_Amp.h:66
SCT_Amp::m_PeakTime
FloatProperty m_PeakTime
signal peak time
Definition
SCT_Amp.h:50
SCT_Amp::m_tmax
FloatProperty m_tmax
Definition
SCT_Amp.h:59
SCT_Amp::m_tmin
FloatProperty m_tmin
Definition
SCT_Amp.h:58
SCT_Amp::SCT_Amp
SCT_Amp(const std::string &type, const std::string &name, const IInterface *parent)
constructor
Definition
SCT_Amp.cxx:17
SCT_Amp::finalize
virtual StatusCode finalize() override
AlgTool finalize.
Definition
SCT_Amp.cxx:59
SCT_Amp::m_CrossFactor2sides
FloatProperty m_CrossFactor2sides
Cross factor 2 side.
Definition
SCT_Amp.h:53
SCT_Amp::m_dt
FloatProperty m_dt
Definition
SCT_Amp.h:60
SCT_Amp::m_CrossFactorBack
FloatProperty m_CrossFactorBack
cross factor
Definition
SCT_Amp.h:56
SCT_Amp::crosstalk
virtual float crosstalk(const list_t &Charges, const float timeOverThreshold) const override
Neighbour strip cross talk response strip to a list of charges with times.
Definition
SCT_Amp.cxx:109
SCT_Amp::initialize
virtual StatusCode initialize() override
AlgTool initialize.
Definition
SCT_Amp.cxx:25
SCT_Amp::m_NormConstCentral
float m_NormConstCentral
Normalisation factor for the signal response.
Definition
SCT_Amp.h:63
SiCharge
Definition
SiCharge.h:25
bin
Definition
BinsDiffFromStripMedian.h:43
type
Generated on
for ATLAS Offline Software by
1.17.0