CMS 3D CMS Logo

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

Member Function Documentation

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

Definition at line 46 of file IsoDepositDirection.h.

References reco::deltaR().

Referenced by reco::IsoDeposit::algoWithin(), egammaisolation::EgammaTrackExtractor::deposit(), reco::IsoDeposit::depositAndCountWithin(), and reco::IsoDeposit::nearestDR().

46  {
47  return reco::deltaR(*this, dir2);
48  }
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:28
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  }
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
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
bool reco::isodeposit::Direction::operator== ( const Direction d2)
inline

Definition at line 37 of file IsoDepositDirection.h.

References reco::isodeposit::Direction::Distance::deltaR, and MillePedeFileConverter_cfg::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 str, theEta, and thePhi.

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

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

Definition at line 35 of file IsoDepositDirection.h.

References theEta.

Referenced by Tau.Tau::zImpact().

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().