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(), eta, reco::CaloCluster::eta(), reco::SuperCluster::etaWidth(), hltrates_dqm_sourceclient-live_cfg::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  //fixing divide by zero issue for brem varible, this is the case for single crystal superclusters
14  //as these "superclusters" are likely noise or spikes so setting value to 0 as the uncertainties
15  //will be incorrect regardless so doesnt matter what it is
16  float brem = superCluster.etaWidth()!=0 ? superCluster.phiWidth()/superCluster.etaWidth() : 0;
17 
18  int offset = 0;
19 
20  //if ( superCluster.algoID() == reco::CaloCluster::hybrid ) offset = 0;
21  //else if ( superCluster.algoID() == reco::CaloCluster::multi5x5 ) offset = 36;
22  // TEMPORARY FIX!!
23  if ( eta < 1.5 ) offset = 0;
24  else if ( eta >= 1.5 ) offset = 36;
25  else {
26  // not supported now
27  //std::cout << "Not supported value " << superCluster.algoID() << std::endl;
28  //std::cout << "eta = " << superCluster.eta() << std::endl;
29  //std::cout << "phi = " << superCluster.phi() << std::endl;
30  //std::cout << "En = " << superCluster.energy() << std::endl;
31  return -1;
32  }
33  if ( mode == 0 ) offset += 0; // total effective uncertainty
34  else if ( mode == -1 ) offset += 12; // negative energy uncertainty
35  else if ( mode == 1 ) offset += 24; // positive energy uncertainty
36  else {
37  // wrong input
38  return 0;
39  }
40 
41  float br0_0 = (params_->params())[offset + 0];
42  float br0_1 = (params_->params())[offset + 1];
43  float br0_2 = (params_->params())[offset + 2];
44  float br0_3 = (params_->params())[offset + 3];
45 
46  float br1_0 = (params_->params())[offset + 4];
47  float br1_1 = (params_->params())[offset + 5];
48  float br1_2 = (params_->params())[offset + 6];
49  float br1_3 = (params_->params())[offset + 7];
50 
51  float br2_0 = (params_->params())[offset + 8];
52  float br2_1 = (params_->params())[offset + 9];
53  float br2_2 = (params_->params())[offset + 10];
54  float br2_3 = (params_->params())[offset + 11];
55 
56  float p0 = (br0_0 + br0_1*brem) + (br0_2 + br0_3*brem)/et;
57  float p1 = (br1_0 + br1_1*brem) + (br1_2 + br1_3*brem)/et;
58  float p2 = (br2_0 + br2_1*brem) + (br2_2 + br2_3*brem)/et;
59  //std::cout << "====================================================" << std::endl;
60  //std::cout << "et = " << et << "\t eta = " << eta << std::endl;
61  //std::cout << "p0 = " << p0 << "\t p1 = " << p1 << "\t p2 = " << p2 << std::endl;
62  float uncertainty = en*(p0 + p1*fabs(eta) + p2*eta*eta);
63  //std::cout << uncertainty << std::endl;
64  //std::cout << std::endl;
65  return uncertainty;
66 
67 
68 }
double phiWidth() const
obtain phi and eta width of the Super Cluster
Definition: SuperCluster.h:55
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:163
double etaWidth() const
Definition: SuperCluster.h:56
EcalFunctionParameters & params()
double energy() const
cluster energy
Definition: CaloCluster.h:121
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.;};