CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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)
 
 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)
 
 ~EnergyResolutionVsLumi ()=default
 

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 9 of file EnergyResolutionVsLumi.cc.

References m_instlumi, and m_lumi.

9  {
10  m_lumi = 0;
11  m_instlumi = 0;
12 }
EnergyResolutionVsLumi::EnergyResolutionVsLumi ( double  lumi,
double  instlumi 
)
inline

Definition at line 22 of file EnergyResolutionVsLumi.h.

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

22  {
23  m_lumi = lumi;
24  m_instlumi = instlumi;
25  calcmuTot();
26  };
list lumi
Definition: dqmdumpme.py:53
EnergyResolutionVsLumi::~EnergyResolutionVsLumi ( )
default

Member Function Documentation

double EnergyResolutionVsLumi::calcampDropPhotoDetector ( double  eta)

Definition at line 148 of file EnergyResolutionVsLumi.cc.

References EvolutionECAL::AgingVPT(), m_instlumi, m_lumi, isotrackApplyRegressor::model, and mps_fire::result.

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

148  {
149  double instLumi = m_instlumi;
150  double totLumi = m_lumi;
152  double result = model.AgingVPT(instLumi, totLumi, eta);
153  return result;
154 }
tuple result
Definition: mps_fire.py:311
double AgingVPT(double instLumi, double integralLumi, double eta)
double EnergyResolutionVsLumi::calcampDropTotal ( double  eta)

Definition at line 156 of file EnergyResolutionVsLumi.cc.

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

Referenced by EcalTrivialConditionRetriever::produceEcalLaserAPDPNRatios().

156  {
157  double tra = this->calcampDropTransparency(eta);
158  double pho = this->calcampDropPhotoDetector(eta);
159  double result = tra * pho;
160  return result;
161 }
double calcampDropPhotoDetector(double eta)
tuple result
Definition: mps_fire.py:311
double calcampDropTransparency(double eta)
double EnergyResolutionVsLumi::calcampDropTransparency ( double  eta)

Definition at line 140 of file EnergyResolutionVsLumi.cc.

References calcmuEM(), calcmuHD(), EvolutionECAL::DegradationMeanEM50GeV(), isotrackApplyRegressor::model, and mps_fire::result.

Referenced by calcampDropTotal().

140  {
141  double muEM = this->calcmuEM(eta);
142  double muHD = this->calcmuHD(eta);
144  double result = model.DegradationMeanEM50GeV(muEM + muHD);
145  return result;
146 }
tuple result
Definition: mps_fire.py:311
double DegradationMeanEM50GeV(double mu)
double EnergyResolutionVsLumi::calcLightCollectionEfficiencyWeighted ( DetId  id,
double  z 
)

Definition at line 90 of file EnergyResolutionVsLumi.cc.

References funct::abs(), EcalBarrel, EcalEndcap, EBDetId::ieta(), EEDetId::ix(), EEDetId::IX_MAX, EEDetId::iy(), EvolutionECAL::LightCollectionEfficiencyWeighted(), EBDetId::MAX_IETA, isotrackApplyRegressor::model, mu_eta, mps_fire::result, findQualityFiles::v, vpt_eta, and z.

Referenced by ECalSD::curve_LY().

90  {
91  double v = 1.0;
92  double muTot = 0;
93  if (id.subdetId() == EcalBarrel) {
94  EBDetId ebId(id);
95  int ieta = std::abs(ebId.ieta());
96  muTot = mu_eta[ieta];
97 
98  } else if (id.subdetId() == EcalEndcap) {
99  EEDetId eeId(id);
100  int ix = eeId.ix();
101  int iy = eeId.iy();
102 
103  muTot = mu_eta[EBDetId::MAX_IETA + ix + iy * (EEDetId::IX_MAX)];
104  v = vpt_eta[EBDetId::MAX_IETA + ix + iy * (EEDetId::IX_MAX)];
105  } else {
106  muTot = 0;
107  }
108  double zcor = z;
110  if (z < 0.02) {
111  zcor = 0.02;
112  } else if (z > 0.98) {
113  zcor = 0.98;
114  }
115 
116  double result = model.LightCollectionEfficiencyWeighted(zcor, muTot) * v;
117 
118  return result;
119 }
double LightCollectionEfficiencyWeighted(double z, double mu_ind)
tuple result
Definition: mps_fire.py:311
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int IX_MAX
Definition: EEDetId.h:298
static const int MAX_IETA
Definition: EBDetId.h:136
double EnergyResolutionVsLumi::calcLightCollectionEfficiencyWeighted2 ( double  eta,
double  z,
double  mu_ind = -1.0 
)
double EnergyResolutionVsLumi::calcmuEM ( double  eta)

Definition at line 46 of file EnergyResolutionVsLumi.cc.

References EvolutionECAL::InducedAbsorptionEM(), m_instlumi, isotrackApplyRegressor::model, and mps_fire::result.

Referenced by calcampDropTransparency(), and calcresolutitonConstantTerm().

46  {
47  double instLumi = m_instlumi;
49  double result = model.InducedAbsorptionEM(instLumi, eta);
50  return result;
51 }
tuple result
Definition: mps_fire.py:311
double InducedAbsorptionEM(double lumi, double eta)
double EnergyResolutionVsLumi::calcmuHD ( double  eta)
double EnergyResolutionVsLumi::calcmuTot ( double  eta)

Definition at line 130 of file EnergyResolutionVsLumi.cc.

References EvolutionECAL::InducedAbsorptionEM(), EvolutionECAL::InducedAbsorptionHadronic(), m_instlumi, m_lumi, isotrackApplyRegressor::model, and mps_fire::result.

130  {
131  double totLumi = m_lumi;
132  double instLumi = m_instlumi;
134  double muEM = model.InducedAbsorptionEM(instLumi, eta);
135  double muH = model.InducedAbsorptionHadronic(totLumi, eta);
136  double result = muEM + muH;
137  return result;
138 }
tuple result
Definition: mps_fire.py:311
double InducedAbsorptionHadronic(double lumi, double eta)
double InducedAbsorptionEM(double lumi, double eta)
void EnergyResolutionVsLumi::calcmuTot ( )

Definition at line 60 of file EnergyResolutionVsLumi.cc.

References funct::abs(), EBDetId::approxEta(), calcampDropPhotoDetector(), PVValHelper::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().

60  {
61  for (int iEta = 1; iEta <= EBDetId::MAX_IETA; ++iEta) {
62  if (iEta == 0)
63  continue;
64 
65  double eta = EBDetId::approxEta(EBDetId(iEta, 1));
66  eta = std::abs(eta);
67  double r = calcmuTot(eta);
68 
69  mu_eta[iEta] = r;
70  vpt_eta[iEta] = 1.0;
71  }
72 
73  for (int iX = EEDetId::IX_MIN; iX <= EEDetId::IX_MAX; ++iX) {
74  for (int iY = EEDetId::IY_MIN; iY <= EEDetId::IY_MAX; ++iY) {
75  if (EEDetId::validDetId(iX, iY, 1)) {
76  EEDetId eedetidpos(iX, iY, 1);
77  double eta = -log(tan(0.5 * atan(sqrt((iX - 50.0) * (iX - 50.0) + (iY - 50.0) * (iY - 50.0)) * 2.98 / 328.)));
78  eta = std::abs(eta);
79  double r = calcmuTot(eta);
80  double v = calcampDropPhotoDetector(eta);
81 
82  mu_eta[EBDetId::MAX_IETA + iX + iY * (EEDetId::IX_MAX)] = r;
83  vpt_eta[EBDetId::MAX_IETA + iX + iY * (EEDetId::IX_MAX)] = v;
84  //std::cout<<"eta/mu/vpt"<<eta<<"/"<<r<<"/"<<v<<std::endl;
85  }
86  }
87  }
88 }
float approxEta() const
Definition: EBDetId.h:102
static std::vector< std::string > checklist log
double calcampDropPhotoDetector(double eta)
static const int IX_MIN
Definition: EEDetId.h:290
static const int IY_MIN
Definition: EEDetId.h:294
T sqrt(T t)
Definition: SSEVec.h:19
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int IX_MAX
Definition: EEDetId.h:298
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
static const int MAX_IETA
Definition: EBDetId.h:136
static const int IY_MAX
Definition: EEDetId.h:302
double EnergyResolutionVsLumi::calcnoiseADC ( double  eta)

Definition at line 171 of file EnergyResolutionVsLumi.cc.

References funct::abs(), m_lumi, isotrackApplyRegressor::model, EvolutionECAL::NoiseFactorFE(), and mps_fire::result.

171  {
172  double totLumi = m_lumi;
173  double Nadc = 1.1;
174  double result = 1.0;
176  if (std::abs(eta) < 1.497) {
177  Nadc = 1.1;
178  result = model.NoiseFactorFE(totLumi, eta) * Nadc;
179  } else {
180  Nadc = 2.0;
181  result = Nadc;
182  // endcaps no increase in ADC
183  }
184  return result;
185 }
double NoiseFactorFE(double lumi, double eta)
tuple result
Definition: mps_fire.py:311
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double EnergyResolutionVsLumi::calcnoiseIncreaseADC ( double  eta)

Definition at line 163 of file EnergyResolutionVsLumi.cc.

References m_lumi, isotrackApplyRegressor::model, EvolutionECAL::NoiseFactorFE(), and mps_fire::result.

Referenced by EcalTrivialConditionRetriever::produceEcalPedestals().

163  {
164  double totLumi = m_lumi;
166  double result = model.NoiseFactorFE(totLumi, eta);
167  return result;
168  // noise increase in ADC
169 }
double NoiseFactorFE(double lumi, double eta)
tuple result
Definition: mps_fire.py:311
double EnergyResolutionVsLumi::calcresolutitonConstantTerm ( double  eta)

Definition at line 187 of file EnergyResolutionVsLumi.cc.

References calcmuEM(), calcmuHD(), isotrackApplyRegressor::model, EvolutionECAL::ResolutionConstantTermEM50GeV(), and mps_fire::result.

Referenced by EcalTrivialConditionRetriever::getIntercalibConstantsFromConfiguration().

187  {
188  double muEM = this->calcmuEM(eta);
189  double muHD = this->calcmuHD(eta);
191  double result = model.ResolutionConstantTermEM50GeV(muEM + muHD);
192  return result;
193 }
double ResolutionConstantTermEM50GeV(double mu)
tuple result
Definition: mps_fire.py:311
EnergyResolutionVsLumi::DegradationAtEta EnergyResolutionVsLumi::CalculateDegradation ( double  eta)

Definition at line 14 of file EnergyResolutionVsLumi.cc.

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

Referenced by Resolution().

14  {
15  DegradationAtEta result;
16 
17  result.eta = eta;
18  double totLumi = m_lumi;
19  double instLumi = m_instlumi;
20 
22 
23  // Index of induced absorption due to EM damages in PWO4
24  result.muEM = model.InducedAbsorptionEM(instLumi, eta);
25 
26  // Index of induced absorption due to hadron damages in PWO4
27  result.muHD = model.InducedAbsorptionHadronic(totLumi, eta);
28 
29  // Average degradation of amplitude due to transparency change
30  result.ampDropTransparency = model.DegradationMeanEM50GeV(result.muEM + result.muHD);
31 
32  // Average degradation of amplitude due to photo-detector aging
33  result.ampDropPhotoDetector = model.AgingVPT(instLumi, totLumi, eta);
34 
35  result.ampDropTotal = result.ampDropTransparency * result.ampDropPhotoDetector;
36 
37  // Noise increase in ADC counts due to photo-detector and front-end
38  result.noiseIncreaseADC = model.NoiseFactorFE(totLumi, eta);
39 
40  // Resolution degradation due to LY non-uniformity caused by transparency loss
41  result.resolutitonConstantTerm = model.ResolutionConstantTermEM50GeV(result.muEM + result.muHD);
42 
43  return result;
44 }
double NoiseFactorFE(double lumi, double eta)
double ResolutionConstantTermEM50GeV(double mu)
tuple result
Definition: mps_fire.py:311
double DegradationMeanEM50GeV(double mu)
double InducedAbsorptionHadronic(double lumi, double eta)
double InducedAbsorptionEM(double lumi, double eta)
double AgingVPT(double instLumi, double integralLumi, double eta)
double EnergyResolutionVsLumi::getmuTot ( double  eta,
int  ix,
int  iy 
)
double EnergyResolutionVsLumi::Resolution ( double  eta,
double  ene 
)

Definition at line 195 of file EnergyResolutionVsLumi.cc.

References EnergyResolutionVsLumi::DegradationAtEta::ampDropTotal, gen::C, CalculateDegradation(), ztail::d, N, EnergyResolutionVsLumi::DegradationAtEta::noiseIncreaseADC, EnergyResolutionVsLumi::DegradationAtEta::resolutitonConstantTerm, and mathSSE::sqrt().

195  {
196  // Initial parameters for ECAL resolution
197  double S;
198  double Nadc;
199  double adc2GeV;
200  double C;
201  if (eta < 1.497) {
202  S = 0.028; // CMS note 2006/148 (EB test beam)
203  Nadc = 1.1;
204  adc2GeV = 0.039;
205  C = 0.003;
206  } else {
207  S = 0.052; // CMS DN 2009/002
208  Nadc = 2.0;
209  adc2GeV = 0.069;
210  C = 0.004;
211  }
212 
213  DegradationAtEta d = CalculateDegradation(eta);
214 
215  // adjust resolution parameters
216  S /= sqrt(d.ampDropTotal);
217  Nadc *= d.noiseIncreaseADC;
218  adc2GeV /= d.ampDropTotal;
219  double N = Nadc * adc2GeV * 3.0; // 3x3 noise in GeV
220  C = sqrt(C * C + d.resolutitonConstantTerm * d.resolutitonConstantTerm);
221 
222  return sqrt(S * S / ene + N * N / ene / ene + C * C);
223 }
tuple d
Definition: ztail.py:151
T sqrt(T t)
Definition: SSEVec.h:19
#define N
Definition: blowfish.cc:9
DegradationAtEta CalculateDegradation(double eta)
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 68 of file EnergyResolutionVsLumi.h.

Referenced by calcLightCollectionEfficiencyWeighted(), and calcmuTot().

double EnergyResolutionVsLumi::vpt_eta[10085]
private

Definition at line 69 of file EnergyResolutionVsLumi.h.

Referenced by calcLightCollectionEfficiencyWeighted(), and calcmuTot().