test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EnergyResolutionVsLumi.cc
Go to the documentation of this file.
1 #include <string>
2 #include <vector>
8 
9 
11 {
12  m_lumi=0;
13  m_instlumi=0;
14 
15 }
16 
18 {
19 }
20 
21 
23 {
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 
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 
57 {
58  double instLumi = m_instlumi;
59  EvolutionECAL model;
60  double result = model.InducedAbsorptionEM(instLumi, eta);
61  return result;
62 }
63 
65 {
66  double totLumi = m_lumi;
67  EvolutionECAL model;
68  double result = model.InducedAbsorptionHadronic(totLumi, eta);
69  return result;
70 }
71 
72 
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 
99  //std::cout<<"eta/mu/vpt"<<eta<<"/"<<r<<"/"<<v<<std::endl;
100  }
101  }
102  }
103 
104 }
105 
106 
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)];
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 
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 
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 
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 
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 
182 {
183  double tra= this->calcampDropTransparency(eta);
184  double pho= this->calcampDropPhotoDetector(eta);
185  double result = tra*pho;
186  return result;
187 }
188 
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 
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 
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 
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
256 
257  return sqrt(S*S/ene + N*N/ene/ene + C*C);
258 
259 }
260 
261 
262 
263 
264 
265 
266 
268 {
269 
270  double eta = 2.2;
271  m_instlumi = 5.0e+34;
272  m_lumi = 3000.0;
273 
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
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 
float approxEta() const
Definition: EBDetId.h:106
double Resolution(double eta, double ene)
int ix() const
Definition: EEDetId.h:76
double LightCollectionEfficiencyWeighted(double z, double mu_ind)
double NoiseFactorFE(double lumi, double eta)
double calcampDropPhotoDetector(double eta)
double calcresolutitonConstantTerm(double eta)
double ResolutionConstantTermEM50GeV(double mu)
static const int IX_MIN
Definition: EEDetId.h:294
float float float z
static const int IY_MIN
Definition: EEDetId.h:298
tuple result
Definition: mps_fire.py:84
double DegradationMeanEM50GeV(double mu)
tuple d
Definition: ztail.py:151
double calcnoiseIncreaseADC(double eta)
T sqrt(T t)
Definition: SSEVec.h:18
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
double InducedAbsorptionHadronic(double lumi, double eta)
int iy() const
Definition: EEDetId.h:82
double calcampDropTransparency(double eta)
int ieta() const
get the crystal ieta
Definition: EBDetId.h:51
double calcLightCollectionEfficiencyWeighted2(double eta, double z, double mu_ind=-1.0)
static const int IX_MAX
Definition: EEDetId.h:302
double InducedAbsorptionEM(double lumi, double eta)
Definition: DetId.h:18
#define N
Definition: blowfish.cc:9
DegradationAtEta CalculateDegradation(double eta)
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
static const int MAX_IETA
Definition: EBDetId.h:143
double calcLightCollectionEfficiencyWeighted(DetId id, double z)
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:99
static const int IY_MAX
Definition: EEDetId.h:306
double calcampDropTotal(double eta)
double AgingVPT(double instLumi, double integralLumi, double eta)