CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes
EcalGlobalShowerContainmentCorrectionsVsEta Class Reference

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

Classes

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

Public Member Functions

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

Private Types

enum  Type { e3x3, e5x5 }
 

Private Member Functions

const double correction (const DetId &xtal, Type type) const
 

Private Attributes

Coefficients coefficients_
 Holds the coeffiecients. The index corresponds to the group. 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) :

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

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_, corr, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients::data, DetId::det(), e5x5, DetId::Ecal, EcalBarrel, EcalEndcap, EBDetId::ieta(), EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients::kCoefficients, evf::evtn::offset(), funct::pow(), and DetId::subdetId().

Referenced by correction3x3(), and correction5x5().

29 {
30  if (xtal.det() == DetId::Ecal && xtal.subdetId() == EcalBarrel )
31  {
32  int offset=0;
33 
34  if (type==e5x5) offset+= Coefficients::kCoefficients;
35 
36  double corr=0;
37 
38  if (EBDetId(xtal).ieta() < coefficients_.data[0])
39  corr=coefficients_.data[1];
40  else
41  corr=coefficients_.data[1] + coefficients_.data[2] * pow ( EBDetId(xtal).ieta() - coefficients_.data[0] , 2);
42 
43  return corr;
44  }
45  else if (xtal.det() == DetId::Ecal && xtal.subdetId() == EcalEndcap )
46  return 1.;
47  else
48  return -1;
49 }
type
Definition: HCALResponse.h:22
Coefficients coefficients_
Holds the coeffiecients. The index corresponds to the group.
int ieta() const
get the crystal ieta
Definition: EBDetId.h:44
unsigned int offset(bool)
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
static const int kCoefficients
The degree of the polynomial used as correction function plus one.
JetCorrectorParameters corr
Definition: classes.h:9
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
const double EcalGlobalShowerContainmentCorrectionsVsEta::correction3x3 ( const DetId xtal) const

The correction factor for 3x3 matrix.

Parameters
posis 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 corr, correction(), and e3x3.

53 {
54  double corr = correction(xtal,e3x3);
55  return corr;
56 }
const double correction(const DetId &xtal, Type type) const
JetCorrectorParameters corr
Definition: classes.h:9
const double EcalGlobalShowerContainmentCorrectionsVsEta::correction5x5 ( const DetId xtal) const

The correction factor for 5x5 matrix.

Parameters
posis 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 corr, correction(), and e5x5.

63 {
64  double corr = correction(xtal,e5x5);
65  return corr;
66 }
const double correction(const DetId &xtal, Type type) const
JetCorrectorParameters corr
Definition: classes.h:9
const EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients EcalGlobalShowerContainmentCorrectionsVsEta::correctionCoefficients ( ) const

Get the correction coefficients for the given xtal.

Definition at line 13 of file EcalGlobalShowerContainmentCorrectionsVsEta.cc.

References coefficients_.

13  {
14  return coefficients_;
15 }
Coefficients coefficients_
Holds the coeffiecients. The index corresponds to the group.
void EcalGlobalShowerContainmentCorrectionsVsEta::fillCorrectionCoefficients ( const Coefficients coefficients)

Fill the correction coefficients.

Definition at line 19 of file EcalGlobalShowerContainmentCorrectionsVsEta.cc.

References coefficients_.

20 {
21  coefficients_=coefficients;
22 }
Coefficients coefficients_
Holds the coeffiecients. The index corresponds to the group.

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