CMS 3D CMS Logo

EnergyResolutionVsLumi.cc
Go to the documentation of this file.
1 #include <string>
2 #include <vector>
8 
10  m_lumi = 0;
11  m_instlumi = 0;
12 }
13 
15 
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 
49  double instLumi = m_instlumi;
50  EvolutionECAL model;
51  double result = model.InducedAbsorptionEM(instLumi, eta);
52  return result;
53 }
54 
56  double totLumi = m_lumi;
57  EvolutionECAL model;
58  double result = model.InducedAbsorptionHadronic(totLumi, eta);
59  return result;
60 }
61 
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 
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 
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 
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 
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 
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 
159  double tra = this->calcampDropTransparency(eta);
160  double pho = this->calcampDropPhotoDetector(eta);
161  double result = tra * pho;
162  return result;
163 }
164 
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 
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 
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 
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
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 */
float approxEta() const
Definition: EBDetId.h:102
double Resolution(double eta, double ene)
int ix() const
Definition: EEDetId.h:77
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:290
static const int IY_MIN
Definition: EEDetId.h:294
double DegradationMeanEM50GeV(double mu)
double calcnoiseIncreaseADC(double eta)
T sqrt(T t)
Definition: SSEVec.h:18
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double InducedAbsorptionHadronic(double lumi, double eta)
int iy() const
Definition: EEDetId.h:83
double calcampDropTransparency(double eta)
int ieta() const
get the crystal ieta
Definition: EBDetId.h:49
double calcLightCollectionEfficiencyWeighted2(double eta, double z, double mu_ind=-1.0)
static const int IX_MAX
Definition: EEDetId.h:298
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:136
double calcLightCollectionEfficiencyWeighted(DetId id, double z)
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:99
static const int IY_MAX
Definition: EEDetId.h:302
double calcampDropTotal(double eta)
double AgingVPT(double instLumi, double integralLumi, double eta)