CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HFRecoEcalCandidateAlgo.cc
Go to the documentation of this file.
1 
9 //#includes
13 #include "CLHEP/Vector/LorentzVector.h"
14 #include <iostream>
17 using namespace std;
18 using namespace reco;
19 
20 HFRecoEcalCandidateAlgo::HFRecoEcalCandidateAlgo(bool correct,double e9e25Cut,double intercept2DCut,
21  const std::vector<double>& e1e9Cut,
22  const std::vector<double>& eCOREe9Cut,
23  const std::vector<double>& eSeLCut) :
24 
25  m_correct(correct),
26  m_e9e25Cut(e9e25Cut),
27  m_intercept2DCut(intercept2DCut),
28  m_e1e9Cuthi(e1e9Cut[1]),
29  m_eCOREe9Cuthi(eCOREe9Cut[1]),
30  m_eSeLCuthi(eSeLCut[1]),
31  m_e1e9Cutlo(e1e9Cut[0]),
32  m_eCOREe9Cutlo(eCOREe9Cut[0]),
33  m_eSeLCutlo(eSeLCut[0]){
34 
35 }
36 
38  double energyCorrect=0.7397;//.7515;
39  double etaCorrect=.00938422+0.00682824*sin(6.28318531*shape.CellEta());//.0144225-.00484597*sin(6.17851*shape.CellEta());//0.01139;
40  double phiAmpCorrect=0.00644091;//-0.006483;
41  double phiFreqCorrect=6.28318531;//6.45377;
42 
43  double corEnergy= original.energy()/energyCorrect;
44  double corEta=original.eta();
45  corEta+=(original.eta()>0)?(etaCorrect):(-etaCorrect);
46  double corPhi=original.phi()+phiAmpCorrect*sin(phiFreqCorrect*shape.CellPhi());
47  double corPx=corEnergy*cos(corPhi)/cosh(corEta);
48  double corPy=corEnergy*sin(corPhi)/cosh(corEta);
49  double corPz=corEnergy*tanh(corEta);
50  RecoEcalCandidate corCand(0,
51  math::XYZTLorentzVector(corPx,corPy,corPz,corEnergy),
52  math::XYZPoint(0,0,0));
53 
54  return corCand;
55 }
56 
58  const HFEMClusterShapeAssociationCollection& AssocShapes,
59  RecoEcalCandidateCollection& RecoECand) {
60 
61 
62 
63  //get super's and cluster shapes and associations
64  for (unsigned int i=0; i < SuperClusters->size(); ++i) {
65  const SuperCluster& supClus=(*SuperClusters)[i];
67  const HFEMClusterShapeRef clusShapeRef=AssocShapes.find(theClusRef)->val;
68  const HFEMClusterShape& clusShape=*clusShapeRef;
69 
70  // basic candidate
71  double px=supClus.energy()*cos(supClus.phi())/cosh(supClus.eta());
72  double py=supClus.energy()*sin(supClus.phi())/cosh(supClus.eta());
73  double pz=supClus.energy()*tanh(supClus.eta());
74  RecoEcalCandidate theCand(0,
75  math::XYZTLorentzVector(px,py,pz,supClus.energy()),
76  math::XYZPoint(0,0,0));
77 
78  // correct it?
79  if (m_correct)
80  theCand=correctEPosition(supClus,clusShape);
81 
82  double e9e25=clusShape.eLong3x3()/clusShape.eLong5x5();
83  double e1e9=clusShape.eLong1x1()/clusShape.eLong3x3();
84  // EMID cuts...
85  //if((clusShape.e9e25()> m_e9e25Cut)&&((clusShape.eCOREe9()-(clusShape.eSeL()*1.125)) > m_intercept2DCut)){
86  // if((e9e25> m_e9e25Cut)&&((clusShape.eCOREe9()-(clusShape.eSeL()*1.125)) > m_intercept2DCut)){
87  double var2d=(clusShape.eCOREe9()-(clusShape.eSeL()*1.125));
88 
89  bool isAcceptable=true;
90  isAcceptable=isAcceptable && (e9e25> m_e9e25Cut);
91  isAcceptable=isAcceptable && (var2d > m_intercept2DCut);
92  isAcceptable=isAcceptable && ((e1e9< m_e1e9Cuthi)&&(e1e9> m_e1e9Cutlo));
93  isAcceptable=isAcceptable && ((clusShape.eCOREe9()< m_eCOREe9Cuthi)&&(clusShape.eCOREe9()> m_eCOREe9Cutlo));
94  isAcceptable=isAcceptable && ((clusShape.eSeL()<m_eSeLCuthi)&&(clusShape.eSeL()> m_eSeLCutlo));
95 
96 
97  if(isAcceptable){
98 
99  theCand.setSuperCluster(theClusRef);
100  RecoECand.push_back(theCand);
101  }
102  }
103 }
104 
105 
106 //&&((clusShape.e1e9()< m_e1e9Cuthi)&&(clusShape.e1e9()> m_e1e9Cutlo))&&((clusShape.eCOREe9()< m_eCOREe9Cuthi)&&(clusShape.eCOREe9()> m_eCOREe9Cutlo))&&((clusShape.eSeL()<m_eSeLCuthi)&&(clusShape.eSeL()> m_eSeLCutlo))
reco::RecoEcalCandidate correctEPosition(const reco::SuperCluster &original, const reco::HFEMClusterShape &shape)
int i
Definition: DBlmapReader.cc:9
double eLong5x5() const
double eLong1x1() const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
list original
Definition: definitions.py:60
const_iterator find(const key_type &k) const
find element with specified reference key
double CellPhi() const
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:160
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:30
double eLong3x3() const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double energy() const
cluster energy
Definition: CaloCluster.h:120
HFRecoEcalCandidateAlgo(bool correct, double e9e25Cut, double intercept2DCut, const std::vector< double > &e1e9Cut, const std::vector< double > &eCOREe9Cut, const std::vector< double > &eSeLCut)
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
std::vector< RecoEcalCandidate > RecoEcalCandidateCollection
collectin of RecoEcalCandidate objects
double phi() const
azimuthal angle of cluster centroid
Definition: CaloCluster.h:163
double CellEta() const
void produce(const edm::Handle< reco::SuperClusterCollection > &SuperClusters, const reco::HFEMClusterShapeAssociationCollection &AssocShapes, reco::RecoEcalCandidateCollection &RecoECand)