CMS 3D CMS Logo

Functions
SCEnergyCorrections.h File Reference
#include "DataFormats/EgammaReco/interface/BasicClusterFwd.h"
#include "DataFormats/CaloRecHit/interface/CaloClusterFwd.h"
#include "DataFormats/EgammaReco/interface/SuperCluster.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"

Go to the source code of this file.

Functions

reco::CaloClusterPtrVector CaloClusterVectorCopier (const reco::SuperCluster &sc)
 
reco::SuperCluster fBremScCorr (const reco::SuperCluster &sc, const edm::ParameterSet &ps)
 
reco::SuperCluster fEAddScCorr (const reco::SuperCluster &sc, double Ecorr)
 
reco::SuperCluster fEtaScCorr (const reco::SuperCluster &sc)
 
reco::SuperCluster fEtEtaCorr (const reco::SuperCluster &sc, const edm::ParameterSet &ps)
 

Function Documentation

reco::CaloClusterPtrVector CaloClusterVectorCopier ( const reco::SuperCluster sc)

Definition at line 107 of file SCEnergyCorrections.h.

References reco::SuperCluster::clustersBegin(), reco::SuperCluster::clustersEnd(), and edm::PtrVector< T >::push_back().

Referenced by fBremScCorr(), fEAddScCorr(), fEtaScCorr(), and fEtEtaCorr().

108 {
109  reco::CaloClusterPtrVector clusters_v;
110 
111  for(reco::CaloCluster_iterator cluster = sc.clustersBegin(); cluster != sc.clustersEnd(); cluster ++)
112  {
113  clusters_v.push_back(*cluster);
114  }
115 
116  return clusters_v;
117 }
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:140
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
Definition: SuperCluster.h:75
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents
Definition: SuperCluster.h:78
reco::SuperCluster fBremScCorr ( const reco::SuperCluster sc,
const edm::ParameterSet ps 
)

Definition at line 23 of file SCEnergyCorrections.h.

References a, b, EnergyCorrector::c, CaloClusterVectorCopier(), reco::CaloCluster::energy(), reco::CaloCluster::eta(), reco::SuperCluster::etaWidth(), fEtaScCorr(), edm::ParameterSet::getParameter(), p1, p2, p3, p4, reco::SuperCluster::phiWidth(), reco::CaloCluster::position(), reco::SuperCluster::preshowerEnergy(), reco::SuperCluster::seed(), electronIdCutBased_cfi::threshold, and detailsBasic3DVector::y.

Referenced by ErsatzMEt::analyze(), and fEtEtaCorr().

24 {
25  std::vector<double> fBrem = ps.getParameter<std::vector<double> >("fBremVec");
26  double bremFrLowThr = ps.getParameter<double>("brLinearLowThr");
27  double bremFrHighThr = ps.getParameter<double>("brLinearHighThr");
28 
30  double bremFrac = sc.phiWidth()/sc.etaWidth();
31  double newE = sc.energy();
32  if(fabs(sc.eta()) < 1.479)
33  {
34  reco::SuperCluster fEtaSC = fEtaScCorr(sc);
36  newE = fEtaSC.energy();
37  }
38 
39  if(bremFrac < bremFrLowThr) bremFrac = bremFrLowThr;
40  if(bremFrac < bremFrHighThr) bremFrac = bremFrHighThr;
41 
42  double p0 = fBrem[0];
43  double p1 = fBrem[1];
44  double p2 = fBrem[2];
45  double p3 = fBrem[3];
46  double p4 = fBrem[4];
47  //
48  double threshold = p4;
49 
50  double y = p0*threshold*threshold + p1*threshold + p2;
51  double yprime = 2*p0*threshold + p1;
52  double a = p3;
53  double b = yprime - 2*a*threshold;
54  double c = y - a*threshold*threshold - b*threshold;
55 
56  double fCorr = 1;
57  if( bremFrac < threshold )
58  fCorr = p0*bremFrac*bremFrac + p1*bremFrac + p2;
59  else
60  fCorr = a*bremFrac*bremFrac + b*bremFrac + c;
61 
62  newE /= fCorr;
63  reco::SuperCluster corrSc(newE, sc.position(), sc.seed(), bcs, sc.preshowerEnergy(), 0., 0.);
64  return corrSc;
65 }
T getParameter(std::string const &) const
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:131
double phiWidth() const
obtain phi and eta width of the Super Cluster
Definition: SuperCluster.h:55
reco::SuperCluster fEtaScCorr(const reco::SuperCluster &sc)
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:168
double etaWidth() const
Definition: SuperCluster.h:56
double p4[4]
Definition: TauolaWrapper.h:92
double energy() const
cluster energy
Definition: CaloCluster.h:126
double p2[4]
Definition: TauolaWrapper.h:90
double b
Definition: hdecay.h:120
double p1[4]
Definition: TauolaWrapper.h:89
double a
Definition: hdecay.h:121
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:66
reco::CaloClusterPtrVector CaloClusterVectorCopier(const reco::SuperCluster &sc)
double preshowerEnergy() const
energy deposited in preshower
Definition: SuperCluster.h:50
double p3[4]
Definition: TauolaWrapper.h:91
reco::SuperCluster fEAddScCorr ( const reco::SuperCluster sc,
double  Ecorr 
)

Definition at line 97 of file SCEnergyCorrections.h.

References CaloClusterVectorCopier(), reco::CaloCluster::position(), reco::SuperCluster::preshowerEnergy(), reco::SuperCluster::rawEnergy(), and reco::SuperCluster::seed().

98 {
100 
101  double newE = sc.rawEnergy()+Ecorr;
102  reco::SuperCluster corrSc(newE, sc.position(), sc.seed(), bcs, sc.preshowerEnergy(), 0., 0.);
103  return corrSc;
104 }
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:131
double rawEnergy() const
raw uncorrected energy (sum of energies of component BasicClusters)
Definition: SuperCluster.h:47
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:66
reco::CaloClusterPtrVector CaloClusterVectorCopier(const reco::SuperCluster &sc)
double preshowerEnergy() const
energy deposited in preshower
Definition: SuperCluster.h:50
reco::SuperCluster fEtaScCorr ( const reco::SuperCluster sc)

Definition at line 8 of file SCEnergyCorrections.h.

References CaloClusterVectorCopier(), reco::CaloCluster::eta(), p1, reco::CaloCluster::position(), reco::SuperCluster::preshowerEnergy(), reco::SuperCluster::rawEnergy(), and reco::SuperCluster::seed().

Referenced by ErsatzMEt::analyze(), and fBremScCorr().

9 {
11  double ieta = fabs(sc.eta())*(5/0.087);
12  double p0 = 40.2198;
13  double p1 = -3.03103e-6;
14  double newE;
15 // std::cout << "Corrected E = Raw E * (1+ p1*(ieta - p0)*(ieta - p0))"<< std::endl;
16  if ( ieta < p0 ) newE = sc.rawEnergy();
17  else newE = sc.rawEnergy()/(1 + p1*(ieta - p0)*(ieta - p0));
18 
19  reco::SuperCluster corrSc(newE, sc.position(), sc.seed(), bcs, sc.preshowerEnergy(), 0., 0.);
20  return corrSc;
21 }
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:131
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:168
double rawEnergy() const
raw uncorrected energy (sum of energies of component BasicClusters)
Definition: SuperCluster.h:47
double p1[4]
Definition: TauolaWrapper.h:89
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:66
reco::CaloClusterPtrVector CaloClusterVectorCopier(const reco::SuperCluster &sc)
double preshowerEnergy() const
energy deposited in preshower
Definition: SuperCluster.h:50
reco::SuperCluster fEtEtaCorr ( const reco::SuperCluster sc,
const edm::ParameterSet ps 
)

Definition at line 67 of file SCEnergyCorrections.h.

References CaloClusterVectorCopier(), stringResolutionProvider_cfi::et, PVValHelper::eta, reco::CaloCluster::eta(), fBremScCorr(), edm::ParameterSet::getParameter(), p1, p2, reco::CaloCluster::position(), reco::SuperCluster::preshowerEnergy(), and reco::SuperCluster::seed().

68 {
69  // et -- Et of the SuperCluster (with respect to (0,0,0))
70  // eta -- eta of the SuperCluster
71  std::vector<double> fEtEtaParams = ps.getParameter<std::vector<double> >("fEtEtaParamsVec");
72 
73  reco::SuperCluster fBremSC = fBremScCorr(sc, ps);
75 
76  double eta = sc.eta();
77  double et = fBremSC.energy()/cosh(eta);
78  double fCorr = 0.;
79 
80  double p0 = fEtEtaParams[0] + fEtEtaParams[1]/(et + fEtEtaParams[ 2]) + fEtEtaParams[ 3]/(et*et);
81  double p1 = fEtEtaParams[4] + fEtEtaParams[5]/(et + fEtEtaParams[ 6]) + fEtEtaParams[ 7]/(et*et);
82  double p2 = fEtEtaParams[8] + fEtEtaParams[9]/(et + fEtEtaParams[10]) + fEtEtaParams[11]/(et*et);
83 
84  fCorr =
85  p0 +
86  p1 * atan(fEtEtaParams[12]*(fEtEtaParams[13]-fabs(eta))) + fEtEtaParams[14] * fabs(eta) +
87  p1 * fEtEtaParams[15] * fabs(eta) +
88  p2 * fEtEtaParams[16] * eta * eta;
89 
90  if ( fCorr < 0.5 ) fCorr = 0.5;
91 
92  double newE = et/(fCorr*cosh(eta));
93  reco::SuperCluster corrSc(newE, sc.position(), sc.seed(), bcs, sc.preshowerEnergy(), 0., 0.);
94  return corrSc;
95 }
T getParameter(std::string const &) const
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:131
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:168
reco::SuperCluster fBremScCorr(const reco::SuperCluster &sc, const edm::ParameterSet &ps)
double p2[4]
Definition: TauolaWrapper.h:90
et
define resolution functions of each parameter
double p1[4]
Definition: TauolaWrapper.h:89
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:66
reco::CaloClusterPtrVector CaloClusterVectorCopier(const reco::SuperCluster &sc)
double preshowerEnergy() const
energy deposited in preshower
Definition: SuperCluster.h:50