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