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