CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/RecoTauTag/TauTagTools/interface/TauElementsOperators.h

Go to the documentation of this file.
00001 #ifndef RecoTauTag_RecoTau_TauElementsOperators_H_
00002 #define RecoTauTag_RecoTau_TauElementsOperators_H_
00003 
00004 #include "DataFormats/TauReco/interface/BaseTau.h"
00005 #include "DataFormats/TrackReco/interface/Track.h"
00006 #include "DataFormats/VertexReco/interface/Vertex.h"
00007 
00008 #include "RecoTauTag/TauTagTools/interface/ElementsInCone.h"
00009 #include "RecoTauTag/TauTagTools/interface/ElementsInAnnulus.h"
00010 
00011 #include "PhysicsTools/IsolationUtils/interface/FixedAreaIsolationCone.h"
00012 #include "DataFormats/Math/interface/deltaR.h"
00013 #include "CommonTools/Utils/interface/Angle.h"
00014 
00015 #include "TFormula.h"
00016 
00017 class TauElementsOperators{
00018  public:
00019   TauElementsOperators();
00020   TauElementsOperators(reco::BaseTau&);
00021   ~TauElementsOperators(){}   
00022   // compute size of signal cone possibly depending on E(energy) and/or ET(transverse energy), and/or seed Jet Opening DR of the tau-jet candidate
00023   double computeConeSize(const TFormula& ConeSizeTFormula,double ConeSizeMin,double ConeSizeMax);
00024   double computeConeSize(const TFormula& ConeSizeTFormula,double ConeSizeMin,double ConeSizeMax, double transverseEnergy, double energy, double jetOpeningAngle = 0.);
00025 
00026   //TFormula computeConeSizeTFormula(const std::string& ConeSizeFormula,const char* errorMessage);
00027   void replaceSubStr(std::string& s,const std::string& oldSubStr,const std::string& newSubStr); 
00028   //return the leading (i.e. highest Pt) Track in a given cone around the jet axis or a given direction
00029   const reco::TrackRef leadTk(std::string matchingConeMetric,double matchingConeSize,double ptTrackMin)const;
00030   const reco::TrackRef leadTk(const math::XYZVector& jetAxis,std::string matchingConeMetric,double matchingConeSize,double ptTrackMin)const;
00031   
00032   // return all Tracks in a cone of metric* "coneMetric" and size "coneSize" around a direction "coneAxis" 
00033   const reco::TrackRefVector tracksInCone(const math::XYZVector& coneAxis,const std::string coneMetric,const double coneSize,const double ptTrackMin)const;
00034   const reco::TrackRefVector tracksInCone(const math::XYZVector& coneAxis,const std::string coneMetric,const double coneSize,const double ptTrackMin,const double tracktorefpoint_maxDZ,const double refpoint_Z, const reco::Vertex &myPV)const;
00035   // return all Tracks in an annulus defined by inner(metric* "innerconeMetric" and size "innerconeSize") and outer(metric* "outerconeMetric" and size "outerconeSize") cones around a direction "coneAxis" 
00036   const reco::TrackRefVector tracksInAnnulus(const math::XYZVector& coneAxis,const std::string innerconeMetric,const double innerconeSize,const std::string outerconeMetric,const double outerconeSize,const double ptTrackMin)const;  
00037   const reco::TrackRefVector tracksInAnnulus(const math::XYZVector& coneAxis,const std::string innerconeMetric,const double innerconeSize,const std::string outerconeMetric,const double outerconeSize,const double ptTrackMin,const double tracktorefpoint_maxDZ,const double refpoint_Z, const reco::Vertex &myPV)const;  
00038   // return 1 if no/low Tracks activity in an isolation annulus around a leading Track, 0 otherwise; 
00039   // different possible metrics* for the matching, signal and isolation cones; 
00040   double discriminatorByIsolTracksN(unsigned int isolationAnnulus_Tracksmaxn)const;
00041   double discriminatorByIsolTracksN(const math::XYZVector& coneAxis, 
00042                                     std::string matchingConeMetric,double matchingConeSize, double ptLeadingTrackMin, double ptOtherTracksMin, 
00043                                     std::string signalConeMetric,double signalConeSize,std::string isolationConeMetric,double isolationConeSize, 
00044                                     unsigned int isolationAnnulus_Tracksmaxn)const;
00045   // matching cone axis is the jet axis, signal and isolation cones axes are a leading Track axis;
00046   double discriminatorByIsolTracksN(std::string matchingConeMetric,double matchingConeSize, double ptLeadingTrackMin, double ptOtherTracksMin, 
00047                                     std::string signalConeMetric,double signalConeSize,std::string isolationConeMetric,double isolationConeSize, 
00048                                     unsigned int isolationAnnulus_Tracksmaxn)const;
00049  protected:
00050     TFormula ConeSizeTFormula;
00051 
00052   reco::BaseTau& BaseTau_;
00053   double AreaMetric_recoElements_maxabsEta_;
00054   reco::TrackRefVector Tracks_;  // track selection criteria applied
00055   reco::TrackRefVector IsolTracks_;  // tracks in an isolation annulus, track selection criteria applied; 
00056   // template objects for DR and Angle metrics
00057   DeltaR<math::XYZVector> metricDR_;
00058   Angle<math::XYZVector> metricAngle_;
00059   ElementsInCone<math::XYZVector,DeltaR<math::XYZVector>,reco::TrackCollection> TracksinCone_DRmetric_;
00060   ElementsInCone<math::XYZVector,Angle<math::XYZVector>,reco::TrackCollection> TracksinCone_Anglemetric_; 
00061   ElementsInAnnulus<math::XYZVector,DeltaR<math::XYZVector>,DeltaR<math::XYZVector>,reco::TrackCollection> TracksinAnnulus_innerDRouterDRmetrics_;
00062   ElementsInAnnulus<math::XYZVector,DeltaR<math::XYZVector>,Angle<math::XYZVector>,reco::TrackCollection> TracksinAnnulus_innerDRouterAnglemetrics_; 
00063   ElementsInAnnulus<math::XYZVector,Angle<math::XYZVector>,Angle<math::XYZVector>,reco::TrackCollection> TracksinAnnulus_innerAngleouterAnglemetrics_;
00064   ElementsInAnnulus<math::XYZVector,Angle<math::XYZVector>,DeltaR<math::XYZVector>,reco::TrackCollection> TracksinAnnulus_innerAngleouterDRmetrics_; 
00065 };
00066 
00067 
00068 #endif
00069 
00070 // * different possible metrics for a cone : "DR", "angle", "area";