CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/RecoHI/HiEgammaAlgos/interface/TxCalculator.h

Go to the documentation of this file.
00001 #ifndef TxCalculator_h
00002 #define TxCalculator_h
00003 
00004 #include "FWCore/Framework/interface/Event.h"
00005 #include "FWCore/Framework/interface/EventSetup.h"
00006 #include "FWCore/Framework/interface/ESHandle.h"
00007 
00008 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00009 #include "FWCore/Utilities/interface/InputTag.h"
00010 
00011 #include "DataFormats/EgammaReco/interface/BasicClusterFwd.h"
00012 #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h"
00013 
00014 #include "DataFormats/TrackReco/interface/Track.h"
00015 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00016 
00017 #include "DataFormats/EgammaCandidates/interface/Photon.h"
00018 
00019 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00020 #include "Geometry/Records/interface/IdealGeometryRecord.h"
00021 
00022 #include "CLHEP/Random/RandFlat.h"
00023 
00024 
00025 #define PI 3.141592653
00026 
00027 class TxCalculator
00028 {
00029   public:
00030   
00031    TxCalculator(const edm::Event &iEvent, const edm::EventSetup &iSetup, edm::InputTag trackLabel) ;
00032   
00033    double getTx(const reco::Photon clus, double i,double threshold, double innerDR=0,double effRatio=2);
00034    double getCTx(const reco::Photon clus, double i,double threshold, double innerDR=0, double effRatio=2);
00035    double getMPT(double ptCut=0, double etaCut=1000);
00036 
00037    double getJurassicArea( double r1, double r2, double width) ;
00038    double getJt(const reco::Photon cluster, double r1=0.4, double r2=0.04, double jWidth=0.015, double threshold=2);
00039    double getJct(const reco::Photon cluster, double r1=0.4, double r2=0.04, double jWidth=0.015, double threshold=2);
00040    
00041  private:
00042    
00043    edm::Handle<reco::TrackCollection>  recCollection;
00044    CLHEP::RandFlat *theDice;
00045 
00046    double dRDistance(double eta1,double phi1,double eta2,double phi2)
00047    {
00048       double deta = eta1 - eta2;
00049       double dphi = (calcDphi(phi1, phi2));
00050       
00051       return sqrt(deta * deta + dphi * dphi);
00052    }
00053 
00054    double calcDphi(double phi1_,double phi2_)
00055    {
00056        double dphi=phi1_-phi2_;
00057 
00058       if (dphi>0){
00059          while (dphi>2*PI) dphi-=2*PI;
00060          if (dphi>PI) dphi=2*PI-dphi; 
00061       } else {
00062          while (dphi<-2*PI) dphi+=2*PI;
00063          if (dphi<-PI) dphi=-2*PI-dphi;
00064       }
00065       return dphi;
00066    }
00067    
00068 };
00069 
00070 #endif