CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
HFRecoEcalCandidateAlgo Class Reference

#include <HFRecoEcalCandidateAlgo.h>

Public Member Functions

 HFRecoEcalCandidateAlgo (bool correct, double e9e25Cut, double intercept2DCut, double intercept2DSlope, const std::vector< double > &e1e9Cut, const std::vector< double > &eCOREe9Cut, const std::vector< double > &eSeLCut, const reco::HFValueStruct hfvv)
 
void produce (const edm::Handle< reco::SuperClusterCollection > &SuperClusters, const reco::HFEMClusterShapeAssociationCollection &AssocShapes, reco::RecoEcalCandidateCollection &RecoECand, int nvtx) const
 

Private Member Functions

reco::RecoEcalCandidate correctEPosition (const reco::SuperCluster &original, const reco::HFEMClusterShape &shape, int nvtx) const
 

Private Attributes

const bool m_correct
 
const double m_e1e9Cuthi
 
const double m_e1e9Cutlo
 
const double m_e9e25Cut
 
const double m_eCOREe9Cuthi
 
const double m_eCOREe9Cutlo
 
const int m_era
 
const double m_eSeLCuthi
 
const double m_eSeLCutlo
 
const reco::HFValueStruct m_hfvv
 
const double m_intercept2DCut
 
const double m_intercept2DSlope
 

Detailed Description

Author
K. Klapoetke – Minnesota

Definition at line 23 of file HFRecoEcalCandidateAlgo.h.

Constructor & Destructor Documentation

◆ HFRecoEcalCandidateAlgo()

HFRecoEcalCandidateAlgo::HFRecoEcalCandidateAlgo ( bool  correct,
double  e9e25Cut,
double  intercept2DCut,
double  intercept2DSlope,
const std::vector< double > &  e1e9Cut,
const std::vector< double > &  eCOREe9Cut,
const std::vector< double > &  eSeLCut,
const reco::HFValueStruct  hfvv 
)

Definition at line 22 of file HFRecoEcalCandidateAlgo.cc.

Member Function Documentation

◆ correctEPosition()

RecoEcalCandidate HFRecoEcalCandidateAlgo::correctEPosition ( const reco::SuperCluster original,
const reco::HFEMClusterShape shape,
int  nvtx 
) const
private

Definition at line 43 of file HFRecoEcalCandidateAlgo.cc.

45  {
46  double corEta = original.eta();
47  //piece-wise log energy correction to eta
48  double logel = log(shape.eLong3x3() / 100.0);
49  double lowC = 0.00911;
50  double hiC = 0.0193;
51  double logSlope = 0.0146;
52  double logIntercept = -0.00988;
53  double sgn = (original.eta() > 0) ? (1.0) : (-1.0);
54  if (logel <= 1.25)
55  corEta += (lowC)*sgn;
56  else if ((logel > 1.25) && (logel <= 2))
57  corEta += (logIntercept + logSlope * logel) * sgn;
58  else if (logel > 2)
59  corEta += hiC * sgn;
60  //poly-3 cell eta correction to eta (de)
61  double p0 = 0.0125;
62  double p1 = -0.0475;
63  double p2 = 0.0732;
64  double p3 = -0.0506;
65  double de = sgn * (p0 + (p1 * (shape.CellEta())) + (p2 * (shape.CellEta() * shape.CellEta())) +
66  (p3 * (shape.CellEta() * shape.CellEta() * shape.CellEta())));
67  corEta += de;
68 
69  double corPhi = original.phi();
70  //poly-3 cell phi correction to phi (dp)
71  p0 = 0.0115;
72  p1 = -0.0394;
73  p2 = 0.0486;
74  p3 = -0.0335;
75  double dp = p0 + (p1 * (shape.CellPhi())) + (p2 * (shape.CellPhi() * shape.CellPhi())) +
76  (p3 * (shape.CellPhi() * shape.CellPhi() * shape.CellPhi()));
77  corPhi += dp;
78 
79  double corEnergy = original.energy();
80  //energy corrections
81  //flat correction for using only long fibers
82  double energyCorrect = 0.7397;
83  corEnergy = corEnergy / energyCorrect;
84  //corection based on ieta for pileup and general
85  //find ieta
86  int ieta = 0;
87  double etabounds[30] = {
88  2.846, 2.957, 3.132, 3.307, 3.482, 3.657, 3.833, 4.006, 4.184, 4.357, 4.532, 4.709, 4.882, 5.184};
89  for (int kk = 0; kk <= 12; kk++) {
90  if ((fabs(corEta) < etabounds[kk + 1]) && (fabs(corEta) > etabounds[kk])) {
91  ieta = (corEta > 0) ? (kk + 29) : (-kk - 29);
92  }
93  }
94  //check if ieta is in bounds, should be [-41, -29] U [29, 41]
95  if (ieta != 0)
96  corEnergy = (m_hfvv.PUSlope(ieta) * 1.0 * (nvtx - 1) + m_hfvv.PUIntercept(ieta) * 1.0) * corEnergy * 1.0 *
97  m_hfvv.EnCor(ieta);
98 
99  //re-calculate the energy vector
100  double corPx = corEnergy * cos(corPhi) / cosh(corEta);
101  double corPy = corEnergy * sin(corPhi) / cosh(corEta);
102  double corPz = corEnergy * tanh(corEta);
103 
104  //make the candidate
105  RecoEcalCandidate corCand(0, math::XYZTLorentzVector(corPx, corPy, corPz, corEnergy), math::XYZPoint(0, 0, 0));
106 
107  return corCand;
108 }

References reco::HFEMClusterShape::CellEta(), reco::HFEMClusterShape::CellPhi(), funct::cos(), Calorimetry_cff::dp, reco::HFEMClusterShape::eLong3x3(), reco::HFValueStruct::EnCor(), LEDCalibrationChannels::ieta, GetRecoTauVFromDQM_MC_cff::kk, dqm-mbProfile::log, m_hfvv, definitions::original, p1, p2, p3, reco::HFValueStruct::PUIntercept(), reco::HFValueStruct::PUSlope(), FWPFMaths::sgn(), and funct::sin().

Referenced by produce().

◆ produce()

void HFRecoEcalCandidateAlgo::produce ( const edm::Handle< reco::SuperClusterCollection > &  SuperClusters,
const reco::HFEMClusterShapeAssociationCollection AssocShapes,
reco::RecoEcalCandidateCollection RecoECand,
int  nvtx 
) const

Analyze the hits

Definition at line 110 of file HFRecoEcalCandidateAlgo.cc.

113  {
114  //get super's and cluster shapes and associations
115  for (unsigned int i = 0; i < SuperClusters->size(); ++i) {
116  const SuperCluster& supClus = (*SuperClusters)[i];
117  reco::SuperClusterRef theClusRef = edm::Ref<SuperClusterCollection>(SuperClusters, i);
118  const HFEMClusterShapeRef clusShapeRef = AssocShapes.find(theClusRef)->val;
119  const HFEMClusterShape& clusShape = *clusShapeRef;
120 
121  // basic candidate
122  double px = supClus.energy() * cos(supClus.phi()) / cosh(supClus.eta());
123  double py = supClus.energy() * sin(supClus.phi()) / cosh(supClus.eta());
124  double pz = supClus.energy() * tanh(supClus.eta());
125  RecoEcalCandidate theCand(0, math::XYZTLorentzVector(px, py, pz, supClus.energy()), math::XYZPoint(0, 0, 0));
126 
127  // correct it?
128  if (m_correct)
129  theCand = correctEPosition(supClus, clusShape, nvtx);
130 
131  double e9e25 = clusShape.eLong3x3() / clusShape.eLong5x5();
132  double e1e9 = clusShape.eLong1x1() / clusShape.eLong3x3();
133  double eSeL = hf_egamma::eSeLCorrected(clusShape.eShort3x3(), clusShape.eLong3x3(), 4);
134  double var2d = (clusShape.eCOREe9() - (eSeL * m_intercept2DSlope));
135 
136  bool isAcceptable = true;
137  isAcceptable = isAcceptable && (e9e25 > m_e9e25Cut);
138  isAcceptable = isAcceptable && (var2d > m_intercept2DCut);
139  isAcceptable = isAcceptable && ((e1e9 < m_e1e9Cuthi) && (e1e9 > m_e1e9Cutlo));
140  isAcceptable = isAcceptable && ((clusShape.eCOREe9() < m_eCOREe9Cuthi) && (clusShape.eCOREe9() > m_eCOREe9Cutlo));
141  isAcceptable = isAcceptable && ((clusShape.eSeL() < m_eSeLCuthi) && (clusShape.eSeL() > m_eSeLCutlo));
142 
143  if (isAcceptable) {
144  theCand.setSuperCluster(theClusRef);
145  RecoECand.push_back(theCand);
146  }
147  }
148 }

References correctEPosition(), funct::cos(), reco::HFEMClusterShape::eCOREe9(), reco::HFEMClusterShape::eLong1x1(), reco::HFEMClusterShape::eLong3x3(), reco::HFEMClusterShape::eLong5x5(), reco::CaloCluster::energy(), reco::HFEMClusterShape::eSeL(), hf_egamma::eSeLCorrected(), reco::HFEMClusterShape::eShort3x3(), reco::CaloCluster::eta(), edm::AssociationMap< Tag >::find(), mps_fire::i, m_correct, m_e1e9Cuthi, m_e1e9Cutlo, m_e9e25Cut, m_eCOREe9Cuthi, m_eCOREe9Cutlo, m_eSeLCuthi, m_eSeLCutlo, m_intercept2DCut, m_intercept2DSlope, reco::CaloCluster::phi(), multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, funct::sin(), and edm::helpers::KeyVal< K, V >::val.

Referenced by HFRecoEcalCandidateProducer::produce(), and HLTHFRecoEcalCandidateProducer::produce().

Member Data Documentation

◆ m_correct

const bool HFRecoEcalCandidateAlgo::m_correct
private

Definition at line 45 of file HFRecoEcalCandidateAlgo.h.

Referenced by produce().

◆ m_e1e9Cuthi

const double HFRecoEcalCandidateAlgo::m_e1e9Cuthi
private

Definition at line 49 of file HFRecoEcalCandidateAlgo.h.

Referenced by produce().

◆ m_e1e9Cutlo

const double HFRecoEcalCandidateAlgo::m_e1e9Cutlo
private

Definition at line 52 of file HFRecoEcalCandidateAlgo.h.

Referenced by produce().

◆ m_e9e25Cut

const double HFRecoEcalCandidateAlgo::m_e9e25Cut
private

Definition at line 46 of file HFRecoEcalCandidateAlgo.h.

Referenced by produce().

◆ m_eCOREe9Cuthi

const double HFRecoEcalCandidateAlgo::m_eCOREe9Cuthi
private

Definition at line 50 of file HFRecoEcalCandidateAlgo.h.

Referenced by produce().

◆ m_eCOREe9Cutlo

const double HFRecoEcalCandidateAlgo::m_eCOREe9Cutlo
private

Definition at line 53 of file HFRecoEcalCandidateAlgo.h.

Referenced by produce().

◆ m_era

const int HFRecoEcalCandidateAlgo::m_era
private

Definition at line 55 of file HFRecoEcalCandidateAlgo.h.

◆ m_eSeLCuthi

const double HFRecoEcalCandidateAlgo::m_eSeLCuthi
private

Definition at line 51 of file HFRecoEcalCandidateAlgo.h.

Referenced by produce().

◆ m_eSeLCutlo

const double HFRecoEcalCandidateAlgo::m_eSeLCutlo
private

Definition at line 54 of file HFRecoEcalCandidateAlgo.h.

Referenced by produce().

◆ m_hfvv

const reco::HFValueStruct HFRecoEcalCandidateAlgo::m_hfvv
private

Definition at line 56 of file HFRecoEcalCandidateAlgo.h.

Referenced by correctEPosition().

◆ m_intercept2DCut

const double HFRecoEcalCandidateAlgo::m_intercept2DCut
private

Definition at line 47 of file HFRecoEcalCandidateAlgo.h.

Referenced by produce().

◆ m_intercept2DSlope

const double HFRecoEcalCandidateAlgo::m_intercept2DSlope
private

Definition at line 48 of file HFRecoEcalCandidateAlgo.h.

Referenced by produce().

reco::CaloCluster::phi
double phi() const
azimuthal angle of cluster centroid
Definition: CaloCluster.h:184
edm::AssociationMap::find
const_iterator find(const key_type &k) const
find element with specified reference key
Definition: AssociationMap.h:173
mps_fire.i
i
Definition: mps_fire.py:355
reco::HFEMClusterShape::CellEta
double CellEta() const
Definition: HFEMClusterShape.h:59
HFRecoEcalCandidateAlgo::m_intercept2DCut
const double m_intercept2DCut
Definition: HFRecoEcalCandidateAlgo.h:47
reco::HFEMClusterShape::eLong1x1
double eLong1x1() const
Definition: HFEMClusterShape.h:36
hfRecoEcalCandidate_cfi.intercept2DCut
intercept2DCut
Definition: hfRecoEcalCandidate_cfi.py:9
reco::HFEMClusterShape::eShort3x3
double eShort3x3() const
Definition: HFEMClusterShape.h:39
reco::SuperCluster
Definition: SuperCluster.h:18
HFRecoEcalCandidateAlgo::m_hfvv
const reco::HFValueStruct m_hfvv
Definition: HFRecoEcalCandidateAlgo.h:56
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
HFRecoEcalCandidateAlgo::m_era
const int m_era
Definition: HFRecoEcalCandidateAlgo.h:55
reco::HFEMClusterShape::eLong5x5
double eLong5x5() const
Definition: HFEMClusterShape.h:40
HFRecoEcalCandidateAlgo::m_eCOREe9Cuthi
const double m_eCOREe9Cuthi
Definition: HFRecoEcalCandidateAlgo.h:50
HFRecoEcalCandidateAlgo::m_eSeLCuthi
const double m_eSeLCuthi
Definition: HFRecoEcalCandidateAlgo.h:51
reco::HFEMClusterShape::eCOREe9
double eCOREe9() const
Definition: HFEMClusterShape.cc:29
reco::HFEMClusterShape::eLong3x3
double eLong3x3() const
Definition: HFEMClusterShape.h:38
FWPFMaths::sgn
float sgn(float val)
Definition: FWPFMaths.cc:9
HFRecoEcalCandidateAlgo::correctEPosition
reco::RecoEcalCandidate correctEPosition(const reco::SuperCluster &original, const reco::HFEMClusterShape &shape, int nvtx) const
Definition: HFRecoEcalCandidateAlgo.cc:43
edm::Ref< SuperClusterCollection >
HFRecoEcalCandidateAlgo::m_e9e25Cut
const double m_e9e25Cut
Definition: HFRecoEcalCandidateAlgo.h:46
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
reco::HFEMClusterShape
Definition: HFEMClusterShape.h:20
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
reco::HFValueStruct::PUSlope
double PUSlope(int ieta) const
Definition: HFValueStruct.cc:48
reco::HFEMClusterShape::eSeL
double eSeL() const
Definition: HFEMClusterShape.cc:28
Calorimetry_cff.dp
dp
Definition: Calorimetry_cff.py:157
reco::HFValueStruct::EnCor
double EnCor(int ieta) const
Definition: HFValueStruct.cc:41
hfRecoEcalCandidate_cfi.eSeLCut
eSeLCut
Definition: hfRecoEcalCandidate_cfi.py:14
p2
double p2[4]
Definition: TauolaWrapper.h:90
reco::HFValueStruct::PUIntercept
double PUIntercept(int ieta) const
Definition: HFValueStruct.cc:55
HFRecoEcalCandidateAlgo::m_correct
const bool m_correct
Definition: HFRecoEcalCandidateAlgo.h:45
GetRecoTauVFromDQM_MC_cff.kk
kk
Definition: GetRecoTauVFromDQM_MC_cff.py:84
edm::helpers::KeyVal::val
V val
Definition: AssociationMapHelpers.h:33
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
hfRecoEcalCandidate_cfi.intercept2DSlope
intercept2DSlope
Definition: hfRecoEcalCandidate_cfi.py:10
HFRecoEcalCandidateAlgo::m_e1e9Cuthi
const double m_e1e9Cuthi
Definition: HFRecoEcalCandidateAlgo.h:49
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
HFRecoEcalCandidateAlgo::m_eSeLCutlo
const double m_eSeLCutlo
Definition: HFRecoEcalCandidateAlgo.h:54
reco::CaloCluster::eta
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:181
definitions.original
original
Definition: definitions.py:57
hfRecoEcalCandidate_cfi.eCOREe9Cut
eCOREe9Cut
Definition: hfRecoEcalCandidate_cfi.py:13
p1
double p1[4]
Definition: TauolaWrapper.h:89
HFRecoEcalCandidateAlgo::m_e1e9Cutlo
const double m_e1e9Cutlo
Definition: HFRecoEcalCandidateAlgo.h:52
hfRecoEcalCandidate_cfi.e9e25Cut
e9e25Cut
Definition: hfRecoEcalCandidate_cfi.py:6
HFRecoEcalCandidateAlgo::m_intercept2DSlope
const double m_intercept2DSlope
Definition: HFRecoEcalCandidateAlgo.h:48
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
hfRecoEcalCandidate_cfi.e1e9Cut
e1e9Cut
Definition: hfRecoEcalCandidate_cfi.py:12
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
reco::HFEMClusterShape::CellPhi
double CellPhi() const
Definition: HFEMClusterShape.h:60
p3
double p3[4]
Definition: TauolaWrapper.h:91
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
hf_egamma::eSeLCorrected
double eSeLCorrected(double es, double el, double pc, double px, double py)
Definition: HFEGammaSLCorrector.cc:6
reco::RecoEcalCandidate
Definition: RecoEcalCandidate.h:15
HFRecoEcalCandidateAlgo::m_eCOREe9Cutlo
const double m_eCOREe9Cutlo
Definition: HFRecoEcalCandidateAlgo.h:53
reco::CaloCluster::energy
double energy() const
cluster energy
Definition: CaloCluster.h:149