CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CaloTauElementsOperators.cc
Go to the documentation of this file.
2 
3 using namespace reco;
4 
5 CaloTauElementsOperators::CaloTauElementsOperators(CaloTau& theCaloTau) : TauElementsOperators(theCaloTau),CaloTau_(theCaloTau),AreaMetric_recoElements_maxabsEta_(2.5){
6  Tracks_=theCaloTau.caloTauTagInfoRef()->Tracks();
7  //EcalRecHits_=theCaloTau.caloTauTagInfoRef()->positionAndEnergyECALRecHits();
8 }
9 
10 std::vector<std::pair<math::XYZPoint,float> >
11 CaloTauElementsOperators::EcalRecHitsInCone(const math::XYZVector& coneAxis,const std::string coneMetric,const double coneSize,const double EcalRecHit_minEt,const std::vector<std::pair<math::XYZPoint,float> >& myEcalRecHits)const{
12  std::vector<std::pair<math::XYZPoint,float> > theFilteredEcalRecHits;
13  for (std::vector<std::pair<math::XYZPoint,float> >::const_iterator iEcalRecHit=myEcalRecHits.begin();iEcalRecHit!=myEcalRecHits.end();++iEcalRecHit) {
14  if ((*iEcalRecHit).second*fabs(sin((*iEcalRecHit).first.theta()))>EcalRecHit_minEt)theFilteredEcalRecHits.push_back(*iEcalRecHit);
15  }
16  std::vector<std::pair<math::XYZPoint,float> > theFilteredEcalRecHitsInCone;
17  if (coneMetric=="DR"){
18  theFilteredEcalRecHitsInCone=EcalRecHitsinCone_DRmetric_(coneAxis,metricDR_,coneSize,theFilteredEcalRecHits);
19  }else if(coneMetric=="angle"){
20  theFilteredEcalRecHitsInCone=EcalRecHitsinCone_Anglemetric_(coneAxis,metricAngle_,coneSize,theFilteredEcalRecHits);
21  }else if(coneMetric=="area"){
22  int errorFlag = 0;
23  FixedAreaIsolationCone fixedAreaCone;
25  double coneAngle=fixedAreaCone(coneAxis.theta(),coneAxis.phi(),0,coneSize,errorFlag);
26  if (errorFlag!=0) return std::vector<std::pair<math::XYZPoint,float> >();
27  theFilteredEcalRecHitsInCone=EcalRecHitsinCone_Anglemetric_(coneAxis,metricAngle_,coneAngle,theFilteredEcalRecHits);
28  }else return std::vector<std::pair<math::XYZPoint,float> >();
29  return theFilteredEcalRecHitsInCone;
30 }
31 
32 std::vector<std::pair<math::XYZPoint,float> >
33 CaloTauElementsOperators::EcalRecHitsInAnnulus(const math::XYZVector& coneAxis,const std::string innerconeMetric,const double innerconeSize,const std::string outerconeMetric,const double outerconeSize,const double EcalRecHit_minEt,const std::vector<std::pair<math::XYZPoint,float> >& myEcalRecHits) const {
34  std::vector<std::pair<math::XYZPoint,float> > theFilteredEcalRecHits;
35  for (std::vector<std::pair<math::XYZPoint,float> >::const_iterator iEcalRecHit=myEcalRecHits.begin();iEcalRecHit!=myEcalRecHits.end();++iEcalRecHit) {
36  if ((*iEcalRecHit).second*fabs(sin((*iEcalRecHit).first.theta()))>EcalRecHit_minEt)theFilteredEcalRecHits.push_back(*iEcalRecHit);
37  }
38  std::vector<std::pair<math::XYZPoint,float> > theFilteredEcalRecHitsInAnnulus;
39  if (outerconeMetric=="DR"){
40  if (innerconeMetric=="DR"){
41  theFilteredEcalRecHitsInAnnulus=EcalRecHitsinAnnulus_innerDRouterDRmetrics_(coneAxis,metricDR_,innerconeSize,metricDR_,outerconeSize,theFilteredEcalRecHits);
42  }else if(innerconeMetric=="angle"){
43  theFilteredEcalRecHitsInAnnulus=EcalRecHitsinAnnulus_innerAngleouterDRmetrics_(coneAxis,metricAngle_,innerconeSize,metricDR_,outerconeSize,theFilteredEcalRecHits);
44  }else if(innerconeMetric=="area"){
45  int errorFlag=0;
46  FixedAreaIsolationCone theFixedAreaSignalCone;
48  double innercone_angle=theFixedAreaSignalCone(coneAxis.theta(),coneAxis.phi(),0,innerconeSize,errorFlag);
49  if (errorFlag!=0)return std::vector<std::pair<math::XYZPoint,float> >();
50  theFilteredEcalRecHitsInAnnulus=EcalRecHitsinAnnulus_innerAngleouterDRmetrics_(coneAxis,metricAngle_,innercone_angle,metricDR_,outerconeSize,theFilteredEcalRecHits);
51  }else return std::vector<std::pair<math::XYZPoint,float> >();
52  }else if(outerconeMetric=="angle"){
53  if (innerconeMetric=="DR"){
54  theFilteredEcalRecHitsInAnnulus=EcalRecHitsinAnnulus_innerDRouterAnglemetrics_(coneAxis,metricDR_,innerconeSize,metricAngle_,outerconeSize,theFilteredEcalRecHits);
55  }else if(innerconeMetric=="angle"){
56  theFilteredEcalRecHitsInAnnulus=EcalRecHitsinAnnulus_innerAngleouterAnglemetrics_(coneAxis,metricAngle_,innerconeSize,metricAngle_,outerconeSize,theFilteredEcalRecHits);
57  }else if(innerconeMetric=="area"){
58  int errorFlag=0;
59  FixedAreaIsolationCone theFixedAreaSignalCone;
61  double innercone_angle=theFixedAreaSignalCone(coneAxis.theta(),coneAxis.phi(),0,innerconeSize,errorFlag);
62  if (errorFlag!=0)return theFilteredEcalRecHitsInAnnulus;
63  theFilteredEcalRecHitsInAnnulus=EcalRecHitsinAnnulus_innerAngleouterAnglemetrics_(coneAxis,metricAngle_,innercone_angle,metricAngle_,outerconeSize,theFilteredEcalRecHits);
64  }else return std::vector<std::pair<math::XYZPoint,float> >();
65  }else if(outerconeMetric=="area"){
66  int errorFlag=0;
67  FixedAreaIsolationCone theFixedAreaSignalCone;
69  if (innerconeMetric=="DR"){
70  // not implemented yet
71  }else if(innerconeMetric=="angle"){
72  double outercone_angle=theFixedAreaSignalCone(coneAxis.theta(),coneAxis.phi(),innerconeSize,outerconeSize,errorFlag);
73  if (errorFlag!=0)return theFilteredEcalRecHitsInAnnulus;
74  theFilteredEcalRecHitsInAnnulus=EcalRecHitsinAnnulus_innerAngleouterAnglemetrics_(coneAxis,metricAngle_,innerconeSize,metricAngle_,outercone_angle,theFilteredEcalRecHits);
75  }else if(innerconeMetric=="area"){
76  double innercone_angle=theFixedAreaSignalCone(coneAxis.theta(),coneAxis.phi(),0,innerconeSize,errorFlag);
77  if (errorFlag!=0)return theFilteredEcalRecHitsInAnnulus;
78  double outercone_angle=theFixedAreaSignalCone(coneAxis.theta(),coneAxis.phi(),innercone_angle,outerconeSize,errorFlag);
79  if (errorFlag!=0)return theFilteredEcalRecHitsInAnnulus;
80  theFilteredEcalRecHitsInAnnulus=EcalRecHitsinAnnulus_innerAngleouterAnglemetrics_(coneAxis,metricAngle_,innercone_angle,metricAngle_,outercone_angle,theFilteredEcalRecHits);
81  }else return std::vector<std::pair<math::XYZPoint,float> >();
82  }
83  return theFilteredEcalRecHitsInAnnulus;
84 }
85 
86 std::vector<std::pair<math::XYZPoint,float> >
87 CaloTauElementsOperators::EcalRecHitsInCone(const math::XYZVector& coneAxis,const std::string coneMetric,const double coneSize,const double EcalRecHit_minEt) const
88 {
89  //this function exists only to provide compatability w/ CMSSW_2_2_3 out of the box.Newer versions recompute the interesting rechits inside RecoTau
90  return EcalRecHitsInCone(coneAxis, coneMetric, coneSize, EcalRecHit_minEt, this->EcalRecHits_);
91 }
92 
93 std::vector<std::pair<math::XYZPoint,float> >
94 CaloTauElementsOperators::EcalRecHitsInAnnulus(const math::XYZVector& coneAxis,const std::string innerconeMetric, const double innerconeSize,
95  const std::string outerconeMetric, const double outerconeSize, const double EcalRecHit_minEt) const
96 {
97  //this function exists only to provide compatability w/ CMSSW_2_2_3 out of the box. Newer versions recompute the interesting rechits inside RecoTau
98  return EcalRecHitsInAnnulus(coneAxis, innerconeMetric, innerconeSize, outerconeMetric, outerconeSize, EcalRecHit_minEt, this->EcalRecHits_);
99 }
100 
101 
102 
103 
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Angle< math::XYZVector, math::XYZPoint > metricAngle_
ElementsInAnnulus< math::XYZVector, DeltaR< math::XYZVector, math::XYZPoint >, Angle< math::XYZVector, math::XYZPoint >, std::pair< math::XYZPoint, float > > EcalRecHitsinAnnulus_innerDRouterAnglemetrics_
std::vector< std::pair< math::XYZPoint, float > > EcalRecHitsInCone(const math::XYZVector &coneAxis, const std::string coneMetric, const double coneSize, const double EcalRecHit_minEt, const std::vector< std::pair< math::XYZPoint, float > > &myEcalRecHits) const
ElementsInAnnulus< math::XYZVector, DeltaR< math::XYZVector, math::XYZPoint >, DeltaR< math::XYZVector, math::XYZPoint >, std::pair< math::XYZPoint, float > > EcalRecHitsinAnnulus_innerDRouterDRmetrics_
ElementsInCone< math::XYZVector, Angle< math::XYZVector, math::XYZPoint >, std::pair< math::XYZPoint, float > > EcalRecHitsinCone_Anglemetric_
DeltaR< math::XYZVector, math::XYZPoint > metricDR_
void setAcceptanceLimit(double etaMaxTrackingAcceptance)
reco::TrackRefVector Tracks_
CaloTauElementsOperators(reco::CaloTau &)
ElementsInAnnulus< math::XYZVector, Angle< math::XYZVector, math::XYZPoint >, DeltaR< math::XYZVector, math::XYZPoint >, std::pair< math::XYZPoint, float > > EcalRecHitsinAnnulus_innerAngleouterDRmetrics_
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
const CaloTauTagInfoRef & caloTauTagInfoRef() const
Definition: CaloTau.cc:29
std::vector< std::pair< math::XYZPoint, float > > EcalRecHitsInAnnulus(const math::XYZVector &coneAxis, const std::string innerconeMetric, const double innerconeSize, const std::string outerconeMetric, const double outerconeSize, const double EcalRecHit_minEt, const std::vector< std::pair< math::XYZPoint, float > > &myEcalRecHits) const
ElementsInCone< math::XYZVector, DeltaR< math::XYZVector, math::XYZPoint >, std::pair< math::XYZPoint, float > > EcalRecHitsinCone_DRmetric_
std::vector< std::pair< math::XYZPoint, float > > EcalRecHits_
ElementsInAnnulus< math::XYZVector, Angle< math::XYZVector, math::XYZPoint >, Angle< math::XYZVector, math::XYZPoint >, std::pair< math::XYZPoint, float > > EcalRecHitsinAnnulus_innerAngleouterAnglemetrics_