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)
 
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 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
EnergyResolutionVsLumi::~EnergyResolutionVsLumi ( )
virtual

Definition at line 14 of file EnergyResolutionVsLumi.cc.

Referenced by EnergyResolutionVsLumi().

14 {}

Member Function Documentation

double EnergyResolutionVsLumi::calcampDropPhotoDetector ( double  eta)

Definition at line 150 of file EnergyResolutionVsLumi.cc.

References EvolutionECAL::AgingVPT(), muonGEMDigis_cfi::instLumi, m_instlumi, m_lumi, and mps_fire::result.

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

150  {
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 }
double AgingVPT(double instLumi, double integralLumi, double eta)
double EnergyResolutionVsLumi::calcampDropTotal ( double  eta)

Definition at line 158 of file EnergyResolutionVsLumi.cc.

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

Referenced by EcalTrivialConditionRetriever::produceEcalLaserAPDPNRatios(), and setLumies().

158  {
159  double tra = this->calcampDropTransparency(eta);
160  double pho = this->calcampDropPhotoDetector(eta);
161  double result = tra * pho;
162  return result;
163 }
double calcampDropPhotoDetector(double eta)
double calcampDropTransparency(double eta)
double EnergyResolutionVsLumi::calcampDropTransparency ( double  eta)

Definition at line 142 of file EnergyResolutionVsLumi.cc.

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

Referenced by calcampDropTotal(), and setLumies().

142  {
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 }
double DegradationMeanEM50GeV(double mu)
double EnergyResolutionVsLumi::calcLightCollectionEfficiencyWeighted ( DetId  id,
double  z 
)

Definition at line 92 of file EnergyResolutionVsLumi.cc.

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

Referenced by ECalSD::curve_LY(), and setLumies().

92  {
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 }
double LightCollectionEfficiencyWeighted(double z, double mu_ind)
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 
)

Definition at line 123 of file EnergyResolutionVsLumi.cc.

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

Referenced by setLumies().

123  {
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 }
double LightCollectionEfficiencyWeighted(double z, double mu_ind)
double calcampDropPhotoDetector(double eta)
double EnergyResolutionVsLumi::calcmuEM ( double  eta)
double EnergyResolutionVsLumi::calcmuHD ( double  eta)

Definition at line 55 of file EnergyResolutionVsLumi.cc.

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

Referenced by calcampDropTransparency(), calcresolutitonConstantTerm(), and setLumies().

55  {
56  double totLumi = m_lumi;
57  EvolutionECAL model;
58  double result = model.InducedAbsorptionHadronic(totLumi, eta);
59  return result;
60 }
double InducedAbsorptionHadronic(double lumi, double eta)
double EnergyResolutionVsLumi::calcmuTot ( double  eta)

Definition at line 132 of file EnergyResolutionVsLumi.cc.

References EvolutionECAL::InducedAbsorptionEM(), EvolutionECAL::InducedAbsorptionHadronic(), muonGEMDigis_cfi::instLumi, m_instlumi, m_lumi, and mps_fire::result.

132  {
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 }
double InducedAbsorptionHadronic(double lumi, double eta)
double InducedAbsorptionEM(double lumi, double eta)
void EnergyResolutionVsLumi::calcmuTot ( )

Definition at line 62 of file EnergyResolutionVsLumi.cc.

References funct::abs(), EBDetId::approxEta(), calcampDropPhotoDetector(), PVValHelper::eta, EEDetId::IX_MAX, EEDetId::IX_MIN, EEDetId::IY_MAX, EEDetId::IY_MIN, cmsBatch::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().

62  {
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 }
float approxEta() const
Definition: EBDetId.h:102
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:18
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 173 of file EnergyResolutionVsLumi.cc.

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

Referenced by setLumies().

173  {
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 }
double NoiseFactorFE(double lumi, double eta)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double EnergyResolutionVsLumi::calcnoiseIncreaseADC ( double  eta)

Definition at line 165 of file EnergyResolutionVsLumi.cc.

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

Referenced by EcalTrivialConditionRetriever::produceEcalPedestals(), and setLumies().

165  {
166  double totLumi = m_lumi;
167  EvolutionECAL model;
168  double result = model.NoiseFactorFE(totLumi, eta);
169  return result;
170  // noise increase in ADC
171 }
double NoiseFactorFE(double lumi, double eta)
double EnergyResolutionVsLumi::calcresolutitonConstantTerm ( double  eta)

Definition at line 189 of file EnergyResolutionVsLumi.cc.

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

Referenced by EcalTrivialConditionRetriever::getIntercalibConstantsFromConfiguration(), and setLumies().

189  {
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 }
double ResolutionConstantTermEM50GeV(double mu)
EnergyResolutionVsLumi::DegradationAtEta EnergyResolutionVsLumi::CalculateDegradation ( double  eta)

Definition at line 16 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(), muonGEMDigis_cfi::instLumi, m_instlumi, m_lumi, EnergyResolutionVsLumi::DegradationAtEta::muEM, EnergyResolutionVsLumi::DegradationAtEta::muHD, EvolutionECAL::NoiseFactorFE(), EnergyResolutionVsLumi::DegradationAtEta::noiseIncreaseADC, EvolutionECAL::ResolutionConstantTermEM50GeV(), EnergyResolutionVsLumi::DegradationAtEta::resolutitonConstantTerm, and mps_fire::result.

Referenced by Resolution().

16  {
17  DegradationAtEta result;
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 }
double NoiseFactorFE(double lumi, double eta)
double ResolutionConstantTermEM50GeV(double mu)
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 
)

Referenced by setLumies().

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

Definition at line 197 of file EnergyResolutionVsLumi.cc.

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

197  {
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 
215  DegradationAtEta d = CalculateDegradation(eta);
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
222  C = sqrt(C * C + d.resolutitonConstantTerm * d.resolutitonConstantTerm);
223 
224  return sqrt(S * S / ene + N * N / ene / ene + C * C);
225 }
T sqrt(T t)
Definition: SSEVec.h:18
#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 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().