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

◆ Direction()

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

Definition at line 27 of file IsoDepositDirection.h.

27  : theEta(eta), thePhi(phi) {
28  while (thePhi < 0.0)
29  thePhi += 2 * M_PI;
30  while (thePhi >= 2 * M_PI)
31  thePhi -= 2 * M_PI;
32  };

References M_PI, and thePhi.

Referenced by operator+().

Member Function Documentation

◆ deltaR()

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

◆ deltaR2()

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

◆ eta()

double reco::isodeposit::Direction::eta ( ) const
inline

◆ operator+()

Direction reco::isodeposit::Direction::operator+ ( const Distance relDir) const
inline

Definition at line 60 of file IsoDepositDirection.h.

60  {
61  double eta = theEta + relDir.deltaR * cos(relDir.relativeAngle);
62  double phi = thePhi + relDir.deltaR * sin(relDir.relativeAngle);
63  return Direction(eta, phi);
64  }

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

◆ operator-()

Distance reco::isodeposit::Direction::operator- ( const Direction dir2) const
inline

Definition at line 49 of file IsoDepositDirection.h.

49  {
50  Distance result;
51  double dR = deltaR(dir2);
52  double dEta = theEta - dir2.eta();
53  double dPhi = reco::deltaPhi(thePhi, dir2.phi());
54 
55  result.relativeAngle = (dR > 1.e-4) ? atan2(dPhi, dEta) : 0.;
56  result.deltaR = dR;
57  return result;
58  }

References reco::deltaPhi(), deltaR(), HLT_FULL_cff::dEta, L1TDiffHarvesting_cfi::dir2, HLT_FULL_cff::dPhi, HGC3DClusterGenMatchSelector_cfi::dR, mps_fire::result, theEta, and thePhi.

◆ operator==()

bool reco::isodeposit::Direction::operator== ( const Direction d2)
inline

Definition at line 38 of file IsoDepositDirection.h.

38  {
39  if (this == &d2)
40  return true;
41  if (deltaR(d2) < 1.e-4)
42  return true;
43  return false;
44  }

References deltaR(), and MillePedeFileConverter_cfg::e.

◆ phi()

double reco::isodeposit::Direction::phi ( ) const
inline

◆ print()

std::string reco::isodeposit::Direction::print ( void  ) const
inline

Definition at line 66 of file IsoDepositDirection.h.

66  {
67  std::ostringstream str;
68  str << " (Eta=" << theEta << ","
69  << "Phi=" << thePhi << ")";
70  return str.str();
71  }

References str, theEta, and thePhi.

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

◆ theta()

double reco::isodeposit::Direction::theta ( ) const
inline

Definition at line 36 of file IsoDepositDirection.h.

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

References theEta.

Referenced by Tau.Tau::zImpact().

Member Data Documentation

◆ theEta

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

Definition at line 74 of file IsoDepositDirection.h.

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

◆ thePhi

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

Definition at line 75 of file IsoDepositDirection.h.

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

L1TDiffHarvesting_cfi.dir2
dir2
Definition: L1TDiffHarvesting_cfi.py:12
reco::deltaPhi
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
reco::isodeposit::Direction::eta
double eta() const
Definition: IsoDepositDirection.h:34
HLT_FULL_cff.dPhi
dPhi
Definition: HLT_FULL_cff.py:13703
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
reco::isodeposit::Direction::theEta
float theEta
Definition: IsoDepositDirection.h:74
str
#define str(s)
Definition: TestProcessor.cc:52
reco::isodeposit::Direction::deltaR
double deltaR(const Direction &dir2) const
Definition: IsoDepositDirection.h:47
reco::deltaR2
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
reco::isodeposit::Direction::thePhi
float thePhi
Definition: IsoDepositDirection.h:75
HLT_FULL_cff.dEta
dEta
Definition: HLT_FULL_cff.py:13702
reco::deltaR
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
mps_fire.result
result
Definition: mps_fire.py:311
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition: HGC3DClusterGenMatchSelector_cfi.py:7
reco::isodeposit::Direction::Direction
Direction(double eta=0., double phi=0.)
Definition: IsoDepositDirection.h:27
reco::isodeposit::Direction::phi
double phi() const
Definition: IsoDepositDirection.h:35
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37