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