CMS 3D CMS Logo

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() [1/2]

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() [2/2]

EnergyResolutionVsLumi::EnergyResolutionVsLumi ( double  lumi,
double  instlumi 
)
inline

◆ ~EnergyResolutionVsLumi()

EnergyResolutionVsLumi::~EnergyResolutionVsLumi ( )
default

Member Function Documentation

◆ calcampDropPhotoDetector()

double EnergyResolutionVsLumi::calcampDropPhotoDetector ( double  eta)

◆ calcampDropTotal()

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)
double calcampDropTransparency(double eta)

◆ calcampDropTransparency()

double EnergyResolutionVsLumi::calcampDropTransparency ( double  eta)

Definition at line 140 of file EnergyResolutionVsLumi.cc.

References calcmuEM(), calcmuHD(), ReggeGribovPartonMC_EposLHC_2760GeV_PbPb_cfi::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 }

◆ calcLightCollectionEfficiencyWeighted()

double EnergyResolutionVsLumi::calcLightCollectionEfficiencyWeighted ( DetId  id,
double  z 
)

Definition at line 90 of file EnergyResolutionVsLumi.cc.

References funct::abs(), EcalBarrel, EcalEndcap, EBDetId::ieta(), LEDCalibrationChannels::ieta, EEDetId::ix(), EEDetId::IX_MAX, EEDetId::iy(), EBDetId::MAX_IETA, ReggeGribovPartonMC_EposLHC_2760GeV_PbPb_cfi::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 }
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

◆ calcLightCollectionEfficiencyWeighted2()

double EnergyResolutionVsLumi::calcLightCollectionEfficiencyWeighted2 ( double  eta,
double  z,
double  mu_ind = -1.0 
)

◆ calcmuEM()

double EnergyResolutionVsLumi::calcmuEM ( double  eta)

◆ calcmuHD()

double EnergyResolutionVsLumi::calcmuHD ( double  eta)

◆ calcmuTot() [1/2]

double EnergyResolutionVsLumi::calcmuTot ( double  eta)

Definition at line 130 of file EnergyResolutionVsLumi.cc.

References PVValHelper::eta, muonGEMDigis_cfi::instLumi, m_instlumi, m_lumi, ReggeGribovPartonMC_EposLHC_2760GeV_PbPb_cfi::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 }

◆ calcmuTot() [2/2]

void EnergyResolutionVsLumi::calcmuTot ( )

Definition at line 60 of file EnergyResolutionVsLumi.cc.

References funct::abs(), EBDetId::approxEta(), calcampDropPhotoDetector(), PVValHelper::eta, l1tTowerCalibrationProducer_cfi::iEta, EEDetId::IX_MAX, EEDetId::IX_MIN, EEDetId::IY_MAX, EEDetId::IY_MIN, dqm-mbProfile::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 }
double calcampDropPhotoDetector(double eta)
static const int IX_MIN
Definition: EEDetId.h:290
static const int IY_MIN
Definition: EEDetId.h:294
float approxEta() const
Definition: EBDetId.h:102
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

◆ calcnoiseADC()

double EnergyResolutionVsLumi::calcnoiseADC ( double  eta)

Definition at line 171 of file EnergyResolutionVsLumi.cc.

References funct::abs(), PVValHelper::eta, m_lumi, ReggeGribovPartonMC_EposLHC_2760GeV_PbPb_cfi::model, 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 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ calcnoiseIncreaseADC()

double EnergyResolutionVsLumi::calcnoiseIncreaseADC ( double  eta)

◆ calcresolutitonConstantTerm()

double EnergyResolutionVsLumi::calcresolutitonConstantTerm ( double  eta)

◆ CalculateDegradation()

EnergyResolutionVsLumi::DegradationAtEta EnergyResolutionVsLumi::CalculateDegradation ( double  eta)

Definition at line 14 of file EnergyResolutionVsLumi.cc.

References PVValHelper::eta, muonGEMDigis_cfi::instLumi, m_instlumi, m_lumi, ReggeGribovPartonMC_EposLHC_2760GeV_PbPb_cfi::model, 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 }

◆ getmuTot()

double EnergyResolutionVsLumi::getmuTot ( double  eta,
int  ix,
int  iy 
)

◆ Resolution()

double EnergyResolutionVsLumi::Resolution ( double  eta,
double  ene 
)

Definition at line 195 of file EnergyResolutionVsLumi.cc.

References correctionTermsCaloMet_cff::C, CalculateDegradation(), ztail::d, PVValHelper::eta, N, 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 }
T sqrt(T t)
Definition: SSEVec.h:19
d
Definition: ztail.py:151
#define N
Definition: blowfish.cc:9
DegradationAtEta CalculateDegradation(double eta)

◆ setInstLumi()

void EnergyResolutionVsLumi::setInstLumi ( double  x)
inline

◆ setLumi()

void EnergyResolutionVsLumi::setLumi ( double  x)
inline

◆ setLumies()

void EnergyResolutionVsLumi::setLumies ( double  x,
double  y 
)
inline

Member Data Documentation

◆ m_instlumi

double EnergyResolutionVsLumi::m_instlumi
private

◆ m_lumi

double EnergyResolutionVsLumi::m_lumi
private

◆ mu_eta

double EnergyResolutionVsLumi::mu_eta[10085]
private

Definition at line 68 of file EnergyResolutionVsLumi.h.

Referenced by calcLightCollectionEfficiencyWeighted(), and calcmuTot().

◆ vpt_eta

double EnergyResolutionVsLumi::vpt_eta[10085]
private

Definition at line 69 of file EnergyResolutionVsLumi.h.

Referenced by calcLightCollectionEfficiencyWeighted(), and calcmuTot().