CMS 3D CMS Logo

EnergyResolutionVsLumi.cc
Go to the documentation of this file.
1 #include <string>
2 #include <vector>
8 
10 {
11  m_lumi=0;
12  m_instlumi=0;
13 }
14 
16 {
17 }
18 
20 {
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 
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 
53 {
54  double instLumi = m_instlumi;
55  EvolutionECAL model;
56  double result = model.InducedAbsorptionEM(instLumi, eta);
57  return result;
58 }
59 
61 {
62  double totLumi = m_lumi;
63  EvolutionECAL model;
64  double result = model.InducedAbsorptionHadronic(totLumi, eta);
65  return result;
66 }
67 
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 
94  //std::cout<<"eta/mu/vpt"<<eta<<"/"<<r<<"/"<<v<<std::endl;
95  }
96  }
97  }
98 }
99 
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)];
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 
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 
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 
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 
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 
169 {
170  double tra= this->calcampDropTransparency(eta);
171  double pho= this->calcampDropPhotoDetector(eta);
172  double result = tra*pho;
173  return result;
174 }
175 
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 
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 
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 
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
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 
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
static const int IY_MIN
Definition: EEDetId.h:298
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: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)