CMS 3D CMS Logo

Classes | Public Member Functions | Private Attributes

EnergyResolutionVsLumi Class Reference

#include <EnergyResolutionVsLumi.h>

List of all members.

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 (double lumi, double instlumi)
 EnergyResolutionVsLumi ()
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.

{
  m_lumi=0;
  m_instlumi=0;
  
}
EnergyResolutionVsLumi::EnergyResolutionVsLumi ( double  lumi,
double  instlumi 
) [inline]

Definition at line 24 of file EnergyResolutionVsLumi.h.

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

                                                      {
    m_lumi=lumi;
    m_instlumi=instlumi;
    calcmuTot();
  };
EnergyResolutionVsLumi::~EnergyResolutionVsLumi ( ) [virtual]

Definition at line 17 of file EnergyResolutionVsLumi.cc.

{
}

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().

{
  double instLumi = m_instlumi;
  double totLumi = m_lumi;
  EvolutionECAL model;
  double result = model.AgingVPT(instLumi, totLumi, eta);
  return result;
}
double EnergyResolutionVsLumi::calcampDropTotal ( 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().

{
  double muEM=this->calcmuEM(eta);
  double muHD=this->calcmuHD(eta);
  EvolutionECAL model;
  double result = model.DegradationMeanEM50GeV(muEM+muHD);
  return result;
}
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 z.

Referenced by ECalSD::curve_LY().

{

  double v=1.0;
  double muTot=0;
  if(id.subdetId()==EcalBarrel) {
    EBDetId ebId(id);
    int ieta= fabs(ebId.ieta());
    muTot= mu_eta[ieta];
    
  } else if(id.subdetId()==EcalEndcap){
    EEDetId eeId(id);
    int ix= eeId.ix();
    int iy= eeId.iy();
    
    muTot= mu_eta[EBDetId::MAX_IETA+ix+iy*(EEDetId::IX_MAX)];
    v=vpt_eta[EBDetId::MAX_IETA+ix+iy*(EEDetId::IX_MAX)];
  } else {
    muTot=0;
  }
  double zcor=z;
  EvolutionECAL model;
  if(z<0.02 ) zcor=0.02;
  if(z>0.98) zcor=0.98;

  double result=model.LightCollectionEfficiencyWeighted( zcor , muTot)*v;
  
  
  
  return result; 

}
double EnergyResolutionVsLumi::calcLightCollectionEfficiencyWeighted2 ( double  eta,
double  z,
double  mu_ind = -1.0 
)
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().

{
  double instLumi = m_instlumi;
  EvolutionECAL model;
  double result = model.InducedAbsorptionEM(instLumi, eta);
  return result;
}
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().

{
  double totLumi = m_lumi;
  EvolutionECAL model;
  double result = model.InducedAbsorptionHadronic(totLumi, eta);
  return result;
}
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.

{
  double totLumi = m_lumi;
  double instLumi = m_instlumi;
  EvolutionECAL model;
  double muEM = model.InducedAbsorptionEM(instLumi, eta);
  double muH = model.InducedAbsorptionHadronic(totLumi, eta);
  double result=muEM+muH;
  return result;
} 
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, create_public_lumi_plots::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().

                                       {

  for(int iEta=1; iEta<=EBDetId::MAX_IETA ;++iEta) {
    if(iEta==0) continue;

      double eta=EBDetId::approxEta(EBDetId(iEta,1));
      eta = fabs(eta);
      double r= calcmuTot(eta);
      
      mu_eta[iEta]=r;
      vpt_eta[iEta]=1.0;

  }

  for(int iX=EEDetId::IX_MIN; iX<=EEDetId::IX_MAX ;++iX) {
    for(int iY=EEDetId::IY_MIN; iY<=EEDetId::IY_MAX; ++iY) {
      if (EEDetId::validDetId(iX,iY,1))
        {
          EEDetId eedetidpos(iX,iY,1);
          double eta= -log(tan(0.5*atan(sqrt((iX-50.0)*(iX-50.0)+(iY-50.0)*(iY-50.0))*2.98/328.)));
          eta = fabs(eta);
          double r=calcmuTot(eta);
          double v=calcampDropPhotoDetector(eta);

          mu_eta[EBDetId::MAX_IETA+iX+iY*(EEDetId::IX_MAX)]=r;
          vpt_eta[EBDetId::MAX_IETA+iX+iY*(EEDetId::IX_MAX)]=v;
          //std::cout<<"eta/mu/vpt"<<eta<<"/"<<r<<"/"<<v<<std::endl;
        }
    }
  }

}
double EnergyResolutionVsLumi::calcnoiseADC ( double  eta)

Definition at line 198 of file EnergyResolutionVsLumi.cc.

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

{
  double totLumi = m_lumi;
  double Nadc = 1.1;
  double result =1.0;
  EvolutionECAL model;
  if(fabs(eta)<1.497){
    Nadc = 1.1;
    result = model.NoiseFactorFE(totLumi, eta)*Nadc;
  }else{
    Nadc = 2.0;
    result=Nadc;
    // endcaps no increase in ADC
  }
  return result;

}
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().

{
  double totLumi = m_lumi;
  EvolutionECAL model;
  double result = model.NoiseFactorFE(totLumi, eta);
  return result;
  // noise increase in ADC
}
double EnergyResolutionVsLumi::calcresolutitonConstantTerm ( double  eta)
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(), eta(), EnergyResolutionVsLumi::DegradationAtEta::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().

{
  DegradationAtEta result;

  result.eta = eta;
  double totLumi = m_lumi;
  double instLumi = m_instlumi;

  EvolutionECAL model;

  // Index of induced absorption due to EM damages in PWO4
  result.muEM = model.InducedAbsorptionEM(instLumi, eta);
  
  // Index of induced absorption due to hadron damages in PWO4
  result.muHD = model.InducedAbsorptionHadronic(totLumi, eta);

  // Average degradation of amplitude due to transparency change
  result.ampDropTransparency = model.DegradationMeanEM50GeV(result.muEM+result.muHD);

  // Average degradation of amplitude due to photo-detector aging
  result.ampDropPhotoDetector = model.AgingVPT(instLumi, totLumi, eta);

  result.ampDropTotal = result.ampDropTransparency*result.ampDropPhotoDetector;

  // Noise increase in ADC counts due to photo-detector and front-end
  result.noiseIncreaseADC =  model.NoiseFactorFE(totLumi, eta);

  // Resolution degradation due to LY non-uniformity caused by transparency loss
  result.resolutitonConstantTerm =  model.ResolutionConstantTermEM50GeV(result.muEM+result.muHD);

  return result;
}
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, and mathSSE::sqrt().

{

  double eta = 2.2;
  m_instlumi = 5.0e+34;
  m_lumi = 3000.0;

  DegradationAtEta d = this->CalculateDegradation(eta);


  // Initial parameters for ECAL resolution
  double S;
  double Nadc;
  double adc2GeV;
  double C;
  if(eta<1.497){
    S = 0.028;           // CMS note 2006/148 (EB test beam)
    Nadc = 1.1; 
    adc2GeV = 0.039;
    C = 0.003;
  }else{
    S = 0.052;          //  CMS DN 2009/002
    Nadc = 2.0;
    adc2GeV = 0.069;
    C = 0.0038;
  }


  // adjust resolution parameters
  S /= sqrt(d.ampDropTotal);
  Nadc *= d.noiseIncreaseADC;
  adc2GeV /= d.ampDropTotal;
  //  double N = Nadc*adc2GeV*3.0;   // 3x3 noise in GeV 
  C = sqrt(C*C + d.resolutitonConstantTerm*d.resolutitonConstantTerm);



  /*  for(double ene=1.0; ene<1e+3; ene*=1.1){


    // this is the resolution

    double res =  sqrt(S*S/ene + N*N/ene/ene + C*C);

    double factor = 1.0;
    factor = sin(2.0*atan(exp(-1.0*eta)));
  

  }

  */


}
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, and mathSSE::sqrt().

{  


  // Initial parameters for ECAL resolution
  double S;
  double Nadc;
  double adc2GeV;
  double C;
  if(eta<1.497){
    S = 0.028;           // CMS note 2006/148 (EB test beam)
    Nadc = 1.1; 
    adc2GeV = 0.039;
    C = 0.003;
  }else{
    S = 0.052;          //  CMS DN 2009/002
    Nadc = 2.0;
    adc2GeV = 0.069;
    C = 0.004;
  }


  DegradationAtEta d = CalculateDegradation(eta);

  // adjust resolution parameters
  S /= sqrt(d.ampDropTotal);
  Nadc *= d.noiseIncreaseADC;
  adc2GeV /= d.ampDropTotal;
  double N = Nadc*adc2GeV*3.0;   // 3x3 noise in GeV 
  C = sqrt(C*C + d.resolutitonConstantTerm*d.resolutitonConstantTerm);

  return sqrt(S*S/ene + N*N/ene/ene + C*C);

}
void EnergyResolutionVsLumi::setInstLumi ( double  x) [inline]
void EnergyResolutionVsLumi::setLumi ( double  x) [inline]
void EnergyResolutionVsLumi::setLumies ( double  x,
double  y 
) [inline]

Definition at line 54 of file EnergyResolutionVsLumi.h.

References calcmuTot(), m_instlumi, m_lumi, x, and detailsBasic3DVector::y.

Referenced by ECalSD::ECalSD().


Member Data Documentation

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().