CMS 3D CMS Logo

EcalGlobalShowerContainmentCorrectionsVsEta Class Reference

Description: Holds the coefficients of a polynomial that describes variation of the global containment effect as afunction of eta. More...

#include <src/CondFormats/interface/EcalGlobalShowerContainmentCorrectionsVsEta.h>

List of all members.

Public Member Functions

const double correction3x3 (const DetId &xtal) const
 The correction factor for 3x3 matrix.
const double correction5x5 (const DetId &xtal) const
 The correction factor for 5x5 matrix.
const Coefficients correctionCoefficients () const
 Get the correction coefficients for the given xtal.
void fillCorrectionCoefficients (const Coefficients &coefficients)
 Fill the correction coefficients.

Private Types

enum  Type { e3x3, e5x5 }

Private Member Functions

const double correction (const DetId &xtal, Type type) const
 Calculate the correction for the given direction and type.

Private Attributes

Coefficients coefficients_
 Holds the coeffiecients. The index corresponds to the group.

Classes

struct  Coefficients
 Structure defining the container for correction coefficients. More...


Detailed Description

Description: Holds the coefficients of a polynomial that describes variation of the global containment effect as afunction of eta.

Usage example(for real code see CalibCalorimetry/EcalCorrectionModules/test) :

 ESHandle<EcalGlobalShowerContainmentCorrectionsVsEta> pGapCorr;
 iESetup.get<EcalGlobalShowerContainmentCorrectionsVsEtaRcd>().get(pGapCorr);
  
 double correction3x3 = pGapCorr->correction3x3(centerXtal,mathpoint);
 double correction5x5 = pGapCorr->correction5x5(centerXtal,mathpoint);
Author:
Paolo Meridiani
Id
EcalGlobalShowerContainmentCorrectionsVsEta.h,v 1.2 2007/07/16 17:30:53 meridian Exp

Definition at line 35 of file EcalGlobalShowerContainmentCorrectionsVsEta.h.


Member Enumeration Documentation

enum EcalGlobalShowerContainmentCorrectionsVsEta::Type [private]

Enumerator:
e3x3 
e5x5 

Definition at line 96 of file EcalGlobalShowerContainmentCorrectionsVsEta.h.

00096 {e3x3,e5x5};


Member Function Documentation

const double EcalGlobalShowerContainmentCorrectionsVsEta::correction ( const DetId xtal,
EcalGlobalShowerContainmentCorrectionsVsEta::Type  type 
) const [private]

Calculate the correction for the given direction and type.

Definition at line 26 of file EcalGlobalShowerContainmentCorrectionsVsEta.cc.

References coefficients_, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients::data, DetId::det(), e5x5, DetId::Ecal, EcalBarrel, EcalEndcap, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients::kCoefficients, offset, funct::pow(), and DetId::subdetId().

Referenced by correction3x3(), and correction5x5().

00029 {
00030   if (xtal.det() == DetId::Ecal && xtal.subdetId() == EcalBarrel )
00031     {
00032       int offset=0;
00033       
00034       if (type==e5x5) offset+= Coefficients::kCoefficients;
00035       
00036       double corr=0;
00037       
00038       if (EBDetId(xtal).ieta() < coefficients_.data[0])
00039         corr=coefficients_.data[1];
00040       else
00041         corr=coefficients_.data[1] + coefficients_.data[2] * pow ( EBDetId(xtal).ieta() - coefficients_.data[0] , 2);
00042       
00043       return corr;
00044     }
00045   else if (xtal.det() == DetId::Ecal && xtal.subdetId() == EcalEndcap )
00046     return 1.;
00047   else
00048     return -1;
00049 }

const double EcalGlobalShowerContainmentCorrectionsVsEta::correction3x3 ( const DetId xtal  )  const

The correction factor for 3x3 matrix.

Parameters:
pos is the distance in cm from the center of the xtal as calculated in RecoEcal/EgammaCoreTools/interface/PositionCalc.h The valid return value is in the range (0,1] (divide by this value to apply the correction) Returns -1 if correction is not avaiable for that xtal

Definition at line 52 of file EcalGlobalShowerContainmentCorrectionsVsEta.cc.

References correction(), and e3x3.

00053 {
00054   double corr = correction(xtal,e3x3);
00055   return corr;
00056 }

const double EcalGlobalShowerContainmentCorrectionsVsEta::correction5x5 ( const DetId xtal  )  const

The correction factor for 5x5 matrix.

Parameters:
pos is the distance in cm from the center of the xtal as calculated in RecoEcal/EgammaCoreTools/interface/PositionCalc.h The return value is in the range (0,1] (divide by this value to apply the correction) Returns -1 if correction is not avaiable for that xtal

Definition at line 62 of file EcalGlobalShowerContainmentCorrectionsVsEta.cc.

References correction(), and e5x5.

00063 { 
00064   double corr = correction(xtal,e5x5);
00065   return corr;
00066 }

const EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients EcalGlobalShowerContainmentCorrectionsVsEta::correctionCoefficients (  )  const

Get the correction coefficients for the given xtal.

Definition at line 13 of file EcalGlobalShowerContainmentCorrectionsVsEta.cc.

References coefficients_.

00013                                                                           {
00014   return coefficients_;
00015 }

void EcalGlobalShowerContainmentCorrectionsVsEta::fillCorrectionCoefficients ( const Coefficients coefficients  ) 

Fill the correction coefficients.

Definition at line 19 of file EcalGlobalShowerContainmentCorrectionsVsEta.cc.

References coefficients_.

00020 {
00021   coefficients_=coefficients;
00022 }


Member Data Documentation

Coefficients EcalGlobalShowerContainmentCorrectionsVsEta::coefficients_ [private]

Holds the coeffiecients. The index corresponds to the group.

Definition at line 103 of file EcalGlobalShowerContainmentCorrectionsVsEta.h.

Referenced by correction(), correctionCoefficients(), and fillCorrectionCoefficients().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:19:39 2009 for CMSSW by  doxygen 1.5.4