SimG4CMS
Calo
src
EnergyResolutionVsLumi.cc
Go to the documentation of this file.
1
#include <string>
2
#include <vector>
3
#include "
SimG4CMS/Calo/interface/EvolutionECAL.h
"
4
#include "
SimG4CMS/Calo/interface/EnergyResolutionVsLumi.h
"
5
#include "
DataFormats/EcalDetId/interface/EBDetId.h
"
6
#include "
DataFormats/EcalDetId/interface/EEDetId.h
"
7
#include "
DataFormats/EcalDetId/interface/EcalSubdetector.h
"
8
9
EnergyResolutionVsLumi::EnergyResolutionVsLumi
() {
10
m_lumi
= 0;
11
m_instlumi
= 0;
12
}
13
14
EnergyResolutionVsLumi::~EnergyResolutionVsLumi
() {}
15
16
EnergyResolutionVsLumi::DegradationAtEta
EnergyResolutionVsLumi::CalculateDegradation
(
double
eta
) {
17
DegradationAtEta
result
;
18
19
result
.eta =
eta
;
20
double
totLumi =
m_lumi
;
21
double
instLumi
=
m_instlumi
;
22
23
EvolutionECAL
model
;
24
25
// Index of induced absorption due to EM damages in PWO4
26
result
.muEM =
model
.InducedAbsorptionEM(
instLumi
,
eta
);
27
28
// Index of induced absorption due to hadron damages in PWO4
29
result
.muHD =
model
.InducedAbsorptionHadronic(totLumi,
eta
);
30
31
// Average degradation of amplitude due to transparency change
32
result
.ampDropTransparency =
model
.DegradationMeanEM50GeV(
result
.muEM +
result
.muHD);
33
34
// Average degradation of amplitude due to photo-detector aging
35
result
.ampDropPhotoDetector =
model
.AgingVPT(
instLumi
, totLumi,
eta
);
36
37
result
.ampDropTotal =
result
.ampDropTransparency *
result
.ampDropPhotoDetector;
38
39
// Noise increase in ADC counts due to photo-detector and front-end
40
result
.noiseIncreaseADC =
model
.NoiseFactorFE(totLumi,
eta
);
41
42
// Resolution degradation due to LY non-uniformity caused by transparency loss
43
result
.resolutitonConstantTerm =
model
.ResolutionConstantTermEM50GeV(
result
.muEM +
result
.muHD);
44
45
return
result
;
46
}
47
48
double
EnergyResolutionVsLumi::calcmuEM
(
double
eta
) {
49
double
instLumi
=
m_instlumi
;
50
EvolutionECAL
model
;
51
double
result
=
model
.InducedAbsorptionEM(
instLumi
,
eta
);
52
return
result
;
53
}
54
55
double
EnergyResolutionVsLumi::calcmuHD
(
double
eta
) {
56
double
totLumi =
m_lumi
;
57
EvolutionECAL
model
;
58
double
result
=
model
.InducedAbsorptionHadronic(totLumi,
eta
);
59
return
result
;
60
}
61
62
void
EnergyResolutionVsLumi::calcmuTot
() {
63
for
(
int
iEta
= 1;
iEta
<=
EBDetId::MAX_IETA
; ++
iEta
) {
64
if
(
iEta
== 0)
65
continue
;
66
67
double
eta
=
EBDetId::approxEta
(
EBDetId
(
iEta
, 1));
68
eta
=
std::abs
(
eta
);
69
double
r
=
calcmuTot
(
eta
);
70
71
mu_eta
[
iEta
] =
r
;
72
vpt_eta
[
iEta
] = 1.0;
73
}
74
75
for
(
int
iX =
EEDetId::IX_MIN
; iX <=
EEDetId::IX_MAX
; ++iX) {
76
for
(
int
iY =
EEDetId::IY_MIN
; iY <=
EEDetId::IY_MAX
; ++iY) {
77
if
(
EEDetId::validDetId
(iX, iY, 1)) {
78
EEDetId
eedetidpos(iX, iY, 1);
79
double
eta
= -
log
(
tan
(0.5 * atan(
sqrt
((iX - 50.0) * (iX - 50.0) + (iY - 50.0) * (iY - 50.0)) * 2.98 / 328.)));
80
eta
=
std::abs
(
eta
);
81
double
r
=
calcmuTot
(
eta
);
82
double
v
=
calcampDropPhotoDetector
(
eta
);
83
84
mu_eta
[
EBDetId::MAX_IETA
+ iX + iY * (
EEDetId::IX_MAX
)] =
r
;
85
vpt_eta
[
EBDetId::MAX_IETA
+ iX + iY * (
EEDetId::IX_MAX
)] =
v
;
86
//std::cout<<"eta/mu/vpt"<<eta<<"/"<<r<<"/"<<v<<std::endl;
87
}
88
}
89
}
90
}
91
92
double
EnergyResolutionVsLumi::calcLightCollectionEfficiencyWeighted
(
DetId
id
,
double
z
) {
93
double
v
= 1.0;
94
double
muTot = 0;
95
if
(
id
.subdetId() ==
EcalBarrel
) {
96
EBDetId
ebId(
id
);
97
int
ieta
=
std::abs
(ebId.
ieta
());
98
muTot =
mu_eta
[
ieta
];
99
100
}
else
if
(
id
.subdetId() ==
EcalEndcap
) {
101
EEDetId
eeId(
id
);
102
int
ix = eeId.
ix
();
103
int
iy = eeId.
iy
();
104
105
muTot =
mu_eta
[
EBDetId::MAX_IETA
+ ix + iy * (
EEDetId::IX_MAX
)];
106
v
=
vpt_eta
[
EBDetId::MAX_IETA
+ ix + iy * (
EEDetId::IX_MAX
)];
107
}
else
{
108
muTot = 0;
109
}
110
double
zcor =
z
;
111
EvolutionECAL
model
;
112
if
(
z
< 0.02) {
113
zcor = 0.02;
114
}
else
if
(
z
> 0.98) {
115
zcor = 0.98;
116
}
117
118
double
result
=
model
.LightCollectionEfficiencyWeighted(zcor, muTot) *
v
;
119
120
return
result
;
121
}
122
123
double
EnergyResolutionVsLumi::calcLightCollectionEfficiencyWeighted2
(
double
eta
,
double
z
,
double
mu_ind) {
124
if
(mu_ind < 0)
125
mu_ind = this->
calcmuTot
(eta);
126
double
v
= this->
calcampDropPhotoDetector
(eta);
127
EvolutionECAL
model
;
128
double
result
=
model
.LightCollectionEfficiencyWeighted(
z
, mu_ind) *
v
;
129
return
result
;
130
}
131
132
double
EnergyResolutionVsLumi::calcmuTot
(
double
eta
) {
133
double
totLumi =
m_lumi
;
134
double
instLumi
=
m_instlumi
;
135
EvolutionECAL
model
;
136
double
muEM =
model
.InducedAbsorptionEM(
instLumi
,
eta
);
137
double
muH =
model
.InducedAbsorptionHadronic(totLumi,
eta
);
138
double
result
= muEM + muH;
139
return
result
;
140
}
141
142
double
EnergyResolutionVsLumi::calcampDropTransparency
(
double
eta
) {
143
double
muEM = this->
calcmuEM
(eta);
144
double
muHD = this->
calcmuHD
(eta);
145
EvolutionECAL
model
;
146
double
result
=
model
.DegradationMeanEM50GeV(muEM + muHD);
147
return
result
;
148
}
149
150
double
EnergyResolutionVsLumi::calcampDropPhotoDetector
(
double
eta
) {
151
double
instLumi
=
m_instlumi
;
152
double
totLumi =
m_lumi
;
153
EvolutionECAL
model
;
154
double
result
=
model
.AgingVPT(
instLumi
, totLumi,
eta
);
155
return
result
;
156
}
157
158
double
EnergyResolutionVsLumi::calcampDropTotal
(
double
eta
) {
159
double
tra = this->
calcampDropTransparency
(eta);
160
double
pho = this->
calcampDropPhotoDetector
(eta);
161
double
result
= tra * pho;
162
return
result
;
163
}
164
165
double
EnergyResolutionVsLumi::calcnoiseIncreaseADC
(
double
eta
) {
166
double
totLumi =
m_lumi
;
167
EvolutionECAL
model
;
168
double
result
=
model
.NoiseFactorFE(totLumi,
eta
);
169
return
result
;
170
// noise increase in ADC
171
}
172
173
double
EnergyResolutionVsLumi::calcnoiseADC
(
double
eta
) {
174
double
totLumi =
m_lumi
;
175
double
Nadc = 1.1;
176
double
result
= 1.0;
177
EvolutionECAL
model
;
178
if
(
std::abs
(
eta
) < 1.497) {
179
Nadc = 1.1;
180
result
=
model
.NoiseFactorFE(totLumi,
eta
) * Nadc;
181
}
else
{
182
Nadc = 2.0;
183
result
= Nadc;
184
// endcaps no increase in ADC
185
}
186
return
result
;
187
}
188
189
double
EnergyResolutionVsLumi::calcresolutitonConstantTerm
(
double
eta
) {
190
double
muEM = this->
calcmuEM
(eta);
191
double
muHD = this->
calcmuHD
(eta);
192
EvolutionECAL
model
;
193
double
result
=
model
.ResolutionConstantTermEM50GeV(muEM + muHD);
194
return
result
;
195
}
196
197
double
EnergyResolutionVsLumi::Resolution
(
double
eta
,
double
ene) {
198
// Initial parameters for ECAL resolution
199
double
S
;
200
double
Nadc;
201
double
adc2GeV;
202
double
C
;
203
if
(
eta
< 1.497) {
204
S
= 0.028;
// CMS note 2006/148 (EB test beam)
205
Nadc = 1.1;
206
adc2GeV = 0.039;
207
C
= 0.003;
208
}
else
{
209
S
= 0.052;
// CMS DN 2009/002
210
Nadc = 2.0;
211
adc2GeV = 0.069;
212
C
= 0.004;
213
}
214
215
DegradationAtEta
d
=
CalculateDegradation
(
eta
);
216
217
// adjust resolution parameters
218
S
/=
sqrt
(
d
.ampDropTotal);
219
Nadc *=
d
.noiseIncreaseADC;
220
adc2GeV /=
d
.ampDropTotal;
221
double
N
= Nadc * adc2GeV * 3.0;
// 3x3 noise in GeV
222
C
=
sqrt
(
C
*
C
+
d
.resolutitonConstantTerm *
d
.resolutitonConstantTerm);
223
224
return
sqrt
(
S
*
S
/ ene +
N
*
N
/ ene / ene +
C
*
C
);
225
}
226
/*
227
void EnergyResolutionVsLumi::Decomposition()
228
{
229
double eta = 2.2;
230
m_instlumi = 5.0e+34;
231
m_lumi = 3000.0;
232
233
DegradationAtEta d = this->CalculateDegradation(eta);
234
235
// Initial parameters for ECAL resolution
236
double S;
237
double Nadc;
238
double adc2GeV;
239
double C;
240
if(eta<1.497){
241
S = 0.028; // CMS note 2006/148 (EB test beam)
242
Nadc = 1.1;
243
adc2GeV = 0.039;
244
C = 0.003;
245
}else{
246
S = 0.052; // CMS DN 2009/002
247
Nadc = 2.0;
248
adc2GeV = 0.069;
249
C = 0.0038;
250
}
251
252
// adjust resolution parameters
253
S /= sqrt(d.ampDropTotal);
254
Nadc *= d.noiseIncreaseADC;
255
adc2GeV /= d.ampDropTotal;
256
// double N = Nadc*adc2GeV*3.0; // 3x3 noise in GeV
257
C = sqrt(C*C + d.resolutitonConstantTerm*d.resolutitonConstantTerm);
258
259
for(double ene=1.0; ene<1e+3; ene*=1.1){
260
// this is the resolution
261
double res = sqrt(S*S/ene + N*N/ene/ene + C*C);
262
double factor = 1.0;
263
factor = sin(2.0*atan(exp(-1.0*eta)));
264
}
265
}
266
*/
EnergyResolutionVsLumi::calcampDropTransparency
double calcampDropTransparency(double eta)
Definition:
EnergyResolutionVsLumi.cc:142
EnergyResolutionVsLumi::m_instlumi
double m_instlumi
Definition:
EnergyResolutionVsLumi.h:67
EBDetId::ieta
int ieta() const
get the crystal ieta
Definition:
EBDetId.h:49
EnergyResolutionVsLumi::calcLightCollectionEfficiencyWeighted2
double calcLightCollectionEfficiencyWeighted2(double eta, double z, double mu_ind=-1.0)
Definition:
EnergyResolutionVsLumi.cc:123
EBDetId::approxEta
float approxEta() const
Definition:
EBDetId.h:102
detailsBasic3DVector::z
float float float z
Definition:
extBasic3DVector.h:14
EnergyResolutionVsLumi::calcmuTot
void calcmuTot()
Definition:
EnergyResolutionVsLumi.cc:62
EvolutionECAL.h
EBDetId
Definition:
EBDetId.h:17
EnergyResolutionVsLumi::CalculateDegradation
DegradationAtEta CalculateDegradation(double eta)
Definition:
EnergyResolutionVsLumi.cc:16
EnergyResolutionVsLumi::EnergyResolutionVsLumi
EnergyResolutionVsLumi()
Definition:
EnergyResolutionVsLumi.cc:9
EnergyResolutionVsLumi::m_lumi
double m_lumi
Definition:
EnergyResolutionVsLumi.h:66
EBDetId.h
EEDetId.h
EnergyResolutionVsLumi::calcLightCollectionEfficiencyWeighted
double calcLightCollectionEfficiencyWeighted(DetId id, double z)
Definition:
EnergyResolutionVsLumi.cc:92
EEDetId::IX_MIN
static const int IX_MIN
Definition:
EEDetId.h:290
EnergyResolutionVsLumi.h
EEDetId::IY_MIN
static const int IY_MIN
Definition:
EEDetId.h:294
EnergyResolutionVsLumi::calcmuHD
double calcmuHD(double eta)
Definition:
EnergyResolutionVsLumi.cc:55
findQualityFiles.v
v
Definition:
findQualityFiles.py:179
EEDetId::ix
int ix() const
Definition:
EEDetId.h:77
EcalBarrel
Definition:
EcalSubdetector.h:10
ReggeGribovPartonMC_EposLHC_2760GeV_PbPb_cfi.model
model
Definition:
ReggeGribovPartonMC_EposLHC_2760GeV_PbPb_cfi.py:11
DetId
Definition:
DetId.h:17
EnergyResolutionVsLumi::calcampDropTotal
double calcampDropTotal(double eta)
Definition:
EnergyResolutionVsLumi.cc:158
PVValHelper::eta
Definition:
PVValidationHelpers.h:70
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:19
DDAxes::z
N
#define N
Definition:
blowfish.cc:9
EnergyResolutionVsLumi::vpt_eta
double vpt_eta[10085]
Definition:
EnergyResolutionVsLumi.h:69
EEDetId::IY_MAX
static const int IY_MAX
Definition:
EEDetId.h:302
EnergyResolutionVsLumi::Resolution
double Resolution(double eta, double ene)
Definition:
EnergyResolutionVsLumi.cc:197
EEDetId
Definition:
EEDetId.h:14
EnergyResolutionVsLumi::mu_eta
double mu_eta[10085]
Definition:
EnergyResolutionVsLumi.h:68
EnergyResolutionVsLumi::calcnoiseADC
double calcnoiseADC(double eta)
Definition:
EnergyResolutionVsLumi.cc:173
EnergyResolutionVsLumi::calcmuEM
double calcmuEM(double eta)
Definition:
EnergyResolutionVsLumi.cc:48
EcalSubdetector.h
EcalEndcap
Definition:
EcalSubdetector.h:10
S
double S(const TLorentzVector &, const TLorentzVector &)
Definition:
Particle.cc:97
LEDCalibrationChannels.ieta
ieta
Definition:
LEDCalibrationChannels.py:63
EEDetId::IX_MAX
static const int IX_MAX
Definition:
EEDetId.h:298
funct::tan
Tan< T >::type tan(const T &t)
Definition:
Tan.h:22
EnergyResolutionVsLumi::~EnergyResolutionVsLumi
virtual ~EnergyResolutionVsLumi()
Definition:
EnergyResolutionVsLumi.cc:14
muonGEMDigis_cfi.instLumi
instLumi
Definition:
muonGEMDigis_cfi.py:10
EEDetId::iy
int iy() const
Definition:
EEDetId.h:83
alignCSCRings.r
r
Definition:
alignCSCRings.py:93
EvolutionECAL
Definition:
EvolutionECAL.h:23
EnergyResolutionVsLumi::calcampDropPhotoDetector
double calcampDropPhotoDetector(double eta)
Definition:
EnergyResolutionVsLumi.cc:150
gen::C
C
Definition:
PomwigHadronizer.cc:78
EnergyResolutionVsLumi::calcresolutitonConstantTerm
double calcresolutitonConstantTerm(double eta)
Definition:
EnergyResolutionVsLumi.cc:189
dqm-mbProfile.log
log
Definition:
dqm-mbProfile.py:17
S
Definition:
CSCDBL1TPParametersExtended.h:16
EEDetId::validDetId
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition:
EEDetId.h:248
L1TowerCalibrationProducer_cfi.iEta
iEta
Definition:
L1TowerCalibrationProducer_cfi.py:60
ztail.d
d
Definition:
ztail.py:151
EnergyResolutionVsLumi::DegradationAtEta
Definition:
EnergyResolutionVsLumi.h:30
mps_fire.result
result
Definition:
mps_fire.py:311
funct::abs
Abs< T >::type abs(const T &t)
Definition:
Abs.h:22
EBDetId::MAX_IETA
static const int MAX_IETA
Definition:
EBDetId.h:136
EnergyResolutionVsLumi::calcnoiseIncreaseADC
double calcnoiseIncreaseADC(double eta)
Definition:
EnergyResolutionVsLumi.cc:165
Generated for CMSSW Reference Manual by
1.8.16