CMS 3D CMS Logo

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

#include <EcalClusterEnergyUncertainty.h>

Inheritance diagram for EcalClusterEnergyUncertainty:
EcalClusterEnergyUncertaintyBaseClass EcalClusterFunctionBaseClass

Public Member Functions

 EcalClusterEnergyUncertainty (const edm::ParameterSet &)
 
virtual float getValue (const reco::SuperCluster &, const int mode) const
 
virtual float getValue (const reco::BasicCluster &, const EcalRecHitCollection &) const
 
- Public Member Functions inherited from EcalClusterEnergyUncertaintyBaseClass
void checkInit () const
 
 EcalClusterEnergyUncertaintyBaseClass ()
 
 EcalClusterEnergyUncertaintyBaseClass (const edm::ParameterSet &)
 
const
EcalClusterEnergyUncertaintyParameters
getParameters () const
 
virtual void init (const edm::EventSetup &es)
 
virtual ~EcalClusterEnergyUncertaintyBaseClass ()
 
- Public Member Functions inherited from EcalClusterFunctionBaseClass
virtual float getValue (const reco::CaloCluster &) const
 
virtual ~EcalClusterFunctionBaseClass ()
 

Additional Inherited Members

- Protected Attributes inherited from EcalClusterEnergyUncertaintyBaseClass
edm::ESHandle
< EcalClusterEnergyUncertaintyParameters
esParams_
 
const
EcalClusterEnergyUncertaintyParameters
params_
 

Detailed Description

Function that provides uncertainty on supercluster energy measurement Available numbers: total effective uncertainty (in GeV) assymetric uncertainties (positive and negative)

$Id: EcalClusterEnergyUncertainty.h $Date: $Revision:

Author
Yurii Maravin, KSU, March 2009

Function that provides uncertainty on supercluster energy measurement Available numbers: total effective uncertainty (in GeV) assymetric uncertainties (positive and negative)

$Id: EcalClusterEnergyUncertainty.h $Date: $Revision:

Author
Nicolas Chanon, December 2011

Definition at line 17 of file EcalClusterEnergyUncertainty.h.

Constructor & Destructor Documentation

EcalClusterEnergyUncertainty::EcalClusterEnergyUncertainty ( const edm::ParameterSet )
inline

Definition at line 19 of file EcalClusterEnergyUncertainty.h.

19 {};

Member Function Documentation

float EcalClusterEnergyUncertainty::getValue ( const reco::SuperCluster superCluster,
const int  mode 
) const
virtual

Implements EcalClusterEnergyUncertaintyBaseClass.

Definition at line 4 of file EcalClusterEnergyUncertainty.cc.

References EcalClusterEnergyUncertaintyBaseClass::checkInit(), reco::CaloCluster::energy(), reco::CaloCluster::eta(), eta(), reco::SuperCluster::etaWidth(), evf::evtn::offset(), p1, p2, EcalFunParams::params(), EcalClusterEnergyUncertaintyBaseClass::params_, and reco::SuperCluster::phiWidth().

5 {
6  checkInit();
7  // mode = -1 returns negative energy uncertainty
8  // = +1 returns positive energy uncertainty
9  // = 0 (default) returns overall energy uncertainty
10  float en = superCluster.energy();
11  float eta = fabs(superCluster.eta());
12  float et = en/cosh(eta);
13  float brem = superCluster.phiWidth()/superCluster.etaWidth();
14 
15  int offset = 0;
16 
17  //if ( superCluster.algoID() == reco::CaloCluster::hybrid ) offset = 0;
18  //else if ( superCluster.algoID() == reco::CaloCluster::multi5x5 ) offset = 36;
19  // TEMPORARY FIX!!
20  if ( eta < 1.5 ) offset = 0;
21  else if ( eta >= 1.5 ) offset = 36;
22  else {
23  // not supported now
24  //std::cout << "Not supported value " << superCluster.algoID() << std::endl;
25  //std::cout << "eta = " << superCluster.eta() << std::endl;
26  //std::cout << "phi = " << superCluster.phi() << std::endl;
27  //std::cout << "En = " << superCluster.energy() << std::endl;
28  return -1;
29  }
30  if ( mode == 0 ) offset += 0; // total effective uncertainty
31  else if ( mode == -1 ) offset += 12; // negative energy uncertainty
32  else if ( mode == 1 ) offset += 24; // positive energy uncertainty
33  else {
34  // wrong input
35  return 0;
36  }
37 
38  float br0_0 = (params_->params())[offset + 0];
39  float br0_1 = (params_->params())[offset + 1];
40  float br0_2 = (params_->params())[offset + 2];
41  float br0_3 = (params_->params())[offset + 3];
42 
43  float br1_0 = (params_->params())[offset + 4];
44  float br1_1 = (params_->params())[offset + 5];
45  float br1_2 = (params_->params())[offset + 6];
46  float br1_3 = (params_->params())[offset + 7];
47 
48  float br2_0 = (params_->params())[offset + 8];
49  float br2_1 = (params_->params())[offset + 9];
50  float br2_2 = (params_->params())[offset + 10];
51  float br2_3 = (params_->params())[offset + 11];
52 
53  float p0 = (br0_0 + br0_1*brem) + (br0_2 + br0_3*brem)/et;
54  float p1 = (br1_0 + br1_1*brem) + (br1_2 + br1_3*brem)/et;
55  float p2 = (br2_0 + br2_1*brem) + (br2_2 + br2_3*brem)/et;
56  //std::cout << "====================================================" << std::endl;
57  //std::cout << "et = " << et << "\t eta = " << eta << std::endl;
58  //std::cout << "p0 = " << p0 << "\t p1 = " << p1 << "\t p2 = " << p2 << std::endl;
59  float uncertainty = en*(p0 + p1*fabs(eta) + p2*eta*eta);
60  //std::cout << uncertainty << std::endl;
61  //std::cout << std::endl;
62  return uncertainty;
63 
64 
65 }
double phiWidth() const
obtain phi and eta width of the Super Cluster
Definition: SuperCluster.h:55
T eta() const
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:161
double etaWidth() const
Definition: SuperCluster.h:56
EcalFunctionParameters & params()
double energy() const
cluster energy
Definition: CaloCluster.h:120
unsigned int offset(bool)
double p2[4]
Definition: TauolaWrapper.h:90
const EcalClusterEnergyUncertaintyParameters * params_
double p1[4]
Definition: TauolaWrapper.h:89
virtual float EcalClusterEnergyUncertainty::getValue ( const reco::BasicCluster ,
const EcalRecHitCollection  
) const
inlinevirtual

Implements EcalClusterEnergyUncertaintyBaseClass.

Definition at line 22 of file EcalClusterEnergyUncertainty.h.

22 { return 0.;};