CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Attributes
EnergyResolutionVsLumi Class Reference

#include <EnergyResolutionVsLumi.h>

Classes

struct  DegradationAtEta
 

Public Member Functions

double calcampDropPhotoDetector (double eta)
 
double calcampDropTotal (double eta)
 
double calcampDropTransparency (double eta)
 
double calcLightCollectionEfficiencyWeighted (DetId id, double z)
 
double calcLightCollectionEfficiencyWeighted2 (double eta, double z, double mu_ind=-1.0)
 
double calcmuEM (double eta)
 
double calcmuHD (double eta)
 
double calcmuTot (double eta)
 
void calcmuTot ()
 
double calcnoiseADC (double eta)
 
double calcnoiseIncreaseADC (double eta)
 
double calcresolutitonConstantTerm (double eta)
 
DegradationAtEta CalculateDegradation (double eta)
 
void Decomposition ()
 
 EnergyResolutionVsLumi ()
 
 EnergyResolutionVsLumi (double lumi, double instlumi)
 
double getmuTot (double eta, int ix, int iy)
 
double Resolution (double eta, double ene)
 
void setInstLumi (double x)
 
void setLumi (double x)
 
void setLumies (double x, double y)
 
virtual ~EnergyResolutionVsLumi ()
 

Private Attributes

double m_instlumi
 
double m_lumi
 
double mu_eta [10085]
 
double vpt_eta [10085]
 

Detailed Description

Definition at line 18 of file EnergyResolutionVsLumi.h.

Constructor & Destructor Documentation

EnergyResolutionVsLumi::EnergyResolutionVsLumi ( )

Definition at line 10 of file EnergyResolutionVsLumi.cc.

References m_instlumi, and m_lumi.

11 {
12  m_lumi=0;
13  m_instlumi=0;
14 
15 }
EnergyResolutionVsLumi::EnergyResolutionVsLumi ( double  lumi,
double  instlumi 
)
inline

Definition at line 24 of file EnergyResolutionVsLumi.h.

References calcmuTot(), fjr2json::lumi, m_instlumi, and m_lumi.

24  {
25  m_lumi=lumi;
26  m_instlumi=instlumi;
27  calcmuTot();
28  };
tuple lumi
Definition: fjr2json.py:35
EnergyResolutionVsLumi::~EnergyResolutionVsLumi ( )
virtual

Definition at line 17 of file EnergyResolutionVsLumi.cc.

18 {
19 }

Member Function Documentation

double EnergyResolutionVsLumi::calcampDropPhotoDetector ( double  eta)

Definition at line 172 of file EnergyResolutionVsLumi.cc.

References EvolutionECAL::AgingVPT(), m_instlumi, m_lumi, and query::result.

Referenced by calcampDropTotal(), calcLightCollectionEfficiencyWeighted2(), and calcmuTot().

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 }
T eta() const
tuple result
Definition: query.py:137
double AgingVPT(double instLumi, double integralLumi, double eta)
double EnergyResolutionVsLumi::calcampDropTotal ( double  eta)

Definition at line 181 of file EnergyResolutionVsLumi.cc.

References calcampDropPhotoDetector(), calcampDropTransparency(), and query::result.

Referenced by EcalTrivialConditionRetriever::produceEcalLaserAPDPNRatios().

182 {
183  double tra= this->calcampDropTransparency(eta);
184  double pho= this->calcampDropPhotoDetector(eta);
185  double result = tra*pho;
186  return result;
187 }
double calcampDropPhotoDetector(double eta)
T eta() const
tuple result
Definition: query.py:137
double calcampDropTransparency(double eta)
double EnergyResolutionVsLumi::calcampDropTransparency ( double  eta)

Definition at line 163 of file EnergyResolutionVsLumi.cc.

References calcmuEM(), calcmuHD(), EvolutionECAL::DegradationMeanEM50GeV(), and query::result.

Referenced by calcampDropTotal().

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 }
T eta() const
double DegradationMeanEM50GeV(double mu)
tuple result
Definition: query.py:137
double EnergyResolutionVsLumi::calcLightCollectionEfficiencyWeighted ( DetId  id,
double  z 
)

Definition at line 107 of file EnergyResolutionVsLumi.cc.

References EcalBarrel, EcalEndcap, EBDetId::ieta(), EEDetId::ix(), EEDetId::IX_MAX, EEDetId::iy(), EvolutionECAL::LightCollectionEfficiencyWeighted(), EBDetId::MAX_IETA, mu_eta, query::result, findQualityFiles::v, vpt_eta, and detailsBasic3DVector::z.

Referenced by ECalSD::curve_LY().

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 }
double LightCollectionEfficiencyWeighted(double z, double mu_ind)
float float float z
tuple result
Definition: query.py:137
static const int IX_MAX
Definition: EEDetId.h:302
static const int MAX_IETA
Definition: EBDetId.h:143
double EnergyResolutionVsLumi::calcLightCollectionEfficiencyWeighted2 ( double  eta,
double  z,
double  mu_ind = -1.0 
)

Definition at line 142 of file EnergyResolutionVsLumi.cc.

References calcampDropPhotoDetector(), calcmuTot(), EvolutionECAL::LightCollectionEfficiencyWeighted(), query::result, and findQualityFiles::v.

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 }
double LightCollectionEfficiencyWeighted(double z, double mu_ind)
double calcampDropPhotoDetector(double eta)
T eta() const
float float float z
tuple result
Definition: query.py:137
double EnergyResolutionVsLumi::calcmuEM ( double  eta)

Definition at line 56 of file EnergyResolutionVsLumi.cc.

References EvolutionECAL::InducedAbsorptionEM(), m_instlumi, and query::result.

Referenced by calcampDropTransparency(), and calcresolutitonConstantTerm().

57 {
58  double instLumi = m_instlumi;
59  EvolutionECAL model;
60  double result = model.InducedAbsorptionEM(instLumi, eta);
61  return result;
62 }
T eta() const
tuple result
Definition: query.py:137
double InducedAbsorptionEM(double lumi, double eta)
double EnergyResolutionVsLumi::calcmuHD ( double  eta)

Definition at line 64 of file EnergyResolutionVsLumi.cc.

References EvolutionECAL::InducedAbsorptionHadronic(), m_lumi, and query::result.

Referenced by calcampDropTransparency(), and calcresolutitonConstantTerm().

65 {
66  double totLumi = m_lumi;
67  EvolutionECAL model;
68  double result = model.InducedAbsorptionHadronic(totLumi, eta);
69  return result;
70 }
T eta() const
tuple result
Definition: query.py:137
double InducedAbsorptionHadronic(double lumi, double eta)
double EnergyResolutionVsLumi::calcmuTot ( double  eta)

Definition at line 152 of file EnergyResolutionVsLumi.cc.

References EvolutionECAL::InducedAbsorptionEM(), EvolutionECAL::InducedAbsorptionHadronic(), m_instlumi, m_lumi, and query::result.

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 }
T eta() const
tuple result
Definition: query.py:137
double InducedAbsorptionHadronic(double lumi, double eta)
double InducedAbsorptionEM(double lumi, double eta)
void EnergyResolutionVsLumi::calcmuTot ( )

Definition at line 73 of file EnergyResolutionVsLumi.cc.

References EBDetId::approxEta(), calcampDropPhotoDetector(), eta(), EEDetId::IX_MAX, EEDetId::IX_MIN, EEDetId::IY_MAX, EEDetId::IY_MIN, log, EBDetId::MAX_IETA, mu_eta, alignCSCRings::r, mathSSE::sqrt(), funct::tan(), findQualityFiles::v, EEDetId::validDetId(), and vpt_eta.

Referenced by calcLightCollectionEfficiencyWeighted2(), EnergyResolutionVsLumi(), and setLumies().

73  {
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 }
float approxEta() const
Definition: EBDetId.h:106
static std::vector< std::string > checklist log
double calcampDropPhotoDetector(double eta)
T eta() const
static const int IX_MIN
Definition: EEDetId.h:294
static const int IY_MIN
Definition: EEDetId.h:298
T sqrt(T t)
Definition: SSEVec.h:48
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
static const int IX_MAX
Definition: EEDetId.h:302
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
static const int MAX_IETA
Definition: EBDetId.h:143
static const int IY_MAX
Definition: EEDetId.h:306
double EnergyResolutionVsLumi::calcnoiseADC ( double  eta)

Definition at line 198 of file EnergyResolutionVsLumi.cc.

References m_lumi, EvolutionECAL::NoiseFactorFE(), and query::result.

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 }
double NoiseFactorFE(double lumi, double eta)
T eta() const
tuple result
Definition: query.py:137
double EnergyResolutionVsLumi::calcnoiseIncreaseADC ( double  eta)

Definition at line 189 of file EnergyResolutionVsLumi.cc.

References m_lumi, EvolutionECAL::NoiseFactorFE(), and query::result.

Referenced by EcalTrivialConditionRetriever::produceEcalPedestals().

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 }
double NoiseFactorFE(double lumi, double eta)
T eta() const
tuple result
Definition: query.py:137
double EnergyResolutionVsLumi::calcresolutitonConstantTerm ( double  eta)

Definition at line 216 of file EnergyResolutionVsLumi.cc.

References calcmuEM(), calcmuHD(), EvolutionECAL::ResolutionConstantTermEM50GeV(), and query::result.

Referenced by EcalTrivialConditionRetriever::getIntercalibConstantsFromConfiguration().

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 }
T eta() const
double ResolutionConstantTermEM50GeV(double mu)
tuple result
Definition: query.py:137
EnergyResolutionVsLumi::DegradationAtEta EnergyResolutionVsLumi::CalculateDegradation ( double  eta)

Definition at line 22 of file EnergyResolutionVsLumi.cc.

References EvolutionECAL::AgingVPT(), EnergyResolutionVsLumi::DegradationAtEta::ampDropPhotoDetector, EnergyResolutionVsLumi::DegradationAtEta::ampDropTotal, EnergyResolutionVsLumi::DegradationAtEta::ampDropTransparency, EvolutionECAL::DegradationMeanEM50GeV(), EnergyResolutionVsLumi::DegradationAtEta::eta, eta(), EvolutionECAL::InducedAbsorptionEM(), EvolutionECAL::InducedAbsorptionHadronic(), m_instlumi, m_lumi, EnergyResolutionVsLumi::DegradationAtEta::muEM, EnergyResolutionVsLumi::DegradationAtEta::muHD, EvolutionECAL::NoiseFactorFE(), EnergyResolutionVsLumi::DegradationAtEta::noiseIncreaseADC, EvolutionECAL::ResolutionConstantTermEM50GeV(), EnergyResolutionVsLumi::DegradationAtEta::resolutitonConstantTerm, and query::result.

Referenced by Decomposition(), and Resolution().

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 }
double NoiseFactorFE(double lumi, double eta)
T eta() const
double ResolutionConstantTermEM50GeV(double mu)
double DegradationMeanEM50GeV(double mu)
tuple result
Definition: query.py:137
double InducedAbsorptionHadronic(double lumi, double eta)
double InducedAbsorptionEM(double lumi, double eta)
double AgingVPT(double instLumi, double integralLumi, double eta)
void EnergyResolutionVsLumi::Decomposition ( )

Definition at line 267 of file EnergyResolutionVsLumi.cc.

References EnergyResolutionVsLumi::DegradationAtEta::ampDropTotal, funct::C, CalculateDegradation(), eta(), m_instlumi, m_lumi, EnergyResolutionVsLumi::DegradationAtEta::noiseIncreaseADC, EnergyResolutionVsLumi::DegradationAtEta::resolutitonConstantTerm, S(), and mathSSE::sqrt().

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 }
T eta() const
T sqrt(T t)
Definition: SSEVec.h:48
DegradationAtEta CalculateDegradation(double eta)
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:99
double EnergyResolutionVsLumi::getmuTot ( double  eta,
int  ix,
int  iy 
)
double EnergyResolutionVsLumi::Resolution ( double  eta,
double  ene 
)

Definition at line 226 of file EnergyResolutionVsLumi.cc.

References EnergyResolutionVsLumi::DegradationAtEta::ampDropTotal, funct::C, CalculateDegradation(), N, EnergyResolutionVsLumi::DegradationAtEta::noiseIncreaseADC, EnergyResolutionVsLumi::DegradationAtEta::resolutitonConstantTerm, S(), and mathSSE::sqrt().

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 }
T eta() const
T sqrt(T t)
Definition: SSEVec.h:48
#define N
Definition: blowfish.cc:9
DegradationAtEta CalculateDegradation(double eta)
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:99
void EnergyResolutionVsLumi::setInstLumi ( double  x)
inline
void EnergyResolutionVsLumi::setLumi ( double  x)
inline
void EnergyResolutionVsLumi::setLumies ( double  x,
double  y 
)
inline

Member Data Documentation

double EnergyResolutionVsLumi::m_instlumi
private
double EnergyResolutionVsLumi::m_lumi
private
double EnergyResolutionVsLumi::mu_eta[10085]
private

Definition at line 76 of file EnergyResolutionVsLumi.h.

Referenced by calcLightCollectionEfficiencyWeighted(), and calcmuTot().

double EnergyResolutionVsLumi::vpt_eta[10085]
private

Definition at line 77 of file EnergyResolutionVsLumi.h.

Referenced by calcLightCollectionEfficiencyWeighted(), and calcmuTot().