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 #include "CLHEP/Random/RandFlat.h"
23 
24 
25 #define PI 3.141592653
26 
28 {
29  public:
30 
31  TxCalculator(const edm::Event &iEvent, const edm::EventSetup &iSetup, edm::InputTag trackLabel) ;
32 
33  double getTx(const reco::Photon clus, double i,double threshold, double innerDR=0,double effRatio=2);
34  double getCTx(const reco::Photon clus, double i,double threshold, double innerDR=0, double effRatio=2);
35  double getMPT(double ptCut=0, double etaCut=1000);
36 
37  double getJurassicArea( double r1, double r2, double width) ;
38  double getJt(const reco::Photon cluster, double r1=0.4, double r2=0.04, double jWidth=0.015, double threshold=2);
39  double getJct(const reco::Photon cluster, double r1=0.4, double r2=0.04, double jWidth=0.015, double threshold=2);
40 
41  private:
42 
44  CLHEP::RandFlat *theDice;
45 
46  double dRDistance(double eta1,double phi1,double eta2,double phi2)
47  {
48  double deta = eta1 - eta2;
49  double dphi = (calcDphi(phi1, phi2));
50 
51  return sqrt(deta * deta + dphi * dphi);
52  }
53 
54  double calcDphi(double phi1_,double phi2_)
55  {
56  double dphi=phi1_-phi2_;
57 
58  if (dphi>0){
59  while (dphi>2*PI) dphi-=2*PI;
60  if (dphi>PI) dphi=2*PI-dphi;
61  } else {
62  while (dphi<-2*PI) dphi+=2*PI;
63  if (dphi<-PI) dphi=-2*PI-dphi;
64  }
65  return dphi;
66  }
67 
68 };
69 
70 #endif
double getMPT(double ptCut=0, double etaCut=1000)
Definition: TxCalculator.cc:53
double getCTx(const reco::Photon clus, double i, double threshold, double innerDR=0, double effRatio=2)
int i
Definition: DBlmapReader.cc:9
#define PI
CLHEP::RandFlat * theDice
Definition: TxCalculator.h:44
edm::Handle< reco::TrackCollection > recCollection
Definition: TxCalculator.h:43
double getJt(const reco::Photon cluster, double r1=0.4, double r2=0.04, double jWidth=0.015, double threshold=2)
double getJurassicArea(double r1, double r2, double width)
Definition: TxCalculator.cc:40
int iEvent
Definition: GenABIO.cc:243
double dRDistance(double eta1, double phi1, double eta2, double phi2)
Definition: TxCalculator.h:46
T sqrt(T t)
Definition: SSEVec.h:48
TxCalculator(const edm::Event &iEvent, const edm::EventSetup &iSetup, edm::InputTag trackLabel)
Definition: TxCalculator.cc:24
double getTx(const reco::Photon clus, double i, double threshold, double innerDR=0, double effRatio=2)
Definition: TxCalculator.cc:86
double calcDphi(double phi1_, double phi2_)
Definition: TxCalculator.h:54
double getJct(const reco::Photon cluster, double r1=0.4, double r2=0.04, double jWidth=0.015, double threshold=2)