CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TxCalculator.h
Go to the documentation of this file.
1 #ifndef TxCalculator_h
2 #define TxCalculator_h
3 
7 
10 
13 
16 
18 
21 
22 #define PI 3.141592653
23 
24 namespace CLHEP {
25  class HepRandomEngine;
26 }
27 
29 {
30  public:
31 
32  TxCalculator(const edm::Event &iEvent, const edm::EventSetup &iSetup, const edm::InputTag& trackLabel) ;
33 
34  double getTx(const reco::Photon& clus, double i,double threshold, double innerDR=0,double effRatio=2);
35  double getCTx(const reco::Photon& clus, double i,double threshold, double innerDR=0, double effRatio=2);
36  double getMPT(double ptCut=0, double etaCut=1000);
37 
38  double getJurassicArea( double r1, double r2, double width) ;
39  double getJt(const reco::Photon& cluster, double r1=0.4, double r2=0.04, double jWidth=0.015, double threshold=2);
40  double getJct(const reco::Photon& cluster, double r1=0.4, double r2=0.04, double jWidth=0.015, double threshold=2);
41 
42  private:
43 
45  CLHEP::HepRandomEngine *theDice;
46 
47  double dRDistance(double eta1,double phi1,double eta2,double phi2)
48  {
49  double deta = eta1 - eta2;
50  double dphi = (calcDphi(phi1, phi2));
51 
52  return sqrt(deta * deta + dphi * dphi);
53  }
54 
55  double calcDphi(double phi1_,double phi2_)
56  {
57  double dphi=phi1_-phi2_;
58 
59  if (dphi>0){
60  while (dphi>2*PI) dphi-=2*PI;
61  if (dphi>PI) dphi=2*PI-dphi;
62  } else {
63  while (dphi<-2*PI) dphi+=2*PI;
64  if (dphi<-PI) dphi=-2*PI-dphi;
65  }
66  return dphi;
67  }
68 
69 };
70 
71 #endif
double getMPT(double ptCut=0, double etaCut=1000)
Definition: TxCalculator.cc:53
int i
Definition: DBlmapReader.cc:9
#define PI
double getJt(const reco::Photon &cluster, double r1=0.4, double r2=0.04, double jWidth=0.015, double threshold=2)
edm::Handle< reco::TrackCollection > recCollection
Definition: TxCalculator.h:44
double getJurassicArea(double r1, double r2, double width)
Definition: TxCalculator.cc:40
int iEvent
Definition: GenABIO.cc:230
double dRDistance(double eta1, double phi1, double eta2, double phi2)
Definition: TxCalculator.h:47
T sqrt(T t)
Definition: SSEVec.h:48
double getTx(const reco::Photon &clus, double i, double threshold, double innerDR=0, double effRatio=2)
Definition: TxCalculator.cc:86
double getJct(const reco::Photon &cluster, double r1=0.4, double r2=0.04, double jWidth=0.015, double threshold=2)
double calcDphi(double phi1_, double phi2_)
Definition: TxCalculator.h:55
CLHEP::HepRandomEngine * theDice
Definition: TxCalculator.h:45
TxCalculator(const edm::Event &iEvent, const edm::EventSetup &iSetup, const edm::InputTag &trackLabel)
Definition: TxCalculator.cc:26
double getCTx(const reco::Photon &clus, double i, double threshold, double innerDR=0, double effRatio=2)