test
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 
15 
18 
21 
23 
24 #define PI 3.141592653
25 
27 {
28 public:
29  TxyCalculator(const edm::Event &iEvent, const edm::EventSetup &iSetup, const edm::InputTag& trackLabel);
30  double getTxy(const reco::Photon& p, double x, double y);
31  double getHollSxy(const reco::Photon& p, double thePtCut, double outerR, double innerR);
32  int getNumAllTracks(double ptCut);
33  int getNumLocalTracks(const reco::Photon& p, double detaCut, double ptCut);
34 
35 
36 private:
37 
38  double dRDistance(double eta1,double phi1,double eta2,double phi2)
39  {
40  double deta = eta1 - eta2;
41  double dphi = (calcDphi(phi1, phi2));
42 
43  return sqrt(deta * deta + dphi * dphi);
44  }
45 
46  double calcDphi(double phi1_,double phi2_)
47  {
48  double dphi=phi1_-phi2_;
49 
50  if (dphi>0){
51  while (dphi>2*PI) dphi-=2*PI;
52  if (dphi>PI) dphi=2*PI-dphi;
53  } else {
54  while (dphi<-2*PI) dphi+=2*PI;
55  if (dphi<-PI) dphi=-2*PI-dphi;
56  }
57  return dphi;
58  }
59 
60 private:
62 };
63 
64 #endif
65 
double getTxy(const reco::Photon &p, double x, double y)
#define PI
double getHollSxy(const reco::Photon &p, double thePtCut, double outerR, double innerR)
double dRDistance(double eta1, double phi1, double eta2, double phi2)
Definition: TxyCalculator.h:38
edm::Handle< reco::TrackCollection > recCollection
Definition: TxyCalculator.h:61
int iEvent
Definition: GenABIO.cc:230
T sqrt(T t)
Definition: SSEVec.h:48
int getNumAllTracks(double ptCut)
TxyCalculator(const edm::Event &iEvent, const edm::EventSetup &iSetup, const edm::InputTag &trackLabel)
Definition: DDAxes.h:10
double calcDphi(double phi1_, double phi2_)
Definition: TxyCalculator.h:46
int getNumLocalTracks(const reco::Photon &p, double detaCut, double ptCut)