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.

References M_PI, and thePhi.

Referenced by operator+().

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  };
#define M_PI

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

Definition at line 46 of file IsoDepositDirection.h.

References reco::deltaR2(), and L1TDiffHarvesting_cfi::dir2.

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

46 { return reco::deltaR2(*this, dir2); }
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16

◆ 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.

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

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

◆ operator-()

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

Definition at line 49 of file IsoDepositDirection.h.

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

49  {
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  }
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
double deltaR(const Direction &dir2) const

◆ operator==()

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

Definition at line 38 of file IsoDepositDirection.h.

References deltaR(), and MillePedeFileConverter_cfg::e.

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

◆ 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.

References str, theEta, and thePhi.

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

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

◆ theta()

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

Definition at line 36 of file IsoDepositDirection.h.

References nnet::tanh(), and theEta.

Referenced by Tau.Tau::zImpact().

36 { return acos(tanh(theEta)); }
void tanh(data_T data[CONFIG_T::n_in], res_T res[CONFIG_T::n_in])

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