CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFTauElementsOperators.h
Go to the documentation of this file.
1 #ifndef RecoTauTag_RecoTau_PFTauElementsOperators_H_
2 #define RecoTauTag_RecoTau_PFTauElementsOperators_H_
3 
6 
16 
25 
26 #include "Math/GenVector/VectorUtil.h"
27 #include "Math/GenVector/PxPyPzE4D.h"
28 
29 #include <algorithm>
30 
32  public:
36  //return the leading PFCandidate in a given cone around the jet axis or a given direction
37  reco::PFCandidateRef leadPFCand(const std::string matchingcone_metric,const double matchingcone_size,const double minPt)const;
38  reco::PFCandidateRef leadPFCand(const math::XYZVector myVector,const std::string matchingcone_metric,const double matchingcone_size,const double minPt)const;
39  reco::PFCandidateRef leadPFChargedHadrCand(const std::string matchingcone_metric,const double matchingcone_size,const double minPt)const;
40  reco::PFCandidateRef leadPFChargedHadrCand(const math::XYZVector myVector,const std::string matchingcone_metric,const double matchingcone_size,const double minPt)const;
41  reco::PFCandidateRef leadPFNeutrHadrCand(const std::string matchingcone_metric,const double matchingcone_size,const double minPt)const;
42  reco::PFCandidateRef leadPFNeutrHadrCand(const math::XYZVector myVector,const std::string matchingcone_metric,const double matchingcone_size,const double minPt)const;
43  reco::PFCandidateRef leadPFGammaCand(const std::string matchingcone_metric,const double matchingcone_size,const double minPt)const;
44  reco::PFCandidateRef leadPFGammaCand(const math::XYZVector myVector,const std::string matchingcone_metric,const double matchingcone_size,const double minPt)const;
45 
46  // return all PFCandidates in a cone of metric* "cone_metric" and size "conesize" around a direction "myVector"
47  reco::PFCandidateRefVector PFCandsInCone(const reco::PFCandidateRefVector PFCands,const math::XYZVector myVector,const std::string conemetric,const double conesize,const double minPt)const;
48  reco::PFCandidateRefVector PFCandsInCone(const math::XYZVector myVector,const std::string conemetric,const double conesize,const double minPt)const;
49  reco::PFCandidateRefVector PFChargedHadrCandsInCone(const math::XYZVector myVector,const std::string conemetric,const double conesize,const double minPt)const;
50  reco::PFCandidateRefVector PFChargedHadrCandsInCone(const math::XYZVector myVector,const std::string conemetric,const double conesize,const double minPt,const double PFChargedHadrCand_tracktorefpoint_maxDZ,const double refpoint_Z, const reco::Vertex &mPV)const;
51  reco::PFCandidateRefVector PFNeutrHadrCandsInCone(const math::XYZVector myVector,const std::string conemetric,const double conesize,const double minPt)const;
52  reco::PFCandidateRefVector PFGammaCandsInCone(const math::XYZVector myVector,const std::string conemetric,const double conesize,const double minPt)const;
53 
54  // return all PFCandidates in a annulus defined by inner(metric* "innercone_metric" and size "innercone_size") and outer(metric* "outercone_metric" and size "outercone_size") cones around a direction "myVector"
55  reco::PFCandidateRefVector PFCandsInAnnulus(const reco::PFCandidateRefVector PFCands,const math::XYZVector myVector,const std::string innercone_metric,const double innercone_size,const std::string outercone_metric,const double outercone_size,const double minPt)const;
56  reco::PFCandidateRefVector PFCandsInAnnulus(const math::XYZVector myVector,const std::string innercone_metric,const double innercone_size,const std::string outercone_metric,const double outercone_size,const double minPt)const;
57  reco::PFCandidateRefVector PFChargedHadrCandsInAnnulus(const math::XYZVector myVector,const std::string innercone_metric,const double innercone_size,const std::string outercone_metric,const double outercone_size,const double minPt)const;
58  reco::PFCandidateRefVector PFChargedHadrCandsInAnnulus(const math::XYZVector myVector,const std::string innercone_metric,const double innercone_size,const std::string outercone_metric,const double outercone_size,const double minPt,const double PFChargedHadrCand_tracktorefpoint_maxDZ,const double refpoint_Z, const reco::Vertex &myPV)const;
59  reco::PFCandidateRefVector PFNeutrHadrCandsInAnnulus(const math::XYZVector myVector,const std::string innercone_metric,const double innercone_size,const std::string outercone_metric,const double outercone_size,const double minPt)const;
60  reco::PFCandidateRefVector PFGammaCandsInAnnulus(const math::XYZVector myVector,const std::string innercone_metric,const double innercone_size,const std::string outercone_metric,const double outercone_size,const double minPt)const;
61  //Put function to get elements inside ellipse here ... EELL
62  std::pair<reco::PFCandidateRefVector,reco::PFCandidateRefVector> PFGammaCandsInOutEllipse(const reco::PFCandidateRefVector, const reco::PFCandidate, double rPhi, double rEta, double maxPt) const;
63  //EELL
64 
66  void copyCandRefsFilteredByPt(const reco::PFCandidateRefVector& theInputCands, reco::PFCandidateRefVector& theOutputCands, const double minPt);
67 
69  void computeInsideOutContents(const reco::PFCandidateRefVector& theChargedCands, const reco::PFCandidateRefVector& theGammaCands, const math::XYZVector leadTrackVector,
70  const TFormula& coneSizeFormula, double (*ptrToMetricFunction)(const math::XYZVector&, const math::XYZVector&), // determines grow function, and the metric to compare the opening angle to
71  const double minChargedSize, const double maxChargedSize, const double minNeutralSize, const double maxNeutralSize,
72  const double minChargedPt, const double minNeutralPt,
73  const std::string& outlierCollectorConeMetric, const double outlierCollectorConeSize,
74  reco::PFCandidateRefVector& signalChargedObjects, reco::PFCandidateRefVector& outlierChargedObjects,
75  reco::PFCandidateRefVector& signalGammaObjects, reco::PFCandidateRefVector& outlierGammaObjects, bool useScanningAxis); //these last two quantities are the return values
76 
77  // return 1 if no/low PFCandidates activity in an isolation annulus around a leading PFCandidate, 0 otherwise;
78  // different possible metrics* for the matching, signal and isolation cones;
79  double discriminatorByIsolPFCandsN(int IsolPFCands_maxN=0);
80  double discriminatorByIsolPFCandsN(std::string matchingcone_metric,double matchingcone_size,std::string signalcone_metric,double signalcone_size,std::string isolcone_metric,double isolcone_size,bool useOnlyChargedHadrforleadPFCand,double minPt_leadPFCand,double minPt_PFCand,int IsolPFCands_maxN=0);
81  double discriminatorByIsolPFCandsN(math::XYZVector myVector,std::string matchingcone_metric,double matchingcone_size,std::string signalcone_metric,double signalcone_size,std::string isolcone_metric,double isolcone_size,bool useOnlyChargedHadrforleadPFCand,double minPt_leadPFCand,double minPt_PFCand,int IsolPFCands_maxN=0);
82  double discriminatorByIsolPFChargedHadrCandsN(int IsolPFCands_maxN=0);
83  double discriminatorByIsolPFChargedHadrCandsN(std::string matchingcone_metric,double matchingcone_size,std::string signalcone_metric,double signalcone_size,std::string isolcone_metric,double isolcone_size,bool useOnlyChargedHadrforleadPFCand,double minPt_leadPFCand,double minPt_PFCand,int IsolPFCands_maxN=0);
84  double discriminatorByIsolPFChargedHadrCandsN(math::XYZVector myVector,std::string matchingcone_metric,double matchingcone_size,std::string signalcone_metric,double signalcone_size,std::string isolcone_metric,double isolcone_size,bool useOnlyChargedHadrforleadPFCand,double minPt_leadPFCand,double minPt_PFCand,int IsolPFCands_maxN=0);
85  double discriminatorByIsolPFNeutrHadrCandsN(int IsolPFCands_maxN=0);
86  double discriminatorByIsolPFNeutrHadrCandsN(std::string matchingcone_metric,double matchingcone_size,std::string signalcone_metric,double signalcone_size,std::string isolcone_metric,double isolcone_size,bool useOnlyChargedHadrforleadPFCand,double minPt_leadPFCand,double minPt_PFCand,int IsolPFCands_maxN=0);
87  double discriminatorByIsolPFNeutrHadrCandsN(math::XYZVector myVector,std::string matchingcone_metric,double matchingcone_size,std::string signalcone_metric,double signalcone_size,std::string isolcone_metric,double isolcone_size,bool useOnlyChargedHadrforleadPFCand,double minPt_leadPFCand,double minPt_PFCand,int IsolPFCands_maxN=0);
88  double discriminatorByIsolPFGammaCandsN(int IsolPFCands_maxN=0);
89  double discriminatorByIsolPFGammaCandsN(std::string matchingcone_metric,double matchingcone_size,std::string signalcone_metric,double signalcone_size,std::string isolcone_metric,double isolcone_size,bool useOnlyChargedHadrforleadPFCand,double minPt_leadPFCand,double minPt_PFCand,int IsolPFCands_maxN=0);
90  double discriminatorByIsolPFGammaCandsN(math::XYZVector myVector,std::string matchingcone_metric,double matchingcone_size,std::string signalcone_metric,double signalcone_size,std::string isolcone_metric,double isolcone_size,bool useOnlyChargedHadrforleadPFCand,double minPt_leadPFCand,double minPt_PFCand,int IsolPFCands_maxN=0);
91  double discriminatorByIsolPFCandsEtSum(double IsolPFCands_maxEtSum=0);
92  double discriminatorByIsolPFCandsEtSum(std::string matchingcone_metric,double matchingcone_size,std::string signalcone_metric,double signalcone_size,std::string isolcone_metric,double isolcone_size,bool useOnlyChargedHadrforleadPFCand,double minPt_leadPFCand,double minPt_PFCand,double IsolPFCands_maxEtSum=0);
93  double discriminatorByIsolPFCandsEtSum(math::XYZVector myVector,std::string matchingcone_metric,double matchingcone_size,std::string signalcone_metric,double signalcone_size,std::string isolcone_metric,double isolcone_size,bool useOnlyChargedHadrforleadPFCand,double minPt_leadPFCand,double minPt_PFCand,double IsolPFCands_maxEtSum=0);
94  double discriminatorByIsolPFChargedHadrCandsEtSum(std::string matchingcone_metric,double matchingcone_size,std::string signalcone_metric,double signalcone_size,std::string isolcone_metric,double isolcone_size,bool useOnlyChargedHadrforleadPFCand,double minPt_leadPFCand,double minPt_PFCand,double IsolPFCands_maxEtSum=0);
95  double discriminatorByIsolPFChargedHadrCandsEtSum(double IsolPFCands_maxEtSum=0);
96  double discriminatorByIsolPFChargedHadrCandsEtSum(math::XYZVector myVector,std::string matchingcone_metric,double matchingcone_size,std::string signalcone_metric,double signalcone_size,std::string isolcone_metric,double isolcone_size,bool useOnlyChargedHadrforleadPFCand,double minPt_leadPFCand,double minPt_PFCand,double IsolPFCands_maxEtSum=0);
97  double discriminatorByIsolPFNeutrHadrCandsEtSum(double IsolPFCands_maxEtSum=0);
98  double discriminatorByIsolPFNeutrHadrCandsEtSum(std::string matchingcone_metric,double matchingcone_size,std::string signalcone_metric,double signalcone_size,std::string isolcone_metric,double isolcone_size,bool useOnlyChargedHadrforleadPFCand,double minPt_leadPFCand,double minPt_PFCand,double IsolPFCands_maxEtSum=0);
99  double discriminatorByIsolPFNeutrHadrCandsEtSum(math::XYZVector myVector,std::string matchingcone_metric,double matchingcone_size,std::string signalcone_metric,double signalcone_size,std::string isolcone_metric,double isolcone_size,bool useOnlyChargedHadrforleadPFCand,double minPt_leadPFCand,double minPt_PFCand,double IsolPFCands_maxEtSum=0);
100  double discriminatorByIsolPFGammaCandsEtSum(double IsolPFCands_maxEtSum=0);
101  double discriminatorByIsolPFGammaCandsEtSum(std::string matchingcone_metric,double matchingcone_size,std::string signalcone_metric,double signalcone_size,std::string isolcone_metric,double isolcone_size,bool useOnlyChargedHadrforleadPFCand,double minPt_leadPFCand,double minPt_PFCand,double IsolPFCands_maxEtSum=0);
102  double discriminatorByIsolPFGammaCandsEtSum(math::XYZVector myVector,std::string matchingcone_metric,double matchingcone_size,std::string signalcone_metric,double signalcone_size,std::string isolcone_metric,double isolcone_size,bool useOnlyChargedHadrforleadPFCand,double minPt_leadPFCand,double minPt_PFCand,double IsolPFCands_maxEtSum=0);
103  private:
114  // template objects for DR and Angle metrics
117  double computeDeltaR(const math::XYZVector& vec1, const math::XYZVector& vec2);
118  double computeAngle(const math::XYZVector& vec1, const math::XYZVector& vec2);
126 };
127 #endif
128 
129 // * different possible metrics for a cone : "DR", "angle", "area";
130 
131 
132 
133 
ElementsInEllipse< reco::PFCandidate, reco::PFCandidateCollection > PFCandidatesInEllipse_
double computeDeltaR(const math::XYZVector &vec1, const math::XYZVector &vec2)
reco::PFCandidateRefVector PFGammaCands_
reco::PFCandidateRefVector PFNeutrHadrCands_
ElementsInCone< math::XYZVector, Angle< math::XYZVector >, reco::PFCandidateCollection > PFCandsinCone_Anglemetric_
reco::PFCandidateRefVector IsolPFChargedHadrCands_
double discriminatorByIsolPFGammaCandsN(int IsolPFCands_maxN=0)
reco::PFCandidateRefVector PFCands_
reco::PFCandidateRefVector PFCandsInCone(const reco::PFCandidateRefVector PFCands, const math::XYZVector myVector, const std::string conemetric, const double conesize, const double minPt) const
Angle< math::XYZVector > metricAngle_
ElementsInAnnulus< math::XYZVector, Angle< math::XYZVector >, DeltaR< math::XYZVector >, reco::PFCandidateCollection > PFCandsinAnnulus_innerAngleouterDRmetrics_
reco::PFCandidateRefVector PFChargedHadrCands_
double discriminatorByIsolPFChargedHadrCandsN(int IsolPFCands_maxN=0)
ElementsInCone< math::XYZVector, DeltaR< math::XYZVector >, reco::PFCandidateCollection > PFCandsinCone_DRmetric_
reco::PFCandidateRefVector PFNeutrHadrCandsInCone(const math::XYZVector myVector, const std::string conemetric, const double conesize, const double minPt) const
reco::PFCandidateRefVector PFGammaCandsInCone(const math::XYZVector myVector, const std::string conemetric, const double conesize, const double minPt) const
reco::PFCandidateRefVector IsolPFCands_
reco::PFCandidateRefVector PFChargedHadrCandsInAnnulus(const math::XYZVector myVector, const std::string innercone_metric, const double innercone_size, const std::string outercone_metric, const double outercone_size, const double minPt) const
void computeInsideOutContents(const reco::PFCandidateRefVector &theChargedCands, const reco::PFCandidateRefVector &theGammaCands, const math::XYZVector leadTrackVector, const TFormula &coneSizeFormula, double(*ptrToMetricFunction)(const math::XYZVector &, const math::XYZVector &), const double minChargedSize, const double maxChargedSize, const double minNeutralSize, const double maxNeutralSize, const double minChargedPt, const double minNeutralPt, const std::string &outlierCollectorConeMetric, const double outlierCollectorConeSize, reco::PFCandidateRefVector &signalChargedObjects, reco::PFCandidateRefVector &outlierChargedObjects, reco::PFCandidateRefVector &signalGammaObjects, reco::PFCandidateRefVector &outlierGammaObjects, bool useScanningAxis)
compute size of cone using the Inside-Out cone (Author Evan Friis, UC Davis)
ElementsInAnnulus< math::XYZVector, Angle< math::XYZVector >, Angle< math::XYZVector >, reco::PFCandidateCollection > PFCandsinAnnulus_innerAngleouterAnglemetrics_
std::pair< reco::PFCandidateRefVector, reco::PFCandidateRefVector > PFGammaCandsInOutEllipse(const reco::PFCandidateRefVector, const reco::PFCandidate, double rPhi, double rEta, double maxPt) const
ElementsInAnnulus< math::XYZVector, DeltaR< math::XYZVector >, Angle< math::XYZVector >, reco::PFCandidateCollection > PFCandsinAnnulus_innerDRouterAnglemetrics_
double discriminatorByIsolPFCandsEtSum(double IsolPFCands_maxEtSum=0)
std::vector< double > vec1
Definition: HCALResponse.h:15
double discriminatorByIsolPFGammaCandsEtSum(double IsolPFCands_maxEtSum=0)
double discriminatorByIsolPFCandsN(int IsolPFCands_maxN=0)
reco::PFCandidateRefVector IsolPFGammaCands_
double computeAngle(const math::XYZVector &vec1, const math::XYZVector &vec2)
PFTauElementsOperators(reco::PFTau &thePFTau)
double discriminatorByIsolPFNeutrHadrCandsN(int IsolPFCands_maxN=0)
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
reco::PFCandidateRef leadPFNeutrHadrCand(const std::string matchingcone_metric, const double matchingcone_size, const double minPt) const
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
reco::PFCandidateRefVector PFChargedHadrCandsInCone(const math::XYZVector myVector, const std::string conemetric, const double conesize, const double minPt) const
reco::PFCandidateRefVector PFCandsInAnnulus(const reco::PFCandidateRefVector PFCands, const math::XYZVector myVector, const std::string innercone_metric, const double innercone_size, const std::string outercone_metric, const double outercone_size, const double minPt) const
reco::PFCandidateRef leadPFChargedHadrCand(const std::string matchingcone_metric, const double matchingcone_size, const double minPt) const
DeltaR< math::XYZVector > metricDR_
void setAreaMetricrecoElementsmaxabsEta(double x)
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:35
reco::PFCandidateRef leadPFCand(const std::string matchingcone_metric, const double matchingcone_size, const double minPt) const
double discriminatorByIsolPFChargedHadrCandsEtSum(std::string matchingcone_metric, double matchingcone_size, std::string signalcone_metric, double signalcone_size, std::string isolcone_metric, double isolcone_size, bool useOnlyChargedHadrforleadPFCand, double minPt_leadPFCand, double minPt_PFCand, double IsolPFCands_maxEtSum=0)
double discriminatorByIsolPFNeutrHadrCandsEtSum(double IsolPFCands_maxEtSum=0)
ElementsInAnnulus< math::XYZVector, DeltaR< math::XYZVector >, DeltaR< math::XYZVector >, reco::PFCandidateCollection > PFCandsinAnnulus_innerDRouterDRmetrics_
Definition: DDAxes.h:10
std::vector< vec1 > vec2
Definition: HCALResponse.h:16
void copyCandRefsFilteredByPt(const reco::PFCandidateRefVector &theInputCands, reco::PFCandidateRefVector &theOutputCands, const double minPt)
append elements of theInputCands that pass Pt requirement to the end of theOutputCands ...
reco::PFCandidateRef leadPFGammaCand(const std::string matchingcone_metric, const double matchingcone_size, const double minPt) const
reco::PFCandidateRefVector PFGammaCandsInAnnulus(const math::XYZVector myVector, const std::string innercone_metric, const double innercone_size, const std::string outercone_metric, const double outercone_size, const double minPt) const
reco::PFCandidateRefVector IsolPFNeutrHadrCands_
reco::PFCandidateRefVector PFNeutrHadrCandsInAnnulus(const math::XYZVector myVector, const std::string innercone_metric, const double innercone_size, const std::string outercone_metric, const double outercone_size, const double minPt) const