CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
RxCalculator Class Reference

#include <RxCalculator.h>

Public Member Functions

double getCRx (const reco::SuperClusterRef clus, double i, double threshold, double innerR=0.0)
 
double getRFx (const reco::SuperClusterRef clus, double i, double threshold)
 
double getROx (const reco::SuperClusterRef clus, double i, double threshold)
 
double getRx (const reco::SuperClusterRef clus, double i, double threshold, double innerR=0.0)
 
 RxCalculator (const edm::Event &iEvent, const edm::EventSetup &iSetup, const edm::InputTag &hbheLabel, const edm::InputTag &hfLabel, const edm::InputTag &hoLabel)
 

Private Attributes

const HBHERecHitCollectionfHBHERecHits_
 
const HFRecHitCollectionfHFRecHits_
 
const HORecHitCollectionfHORecHits_
 
const CaloGeometrygeometry_
 

Detailed Description

Definition at line 18 of file RxCalculator.h.

Constructor & Destructor Documentation

RxCalculator::RxCalculator ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const edm::InputTag hbheLabel,
const edm::InputTag hfLabel,
const edm::InputTag hoLabel 
)

Definition at line 20 of file RxCalculator.cc.

References edm::EventSetup::get(), edm::Event::getByLabel(), edm::ESHandleBase::isValid(), edm::HandleBase::isValid(), NULL, edm::Handle< T >::product(), and edm::ESHandle< class >::product().

21 {
23  iEvent.getByLabel(hfLabel, hfhandle);
24  if(hfhandle.isValid())
25  fHFRecHits_ = hfhandle.product();
26  else
27  fHFRecHits_ = NULL;
28 
30  iEvent.getByLabel(hoLabel, hohandle);
31  if(hohandle.isValid())
32  fHORecHits_ = hohandle.product();
33  else
34  fHORecHits_ = NULL;
35 
37  iEvent.getByLabel(hbheLabel, hehbhandle);
38  if(hehbhandle.isValid())
39  fHBHERecHits_ = hehbhandle.product();
40  else
42 
43  ESHandle<CaloGeometry> geometryHandle;
44  iSetup.get<CaloGeometryRecord>().get(geometryHandle);
45  if(geometryHandle.isValid())
46  geometry_ = geometryHandle.product();
47  else
48  geometry_ = NULL;
49 
50 }
const HBHERecHitCollection * fHBHERecHits_
Definition: RxCalculator.h:31
#define NULL
Definition: scimark2.h:8
const CaloGeometry * geometry_
Definition: RxCalculator.h:34
const HORecHitCollection * fHORecHits_
Definition: RxCalculator.h:32
bool isValid() const
Definition: HandleBase.h:76
const HFRecHitCollection * fHFRecHits_
Definition: RxCalculator.h:33
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
T const * product() const
Definition: Handle.h:81
bool isValid() const
Definition: ESHandle.h:37

Member Function Documentation

double RxCalculator::getCRx ( const reco::SuperClusterRef  clus,
double  i,
double  threshold,
double  innerR = 0.0 
)

Definition at line 169 of file RxCalculator.cc.

References cond::rpcobgas::detid, dPhi(), CaloRecHit::energy(), PV3DBase< T, PVType, FrameType >::eta(), eta(), HBHERecHit::id(), cmsHarvester::index, phi, PV3DBase< T, PVType, FrameType >::phi(), PI, and dt_dqm_sourceclient_common_cff::reco.

Referenced by HiEgammaIsolationProducer::produce().

170 {
171  using namespace edm;
172  using namespace reco;
173 
174 
175  if(!fHBHERecHits_) {
176 // LogError("RxCalculator") << "Error! Can't get HBHERecHits for event.";
177  return -100;
178  }
179 
180  double SClusterEta = cluster->eta();
181  double SClusterPhi = cluster->phi();
182  double TotalEt = 0;
183 
184  for(size_t index = 0; index < fHBHERecHits_->size(); index++) {
185  const HBHERecHit &rechit = (*fHBHERecHits_)[index];
186  const DetId &detid = rechit.id();
187  const GlobalPoint& hitpoint = geometry_->getPosition(detid);
188  double eta = hitpoint.eta();
189  double phi = hitpoint.phi();
190  double dEta = fabs(eta-SClusterEta);
191  double dPhi = fabs(phi-SClusterPhi);
192  while (dPhi>2*PI) dPhi-=2*PI;
193  if (dPhi>PI) dPhi=2*PI-dPhi;
194 
195  if (dEta<x*0.1) {
196  double et = rechit.energy()/cosh(eta);
197  if (et<threshold) et=0;
198  TotalEt += et;
199  }
200  }
201 
202  double Rx = getRx(cluster,x,threshold,innerR);
203  double CRx = Rx - TotalEt * (0.01*x*x - innerR*innerR) / (2 * 2 * 0.1 * x) ;
204 
205  return CRx;
206 }
const HBHERecHitCollection * fHBHERecHits_
Definition: RxCalculator.h:31
#define PI
HcalDetId id() const
get the id
Definition: HBHERecHit.h:23
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
double getRx(const reco::SuperClusterRef clus, double i, double threshold, double innerR=0.0)
Definition: RxCalculator.cc:53
T eta() const
const CaloGeometry * geometry_
Definition: RxCalculator.h:34
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
float energy() const
Definition: CaloRecHit.h:17
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:68
Definition: DetId.h:18
T eta() const
Definition: PV3DBase.h:76
size_type size() const
Definition: DDAxes.h:10
Definition: DDAxes.h:10
double RxCalculator::getRFx ( const reco::SuperClusterRef  clus,
double  i,
double  threshold 
)

Definition at line 129 of file RxCalculator.cc.

References cond::rpcobgas::detid, dPhi(), PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, CaloRecHit::energy(), PV3DBase< T, PVType, FrameType >::eta(), eta(), HFRecHit::id(), cmsHarvester::index, phi, PV3DBase< T, PVType, FrameType >::phi(), PI, dt_dqm_sourceclient_common_cff::reco, and mathSSE::sqrt().

130 {
131  using namespace edm;
132  using namespace reco;
133 
134  if(!fHFRecHits_) {
135  LogError("RxCalculator") << "Error! Can't get HFRecHits for event.";
136  return -100;
137  }
138 
139  double SClusterEta = cluster->eta();
140  double SClusterPhi = cluster->phi();
141  double TotalEt = 0;
142 
143  for(size_t index = 0; index < fHFRecHits_->size(); index++) {
144  const HFRecHit &rechit = (*fHFRecHits_)[index];
145  const DetId &detid = rechit.id();
146  const GlobalPoint& hitpoint = geometry_->getPosition(detid);
147  double eta = hitpoint.eta();
148  double phi = hitpoint.phi();
149  double dEta = fabs(eta-SClusterEta);
150  double dPhi = fabs(phi-SClusterPhi);
151  while (dPhi>2*PI) dPhi-=2*PI;
152  if (dPhi>PI) dPhi=2*PI-dPhi;
153 
154 
155  double dR = sqrt(dEta * dEta + dPhi * dPhi);
156  if (dR<x*0.1) {
157  double et = rechit.energy()/cosh(eta);
158  if (et<threshold) et=0;
159  TotalEt += et;
160  }
161  }
162 
163 
164 
165  return TotalEt;
166 }
#define PI
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T eta() const
const CaloGeometry * geometry_
Definition: RxCalculator.h:34
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
float energy() const
Definition: CaloRecHit.h:17
T sqrt(T t)
Definition: SSEVec.h:48
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:68
const HFRecHitCollection * fHFRecHits_
Definition: RxCalculator.h:33
Definition: DetId.h:18
T eta() const
Definition: PV3DBase.h:76
size_type size() const
HcalDetId id() const
Definition: HFRecHit.h:23
Definition: DDAxes.h:10
Definition: DDAxes.h:10
double RxCalculator::getROx ( const reco::SuperClusterRef  clus,
double  i,
double  threshold 
)

Definition at line 94 of file RxCalculator.cc.

References cond::rpcobgas::detid, dPhi(), PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, CaloRecHit::energy(), PV3DBase< T, PVType, FrameType >::eta(), eta(), HORecHit::id(), cmsHarvester::index, phi, PV3DBase< T, PVType, FrameType >::phi(), PI, dt_dqm_sourceclient_common_cff::reco, and mathSSE::sqrt().

95 {
96  using namespace edm;
97  using namespace reco;
98 
99  if(!fHORecHits_) {
100 // LogError("RxCalculator") << "Error! Can't get HORecHits for event.";
101  return -100;
102  }
103 
104  double SClusterEta = cluster->eta();
105  double SClusterPhi = cluster->phi();
106  double TotalEt = 0;
107 
108  for(size_t index = 0; index < fHORecHits_->size(); index++) {
109  const HORecHit &rechit = (*fHORecHits_)[index];
110  const DetId &detid = rechit.id();
111  const GlobalPoint& hitpoint = geometry_->getPosition(detid);
112  double eta = hitpoint.eta();
113  double phi = hitpoint.phi();
114  double dEta = fabs(eta-SClusterEta);
115  double dPhi = fabs(phi-SClusterPhi);
116  while (dPhi>2*PI) dPhi-=2*PI;
117  if (dPhi>PI) dPhi=2*PI-dPhi;
118 
119  double dR = sqrt(dEta * dEta + dPhi * dPhi);
120  if (dR<x*0.1) {
121  double et = rechit.energy()/cosh(eta);
122  if (et<threshold) et=0;
123  TotalEt += et;
124  }
125  }
126  return TotalEt;
127 }
#define PI
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T eta() const
const CaloGeometry * geometry_
Definition: RxCalculator.h:34
const HORecHitCollection * fHORecHits_
Definition: RxCalculator.h:32
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
float energy() const
Definition: CaloRecHit.h:17
T sqrt(T t)
Definition: SSEVec.h:48
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:68
Definition: DetId.h:18
T eta() const
Definition: PV3DBase.h:76
size_type size() const
Definition: DDAxes.h:10
HcalDetId id() const
get the id
Definition: HORecHit.h:19
Definition: DDAxes.h:10
double RxCalculator::getRx ( const reco::SuperClusterRef  clus,
double  i,
double  threshold,
double  innerR = 0.0 
)

Definition at line 53 of file RxCalculator.cc.

References cond::rpcobgas::detid, dPhi(), PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, CaloRecHit::energy(), PV3DBase< T, PVType, FrameType >::eta(), eta(), HBHERecHit::id(), cmsHarvester::index, phi, PV3DBase< T, PVType, FrameType >::phi(), PI, dt_dqm_sourceclient_common_cff::reco, and mathSSE::sqrt().

Referenced by HiEgammaIsolationProducer::produce().

54 {
55  using namespace edm;
56  using namespace reco;
57 
58  if(!fHBHERecHits_) {
59 // LogError("RxCalculator") << "Error! Can't get HBHERecHits for event.";
60  return -100;
61  }
62 
63  double SClusterEta = cluster->eta();
64  double SClusterPhi = cluster->phi();
65  double TotalEt = 0;
66 
67  for(size_t index = 0; index < fHBHERecHits_->size(); index++) {
68  const HBHERecHit &rechit = (*fHBHERecHits_)[index];
69  const DetId &detid = rechit.id();
70  const GlobalPoint& hitpoint = geometry_->getPosition(detid);
71  double eta = hitpoint.eta();
72  double phi = hitpoint.phi();
73  double dEta = fabs(eta-SClusterEta);
74  double dPhi = fabs(phi-SClusterPhi);
75  while (dPhi>2*PI) dPhi-=2*PI;
76  if (dPhi>PI) dPhi=2*PI-dPhi;
77 
78  if (dPhi>PI) dPhi=2*PI-dPhi;
79 
80  double dR = sqrt(dEta * dEta + dPhi * dPhi);
81  // veto inner cone///////////////
82  if ( dR < innerR ) continue;
84  if (dR<x*0.1) {
85  double et = rechit.energy()/cosh(eta);
86  if (et<threshold) et=0;
87  TotalEt += et;
88  }
89  }
90 
91  return TotalEt;
92 }
const HBHERecHitCollection * fHBHERecHits_
Definition: RxCalculator.h:31
#define PI
HcalDetId id() const
get the id
Definition: HBHERecHit.h:23
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T eta() const
const CaloGeometry * geometry_
Definition: RxCalculator.h:34
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
float energy() const
Definition: CaloRecHit.h:17
T sqrt(T t)
Definition: SSEVec.h:48
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:68
Definition: DetId.h:18
T eta() const
Definition: PV3DBase.h:76
size_type size() const
Definition: DDAxes.h:10
Definition: DDAxes.h:10

Member Data Documentation

const HBHERecHitCollection* RxCalculator::fHBHERecHits_
private

Definition at line 31 of file RxCalculator.h.

const HFRecHitCollection* RxCalculator::fHFRecHits_
private

Definition at line 33 of file RxCalculator.h.

const HORecHitCollection* RxCalculator::fHORecHits_
private

Definition at line 32 of file RxCalculator.h.

const CaloGeometry* RxCalculator::geometry_
private

Definition at line 34 of file RxCalculator.h.