Main Page
Namespaces
Classes
Package Documentation
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
*/
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:197
EBDetId
Definition:
EBDetId.h:17
EEDetId::ix
int ix() const
Definition:
EEDetId.h:77
mps_fire.result
result
Definition:
mps_fire.py:283
EnergyResolutionVsLumi::~EnergyResolutionVsLumi
virtual ~EnergyResolutionVsLumi()
Definition:
EnergyResolutionVsLumi.cc:14
EvolutionECAL::LightCollectionEfficiencyWeighted
double LightCollectionEfficiencyWeighted(double z, double mu_ind)
Definition:
EvolutionECAL.cc:120
EnergyResolutionVsLumi::DegradationAtEta::muEM
double muEM
Definition:
EnergyResolutionVsLumi.h:32
EvolutionECAL::NoiseFactorFE
double NoiseFactorFE(double lumi, double eta)
Definition:
EvolutionECAL.cc:369
EnergyResolutionVsLumi::calcampDropPhotoDetector
double calcampDropPhotoDetector(double eta)
Definition:
EnergyResolutionVsLumi.cc:150
PVValHelper::eta
Definition:
PVValidationHelpers.h:65
findQualityFiles.v
v
Definition:
findQualityFiles.py:179
EnergyResolutionVsLumi::calcresolutitonConstantTerm
double calcresolutitonConstantTerm(double eta)
Definition:
EnergyResolutionVsLumi.cc:189
EvolutionECAL::ResolutionConstantTermEM50GeV
double ResolutionConstantTermEM50GeV(double mu)
Definition:
EvolutionECAL.cc:319
EEDetId::IX_MIN
static const int IX_MIN
Definition:
EEDetId.h:290
EEDetId::IY_MIN
static const int IY_MIN
Definition:
EEDetId.h:294
EnergyResolutionVsLumi::DegradationAtEta
Definition:
EnergyResolutionVsLumi.h:30
EvolutionECAL::DegradationMeanEM50GeV
double DegradationMeanEM50GeV(double mu)
Definition:
EvolutionECAL.cc:253
muonGEMDigis_cfi.instLumi
instLumi
Definition:
muonGEMDigis_cfi.py:22
EEDetId
Definition:
EEDetId.h:14
EnergyResolutionVsLumi::calcnoiseIncreaseADC
double calcnoiseIncreaseADC(double eta)
Definition:
EnergyResolutionVsLumi.cc:165
patCaloMETCorrections_cff.C
C
Definition:
patCaloMETCorrections_cff.py:45
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:18
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:199
EEDetId::iy
int iy() const
Definition:
EEDetId.h:83
EnergyResolutionVsLumi::calcampDropTransparency
double calcampDropTransparency(double eta)
Definition:
EnergyResolutionVsLumi.cc:142
EBDetId::ieta
int ieta() const
get the crystal ieta
Definition:
EBDetId.h:49
EnergyResolutionVsLumi::calcmuTot
void calcmuTot()
Definition:
EnergyResolutionVsLumi.cc:62
EnergyResolutionVsLumi.h
edmIntegrityCheck.d
d
Definition:
edmIntegrityCheck.py:66
EnergyResolutionVsLumi::calcLightCollectionEfficiencyWeighted2
double calcLightCollectionEfficiencyWeighted2(double eta, double z, double mu_ind=-1.0)
Definition:
EnergyResolutionVsLumi.cc:123
EEDetId::IX_MAX
static const int IX_MAX
Definition:
EEDetId.h:298
EvolutionECAL::InducedAbsorptionEM
double InducedAbsorptionEM(double lumi, double eta)
Definition:
EvolutionECAL.cc:233
alignCSCRings.r
r
Definition:
alignCSCRings.py:93
DetId
Definition:
DetId.h:18
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:16
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:55
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:92
S
double S(const TLorentzVector &, const TLorentzVector &)
Definition:
Particle.cc:99
cmsBatch.log
log
Definition:
cmsBatch.py:343
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
EcalBarrel
Definition:
EcalSubdetector.h:10
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:158
EnergyResolutionVsLumi::DegradationAtEta::noiseIncreaseADC
double noiseIncreaseADC
Definition:
EnergyResolutionVsLumi.h:37
EnergyResolutionVsLumi::calcnoiseADC
double calcnoiseADC(double eta)
Definition:
EnergyResolutionVsLumi.cc:173
EnergyResolutionVsLumi::calcmuEM
double calcmuEM(double eta)
Definition:
EnergyResolutionVsLumi.cc:48
EnergyResolutionVsLumi::DegradationAtEta::ampDropPhotoDetector
double ampDropPhotoDetector
Definition:
EnergyResolutionVsLumi.h:35
EvolutionECAL::AgingVPT
double AgingVPT(double instLumi, double integralLumi, double eta)
Definition:
EvolutionECAL.cc:360
Generated for CMSSW Reference Manual by
1.8.11