test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
SCEnergyCorrections.h File Reference
#include "DataFormats/EgammaReco/interface/BasicClusterFwd.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 104 of file SCEnergyCorrections.h.

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

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

105 {
106  reco::CaloClusterPtrVector clusters_v;
107 
108  for(reco::CaloCluster_iterator cluster = sc.clustersBegin(); cluster != sc.clustersEnd(); cluster ++)
109  {
110  clusters_v.push_back(*cluster);
111  }
112 
113  return clusters_v;
114 }
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:138
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 20 of file SCEnergyCorrections.h.

References a, b, trackerHits::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(), dtDQMClient_cfg::threshold, and detailsBasic3DVector::y.

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

21 {
22  std::vector<double> fBrem = ps.getParameter<std::vector<double> >("fBremVec");
23  double bremFrLowThr = ps.getParameter<double>("brLinearLowThr");
24  double bremFrHighThr = ps.getParameter<double>("brLinearHighThr");
25 
27  double bremFrac = sc.phiWidth()/sc.etaWidth();
28  double newE = sc.energy();
29  if(fabs(sc.eta()) < 1.479)
30  {
31  reco::SuperCluster fEtaSC = fEtaScCorr(sc);
33  newE = fEtaSC.energy();
34  }
35 
36  if(bremFrac < bremFrLowThr) bremFrac = bremFrLowThr;
37  if(bremFrac < bremFrHighThr) bremFrac = bremFrHighThr;
38 
39  double p0 = fBrem[0];
40  double p1 = fBrem[1];
41  double p2 = fBrem[2];
42  double p3 = fBrem[3];
43  double p4 = fBrem[4];
44  //
45  double threshold = p4;
46 
47  double y = p0*threshold*threshold + p1*threshold + p2;
48  double yprime = 2*p0*threshold + p1;
49  double a = p3;
50  double b = yprime - 2*a*threshold;
51  double c = y - a*threshold*threshold - b*threshold;
52 
53  double fCorr = 1;
54  if( bremFrac < threshold )
55  fCorr = p0*bremFrac*bremFrac + p1*bremFrac + p2;
56  else
57  fCorr = a*bremFrac*bremFrac + b*bremFrac + c;
58 
59  newE /= fCorr;
60  reco::SuperCluster corrSc(newE, sc.position(), sc.seed(), bcs, sc.preshowerEnergy(), 0., 0.);
61  return corrSc;
62 }
T getParameter(std::string const &) const
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:124
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:161
double etaWidth() const
Definition: SuperCluster.h:56
double p4[4]
Definition: TauolaWrapper.h:92
double energy() const
cluster energy
Definition: CaloCluster.h:120
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 94 of file SCEnergyCorrections.h.

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

95 {
97 
98  double newE = sc.rawEnergy()+Ecorr;
99  reco::SuperCluster corrSc(newE, sc.position(), sc.seed(), bcs, sc.preshowerEnergy(), 0., 0.);
100  return corrSc;
101 }
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:124
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 5 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().

6 {
8  double ieta = fabs(sc.eta())*(5/0.087);
9  double p0 = 40.2198;
10  double p1 = -3.03103e-6;
11  double newE;
12 // std::cout << "Corrected E = Raw E * (1+ p1*(ieta - p0)*(ieta - p0))"<< std::endl;
13  if ( ieta < p0 ) newE = sc.rawEnergy();
14  else newE = sc.rawEnergy()/(1 + p1*(ieta - p0)*(ieta - p0));
15 
16  reco::SuperCluster corrSc(newE, sc.position(), sc.seed(), bcs, sc.preshowerEnergy(), 0., 0.);
17  return corrSc;
18 }
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:124
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:161
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 64 of file SCEnergyCorrections.h.

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

65 {
66  // et -- Et of the SuperCluster (with respect to (0,0,0))
67  // eta -- eta of the SuperCluster
68  std::vector<double> fEtEtaParams = ps.getParameter<std::vector<double> >("fEtEtaParamsVec");
69 
70  reco::SuperCluster fBremSC = fBremScCorr(sc, ps);
72 
73  double eta = sc.eta();
74  double et = fBremSC.energy()/cosh(eta);
75  double fCorr = 0.;
76 
77  double p0 = fEtEtaParams[0] + fEtEtaParams[1]/(et + fEtEtaParams[ 2]) + fEtEtaParams[ 3]/(et*et);
78  double p1 = fEtEtaParams[4] + fEtEtaParams[5]/(et + fEtEtaParams[ 6]) + fEtEtaParams[ 7]/(et*et);
79  double p2 = fEtEtaParams[8] + fEtEtaParams[9]/(et + fEtEtaParams[10]) + fEtEtaParams[11]/(et*et);
80 
81  fCorr =
82  p0 +
83  p1 * atan(fEtEtaParams[12]*(fEtEtaParams[13]-fabs(eta))) + fEtEtaParams[14] * fabs(eta) +
84  p1 * fEtEtaParams[15] * fabs(eta) +
85  p2 * fEtEtaParams[16] * eta * eta;
86 
87  if ( fCorr < 0.5 ) fCorr = 0.5;
88 
89  double newE = et/(fCorr*cosh(eta));
90  reco::SuperCluster corrSc(newE, sc.position(), sc.seed(), bcs, sc.preshowerEnergy(), 0., 0.);
91  return corrSc;
92 }
T getParameter(std::string const &) const
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:124
T eta() const
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:161
reco::SuperCluster fBremScCorr(const reco::SuperCluster &sc, const edm::ParameterSet &ps)
double p2[4]
Definition: TauolaWrapper.h:90
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