CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TxyCalculator.h
Go to the documentation of this file.
1 #ifndef TxyCalculator_h
2 #define TxyCalculator_h
3 
7 
9 
12 
16 
19 
22 
23 #define PI 3.141592653
24 
26 {
27 public:
28  TxyCalculator(const edm::Event &iEvent, const edm::EventSetup &iSetup, edm::InputTag trackLabel);
29  double getTxy(const reco::SuperClusterRef p, double x, double y);
30  int getNumAllTracks(double ptCut);
31  int getNumLocalTracks(const reco::SuperClusterRef p, double detaCut, double ptCut);
32 
33 private:
34 
35  double dRDistance(double eta1,double phi1,double eta2,double phi2)
36  {
37  double deta = eta1 - eta2;
38  double dphi = (calcDphi(phi1, phi2));
39 
40  return sqrt(deta * deta + dphi * dphi);
41  }
42 
43  double calcDphi(double phi1_,double phi2_)
44  {
45  double dphi=phi1_-phi2_;
46 
47  if (dphi>0){
48  while (dphi>2*PI) dphi-=2*PI;
49  if (dphi>PI) dphi=2*PI-dphi;
50  } else {
51  while (dphi<-2*PI) dphi+=2*PI;
52  if (dphi<-PI) dphi=-2*PI-dphi;
53  }
54  return dphi;
55  }
56 
57 private:
59 };
60 
61 #endif
62 
#define PI
double dRDistance(double eta1, double phi1, double eta2, double phi2)
Definition: TxyCalculator.h:35
edm::Handle< reco::TrackCollection > recCollection
Definition: TxyCalculator.h:58
double getTxy(const reco::SuperClusterRef p, double x, double y)
int iEvent
Definition: GenABIO.cc:243
T sqrt(T t)
Definition: SSEVec.h:28
int getNumAllTracks(double ptCut)
int getNumLocalTracks(const reco::SuperClusterRef p, double detaCut, double ptCut)
TxyCalculator(const edm::Event &iEvent, const edm::EventSetup &iSetup, edm::InputTag trackLabel)
Definition: DDAxes.h:10
double calcDphi(double phi1_, double phi2_)
Definition: TxyCalculator.h:43