CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
L2TauIsolationAlgs Class Reference

#include <L2TauIsolationAlgs.h>

Public Member Functions

std::vector< double > clusterShape (const math::PtEtaPhiELorentzVectorCollection &, const math::XYZVector &, double innerCone, double outerCone) const
 
double isolatedEt (const math::PtEtaPhiELorentzVectorCollection &, const math::XYZVector &, double innerCone, double outerCone) const
 
 L2TauIsolationAlgs ()
 
int nClustersAnnulus (const math::PtEtaPhiELorentzVectorCollection &, const math::XYZVector &, double innerCone, double outerCone) const
 
 ~L2TauIsolationAlgs ()
 

Detailed Description

Definition at line 18 of file L2TauIsolationAlgs.h.

Constructor & Destructor Documentation

L2TauIsolationAlgs::L2TauIsolationAlgs ( )

Definition at line 5 of file L2TauIsolationAlgs.cc.

6 {
7 
8 }
L2TauIsolationAlgs::~L2TauIsolationAlgs ( )

Definition at line 10 of file L2TauIsolationAlgs.cc.

11 {
12 
13 }

Member Function Documentation

std::vector< double > L2TauIsolationAlgs::clusterShape ( const math::PtEtaPhiELorentzVectorCollection hits,
const math::XYZVector direction,
double  innerCone,
double  outerCone 
) const

Definition at line 55 of file L2TauIsolationAlgs.cc.

References trackerHits::c, and funct::pow().

Referenced by L2TauIsolationProducer::produce(), L2TauModularIsolationProducer::produce(), and L2TauNarrowConeIsolationProducer::produce().

56 {
57  double eta_rms=0.;
58  double phi_rms=0.;
59  double dr_rms=0.;
60  double sumpt = 0.;
61 
62  std::vector<double> rmsVector; //declare the vector
63  if(hits.size()>0)
64  {
65  for(math::PtEtaPhiELorentzVectorCollection::const_iterator c = hits.begin();c!=hits.end();++c) //loop on clusters
66  {
67  eta_rms+=c->pt()*std::pow(c->eta()-direction.eta(),2);
68  phi_rms+=c->pt()*std::pow(ROOT::Math::VectorUtil::DeltaPhi(*c,direction),2);
69  dr_rms+=c->pt()*std::pow(ROOT::Math::VectorUtil::DeltaR(*c,direction),2);
70  sumpt+=c->pt();
71  }
72  }
73  else
74  {
75  eta_rms=0.;
76  phi_rms=0.;
77  dr_rms =0.;
78  sumpt=1.;
79  }
80 
81  rmsVector.push_back(eta_rms/sumpt);
82  rmsVector.push_back(phi_rms/sumpt);
83  rmsVector.push_back(dr_rms/sumpt);
84 
85  return rmsVector;
86 }
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
double L2TauIsolationAlgs::isolatedEt ( const math::PtEtaPhiELorentzVectorCollection hits,
const math::XYZVector direction,
double  innerCone,
double  outerCone 
) const

Definition at line 18 of file L2TauIsolationAlgs.cc.

References delta.

Referenced by L2TauIsolationProducer::produce(), L2TauModularIsolationProducer::produce(), and L2TauNarrowConeIsolationProducer::produce().

19 {
20  //Compute the Isolation
21  double eRMax = 0.;
22  double eRMin = 0;
23  if(hits.size()>0)
24  for (math::PtEtaPhiELorentzVectorCollection::const_iterator mRH = hits.begin();mRH!=hits.end();++mRH)
25  {
26  double delta = ROOT::Math::VectorUtil::DeltaR(direction,(*mRH));
27  if(delta <outerCone)
28  eRMax+= mRH->pt();
29  if(delta <innerCone)
30  eRMin+= mRH->pt();
31  }
32  double etIsol = eRMax - eRMin;
33  return etIsol;
34 }
dbl * delta
Definition: mlp_gen.cc:36
int L2TauIsolationAlgs::nClustersAnnulus ( const math::PtEtaPhiELorentzVectorCollection hits,
const math::XYZVector direction,
double  innerCone,
double  outerCone 
) const

Definition at line 38 of file L2TauIsolationAlgs.cc.

References delta.

Referenced by L2TauModularIsolationProducer::produce().

39 {
40  //Compute the Isolation
41  int cands=0;
42  if(hits.size()>0)
43  for (math::PtEtaPhiELorentzVectorCollection::const_iterator mRH = hits.begin();mRH!=hits.end();++mRH)
44  {
45  double delta = ROOT::Math::VectorUtil::DeltaR(direction,(*mRH));
46  if(delta <outerCone)
47  if(delta >innerCone)
48  cands++;
49  }
50  return cands;
51 }
dbl * delta
Definition: mlp_gen.cc:36