CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Attributes
reco::isodeposit::Direction Class Reference

#include <IsoDepositDirection.h>

Classes

struct  Distance
 

Public Member Functions

double deltaR (const Direction &dir2) const
 
double deltaR2 (const Direction &dir2) const
 
 Direction (double eta=0., double phi=0.)
 
double eta () const
 
Direction operator+ (const Distance &relDir) const
 
Distance operator- (const Direction &dir2) const
 
bool operator== (const Direction &d2)
 
double phi () const
 
std::string print () const
 
double theta () const
 

Private Attributes

float theEta
 
float thePhi
 

Detailed Description

Definition at line 19 of file IsoDepositDirection.h.

Constructor & Destructor Documentation

reco::isodeposit::Direction::Direction ( double  eta = 0.,
double  phi = 0. 
)
inline

Definition at line 28 of file IsoDepositDirection.h.

References M_PI, and thePhi.

Referenced by operator+().

28  : theEta(eta), thePhi(phi) {
29  while( thePhi < 0.0 ) thePhi += 2*M_PI;
30  while( thePhi >= 2*M_PI ) thePhi -= 2*M_PI;
31  };
#define M_PI
Definition: BFit3D.cc:3

Member Function Documentation

double reco::isodeposit::Direction::deltaR ( const Direction dir2) const
inline
double reco::isodeposit::Direction::deltaR2 ( const Direction dir2) const
inline

Definition at line 43 of file IsoDepositDirection.h.

References reco::deltaR2().

Referenced by egammaisolation::EgammaTowerExtractor::deposit(), reco::isodeposit::ConeVeto::veto(), and reco::isodeposit::ConeThresholdVeto::veto().

43  {
44  return reco::deltaR2(*this, dir2);
45  }
double deltaR2(double eta1, double phi1, double eta2, double phi2)
Definition: deltaR.h:13
double reco::isodeposit::Direction::eta ( ) const
inline
Direction reco::isodeposit::Direction::operator+ ( const Distance relDir) const
inline

Definition at line 61 of file IsoDepositDirection.h.

References funct::cos(), reco::isodeposit::Direction::Distance::deltaR, Direction(), eta(), phi(), reco::isodeposit::Direction::Distance::relativeAngle, funct::sin(), theEta, and thePhi.

61  {
62  double eta = theEta + relDir.deltaR*cos(relDir.relativeAngle);
63  double phi = thePhi + relDir.deltaR*sin(relDir.relativeAngle);
64  return Direction(eta,phi);
65  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Direction(double eta=0., double phi=0.)
Distance reco::isodeposit::Direction::operator- ( const Direction dir2) const
inline

Definition at line 50 of file IsoDepositDirection.h.

References reco::deltaPhi(), reco::isodeposit::Direction::Distance::deltaR, deltaR(), dPhi(), PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, eta(), phi(), reco::isodeposit::Direction::Distance::relativeAngle, query::result, theEta, and thePhi.

50  {
51  Distance result;
52  double dR = deltaR(dir2);
53  double dEta = theEta-dir2.eta();
54  double dPhi = reco::deltaPhi(thePhi,dir2.phi());
55 
56  result.relativeAngle = (dR > 1.e-4) ? atan2(dPhi,dEta) : 0.;
57  result.deltaR = dR;
58  return result;
59  }
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
tuple result
Definition: query.py:137
double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:12
double deltaR(const Direction &dir2) const
bool reco::isodeposit::Direction::operator== ( const Direction d2)
inline

Definition at line 37 of file IsoDepositDirection.h.

References deltaR(), and alignCSCRings::e.

37  {
38  if ( this == &d2 ) return true;
39  if ( deltaR(d2) < 1.e-4) return true;
40  return false;
41  }
double deltaR(const Direction &dir2) const
double reco::isodeposit::Direction::phi ( ) const
inline
std::string reco::isodeposit::Direction::print ( void  ) const
inline

Definition at line 67 of file IsoDepositDirection.h.

References theEta, and thePhi.

Referenced by reco::IsoDeposit::print().

67  {
68  std::ostringstream str;
69  str<<" (Eta="<<theEta<< "," << "Phi=" <<thePhi<<")";
70  return str.str();
71  }
double reco::isodeposit::Direction::theta ( ) const
inline

Definition at line 35 of file IsoDepositDirection.h.

References theEta.

35 { return acos(tanh(theEta)); }

Member Data Documentation

float reco::isodeposit::Direction::theEta
private

Definition at line 74 of file IsoDepositDirection.h.

Referenced by eta(), operator+(), operator-(), print(), and theta().

float reco::isodeposit::Direction::thePhi
private

Definition at line 75 of file IsoDepositDirection.h.

Referenced by Direction(), operator+(), operator-(), phi(), and print().