ATLAS Offline Software
Loading...
Searching...
No Matches
WTATrigObj Class Reference

#include <WTAObject.h>

Inheritance diagram for WTATrigObj:
Collaboration diagram for WTATrigObj:

Public Member Functions

 WTATrigObj (pt_t pt=0, eta_t eta=0, phi_t phi=0, m_t m=0, int idx=-99)
pt_t pt () const
void pt (pt_t pt)
eta_t eta () const
void eta (eta_t eta)
phi_t phi () const
void phi (phi_t phi)
m_t m () const
void m (m_t m)
int idx () const
void idx (int idx)
phi_t d_phi_MPI_PI (const WTATrigObj &o2) const
eta_t d_eta (const WTATrigObj &o2) const
bool IsAssocdR (WTATrigObj &tower, tech_t dr)
WTATrigObj operator+ (const WTATrigObj &obj)

Private Attributes

pt_t m_pt
eta_t m_eta
phi_t m_phi
m_t m_m
int m_idx

Friends

bool operator< (const WTATrigObj &o1, const WTATrigObj &o2)
bool operator> (const WTATrigObj &o1, const WTATrigObj &o2)
bool operator<= (const WTATrigObj &o1, const WTATrigObj &o2)
bool operator>= (const WTATrigObj &o1, const WTATrigObj &o2)

Detailed Description

Definition at line 26 of file WTAObject.h.

Constructor & Destructor Documentation

◆ WTATrigObj()

WTATrigObj::WTATrigObj ( pt_t pt = 0,
eta_t eta = 0,
phi_t phi = 0,
m_t m = 0,
int idx = -99 )
inline

Definition at line 28 of file WTAObject.h.

29 : m_pt(pt), m_eta(eta), m_phi(phi), m_m(m), m_idx(idx){}; // Constructor
eta_t eta() const
Definition WTAObject.h:33
phi_t phi() const
Definition WTAObject.h:35
pt_t pt() const
Definition WTAObject.h:31
int idx() const
Definition WTAObject.h:39
eta_t m_eta
Definition WTAObject.h:67
pt_t m_pt
Definition WTAObject.h:66
m_t m() const
Definition WTAObject.h:37
phi_t m_phi
Definition WTAObject.h:68

Member Function Documentation

◆ d_eta()

eta_t WTATrigObj::d_eta ( const WTATrigObj & o2) const
inline

Definition at line 46 of file WTAObject.h.

46{eta_t tmp = m_eta - o2.eta(); return tmp;}

◆ d_phi_MPI_PI()

phi_t WTATrigObj::d_phi_MPI_PI ( const WTATrigObj & o2) const
inline

Definition at line 90 of file WTAObject.h.

91{
92 phi_t tmp;
93 if (m_phi >= o2.phi()){
94 tmp = m_phi - o2.phi();
95 } else {
96 tmp = o2.phi() - m_phi;
97 }
98
99 // Wrap difference to [-32, +31]
100 if (tmp < -HALF_PHI_LEN) tmp = tmp + PHI_LEN;
101 else if (tmp >= HALF_PHI_LEN) tmp = tmp - PHI_LEN;
102
103 return tmp;
104}

◆ eta() [1/2]

eta_t WTATrigObj::eta ( ) const
inline

Definition at line 33 of file WTAObject.h.

33{return m_eta;};

◆ eta() [2/2]

void WTATrigObj::eta ( eta_t eta)
inline

Definition at line 34 of file WTAObject.h.

34{m_eta = eta;};

◆ idx() [1/2]

int WTATrigObj::idx ( ) const
inline

Definition at line 39 of file WTAObject.h.

39{return m_idx;};

◆ idx() [2/2]

void WTATrigObj::idx ( int idx)
inline

Definition at line 40 of file WTAObject.h.

40{m_idx = idx;};

◆ IsAssocdR()

bool WTATrigObj::IsAssocdR ( WTATrigObj & tower,
tech_t dr )
inline

Definition at line 115 of file WTAObject.h.

115 {
116 assert(tower.eta() >= 0 && "Input tower.eta() must be non-negative");
117 assert(tower.phi() >= 0 && "Input tower.phi() must be non-negative");
118 assert(dr >= 0 && "Input dr must be non-negative");
119 eta_t d_eta = this->eta() > tower.eta() ? this->d_eta(tower) : tower.d_eta(*this); // ensure positive d_eta d_phi
120 phi_t raw_dphi = abs(int32_t(this->phi()) - int32_t(tower.phi()));
121 phi_t d_phi = std::min(raw_dphi, PHI_LEN - raw_dphi);
122 bool assoc = false;
123 for (unsigned int i = 0; i <= dr; i++){
124 unsigned int max_j = sqrt(static_cast<double>(dr*dr - i*i)); // Need to be careful with the sqrt
125 for(unsigned int j = 0; j <= max_j; j++){
126 if(d_eta <= i && d_phi <= j){
127 assoc = true;
128 break;
129 }
130 }
131 }
132 return assoc;
133}
eta_t d_eta(const WTATrigObj &o2) const
Definition WTAObject.h:46
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)

◆ m() [1/2]

m_t WTATrigObj::m ( ) const
inline

Definition at line 37 of file WTAObject.h.

37{return m_m;};

◆ m() [2/2]

void WTATrigObj::m ( m_t m)
inline

Definition at line 38 of file WTAObject.h.

38{m_m = m;};

◆ operator+()

WTATrigObj WTATrigObj::operator+ ( const WTATrigObj & obj)
inline

Definition at line 56 of file WTAObject.h.

56 {
57 WTATrigObj new_obj;
58 new_obj.m_pt = this->pt() + obj.pt(); // Current default is the scalar sum, WTA
59 new_obj.m_eta = this->eta();
60 new_obj.m_phi = this->phi();
61 new_obj.m_m = this->m();
62 return new_obj;
63 };
WTATrigObj(pt_t pt=0, eta_t eta=0, phi_t phi=0, m_t m=0, int idx=-99)
Definition WTAObject.h:28

◆ phi() [1/2]

phi_t WTATrigObj::phi ( ) const
inline

Definition at line 35 of file WTAObject.h.

35{return m_phi;};

◆ phi() [2/2]

void WTATrigObj::phi ( phi_t phi)
inline

Definition at line 36 of file WTAObject.h.

36{m_phi = phi;};

◆ pt() [1/2]

pt_t WTATrigObj::pt ( ) const
inline

Definition at line 31 of file WTAObject.h.

31{return m_pt;};

◆ pt() [2/2]

void WTATrigObj::pt ( pt_t pt)
inline

Definition at line 32 of file WTAObject.h.

32{m_pt = pt;};

◆ operator<

bool operator< ( const WTATrigObj & o1,
const WTATrigObj & o2 )
friend

Definition at line 50 of file WTAObject.h.

50{ return o1.pt() < o2.pt(); }; // Call .pt(), not directly access private m_pt

◆ operator<=

bool operator<= ( const WTATrigObj & o1,
const WTATrigObj & o2 )
friend

Definition at line 52 of file WTAObject.h.

52{ return o1.pt() <= o2.pt(); };

◆ operator>

bool operator> ( const WTATrigObj & o1,
const WTATrigObj & o2 )
friend

Definition at line 51 of file WTAObject.h.

51{ return o1.pt() > o2.pt(); };

◆ operator>=

bool operator>= ( const WTATrigObj & o1,
const WTATrigObj & o2 )
friend

Definition at line 53 of file WTAObject.h.

53{ return o1.pt() >= o2.pt(); };

Member Data Documentation

◆ m_eta

eta_t WTATrigObj::m_eta
private

Definition at line 67 of file WTAObject.h.

◆ m_idx

int WTATrigObj::m_idx
private

Definition at line 70 of file WTAObject.h.

◆ m_m

m_t WTATrigObj::m_m
private

Definition at line 69 of file WTAObject.h.

◆ m_phi

phi_t WTATrigObj::m_phi
private

Definition at line 68 of file WTAObject.h.

◆ m_pt

pt_t WTATrigObj::m_pt
private

Definition at line 66 of file WTAObject.h.


The documentation for this class was generated from the following file: