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

#include <WTAObject.h>

Inheritance diagram for WTAJet:
Collaboration diagram for WTAJet:

Public Member Functions

 WTAJet (pt_t pt=0, eta_t eta=0, phi_t phi=0, m_t m=0, int idx=-99, tech_t jet_dr=R_PAR)
const WTATrigObjGetSeed () const
void MergeConstituent (WTATrigObj &tower)
void MergeConstituent (WTATrigObj *tower)
void MergeWTAJet (WTAJet &targetjet)
void PopOutLastConstituent ()
const std::vector< WTATrigObj > & GetConstituentList () const
tobn_t GetConstituentCount () const
unsigned int GetRingN (const WTATrigObj &tower) const
void CreateERingInfo ()
void PrintERingInfo () const
const WTA4JetERingInfoGetERingInfo () const
void SetERingInfo (const WTA4JetERingInfo &ering_info)
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

WTATrigObj m_Seed
std::vector< WTATrigObjm_ConstituentList
tech_t m_jet_dr
unsigned int m_ring_n
WTA4JetERingInfo m_ERingInfo
pt_t m_pt
eta_t m_eta
phi_t m_phi
m_t m_m
int m_idx

Detailed Description

Definition at line 150 of file WTAObject.h.

Constructor & Destructor Documentation

◆ WTAJet()

WTAJet::WTAJet ( pt_t pt = 0,
eta_t eta = 0,
phi_t phi = 0,
m_t m = 0,
int idx = -99,
tech_t jet_dr = R_PAR )
inline

Definition at line 152 of file WTAObject.h.

152 :
153 WTATrigObj(pt, eta, phi, m, idx) {
154 m_Seed = WTATrigObj(pt, eta, phi, m, idx);
155 m_jet_dr = jet_dr;
156 m_ConstituentList.clear();
157 m_ConstituentList.push_back(m_Seed);
158 #ifdef FLOATING_POINT_SIMULATION
159 m_ring_n = static_cast<unsigned int>(jet_dr / 0.1);
160 #else
161 m_ring_n = jet_dr;
162 #endif
163 };
WTATrigObj m_Seed
Definition WTAObject.h:180
tech_t m_jet_dr
Definition WTAObject.h:182
unsigned int m_ring_n
Definition WTAObject.h:183
std::vector< WTATrigObj > m_ConstituentList
Definition WTAObject.h:181
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
m_t m() const
Definition WTAObject.h:37
WTATrigObj(pt_t pt=0, eta_t eta=0, phi_t phi=0, m_t m=0, int idx=-99)
Definition WTAObject.h:28

Member Function Documentation

◆ CreateERingInfo()

void WTAJet::CreateERingInfo ( )
inline

Definition at line 240 of file WTAObject.h.

240 {
241 // This function is ideally called after all jet clustering is done
242
243 // Check if the constituent list is empty
244 if(m_ConstituentList.empty()){
245 std::cerr << "Error: Constituent list is empty. Cannot create ERingInfo." << std::endl;
246 return;
247 }
248
249 // Reset the ERingInfo
250 WTA4JetERingInfo ering_info;
251 m_ERingInfo = ering_info;
252
253 for(const auto& tower:m_ConstituentList){
254 unsigned int ring_n = this->GetRingN(tower);
255 m_ERingInfo.total_TobN = m_ERingInfo.total_TobN + 1;
256 switch(ring_n){
257 case 0:
258 m_ERingInfo.ring0_Et = m_ERingInfo.ring0_Et + tower.pt();
259 m_ERingInfo.ring0_TobN = m_ERingInfo.ring0_TobN + 1;
260 break;
261 case 1:
262 m_ERingInfo.ring1_Et = m_ERingInfo.ring1_Et + tower.pt();
263 m_ERingInfo.ring1_TobN = m_ERingInfo.ring1_TobN + 1;
264 break;
265 case 2:
266 m_ERingInfo.ring2_Et = m_ERingInfo.ring2_Et + tower.pt();
267 m_ERingInfo.ring2_TobN = m_ERingInfo.ring2_TobN + 1;
268 break;
269 case 3:
270 m_ERingInfo.ring3_Et = m_ERingInfo.ring3_Et + tower.pt();
271 m_ERingInfo.ring3_TobN = m_ERingInfo.ring3_TobN + 1;
272 break;
273 case 4:
274 m_ERingInfo.ring4_Et = m_ERingInfo.ring4_Et + tower.pt();
275 m_ERingInfo.ring4_TobN = m_ERingInfo.ring4_TobN + 1;
276 break;
277 default:
278 break;
279 }
280 }
281}
WTA4JetERingInfo m_ERingInfo
Definition WTAObject.h:184
unsigned int GetRingN(const WTATrigObj &tower) const
Definition WTAObject.h:231

◆ d_eta()

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

Definition at line 46 of file WTAObject.h.

46{eta_t tmp = m_eta - o2.eta(); return tmp;}
eta_t m_eta
Definition WTAObject.h:67

◆ d_phi_MPI_PI()

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

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}
phi_t m_phi
Definition WTAObject.h:68

◆ eta() [1/2]

eta_t WTATrigObj::eta ( ) const
inlineinherited

Definition at line 33 of file WTAObject.h.

33{return m_eta;};

◆ eta() [2/2]

void WTATrigObj::eta ( eta_t eta)
inlineinherited

Definition at line 34 of file WTAObject.h.

34{m_eta = eta;};

◆ GetConstituentCount()

tobn_t WTAJet::GetConstituentCount ( ) const
inline

Definition at line 171 of file WTAObject.h.

171{return static_cast<tobn_t>(m_ConstituentList.size());}; // Match the type

◆ GetConstituentList()

const std::vector< WTATrigObj > & WTAJet::GetConstituentList ( ) const
inline

Definition at line 170 of file WTAObject.h.

170{return m_ConstituentList;};

◆ GetERingInfo()

const WTA4JetERingInfo & WTAJet::GetERingInfo ( ) const
inline

Definition at line 176 of file WTAObject.h.

176{return m_ERingInfo;};

◆ GetRingN()

unsigned int WTAJet::GetRingN ( const WTATrigObj & tower) const
inline

Definition at line 231 of file WTAObject.h.

231 {
232 eta_t d_eta = this->eta() > tower.eta() ? this->d_eta(tower) : tower.d_eta(*this); // ensure positive d_eta d_phi
233 phi_t raw_dphi = abs(int32_t(this->phi()) - int32_t(tower.phi()));
234 phi_t d_phi = std::min(raw_dphi, PHI_LEN - raw_dphi);
235 unsigned int ring_n = std::max(d_eta, static_cast<eta_t>(d_phi)); // No .raw() in long long int
236 return ring_n;
237}
eta_t d_eta(const WTATrigObj &o2) const
Definition WTAObject.h:46

◆ GetSeed()

const WTATrigObj & WTAJet::GetSeed ( ) const
inline

Definition at line 165 of file WTAObject.h.

165{return m_Seed;};

◆ idx() [1/2]

int WTATrigObj::idx ( ) const
inlineinherited

Definition at line 39 of file WTAObject.h.

39{return m_idx;};

◆ idx() [2/2]

void WTATrigObj::idx ( int idx)
inlineinherited

Definition at line 40 of file WTAObject.h.

40{m_idx = idx;};

◆ IsAssocdR()

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

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}
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)

◆ m() [1/2]

m_t WTATrigObj::m ( ) const
inlineinherited

Definition at line 37 of file WTAObject.h.

37{return m_m;};

◆ m() [2/2]

void WTATrigObj::m ( m_t m)
inlineinherited

Definition at line 38 of file WTAObject.h.

38{m_m = m;};

◆ MergeConstituent() [1/2]

void WTAJet::MergeConstituent ( WTATrigObj & tower)
inline

Definition at line 187 of file WTAObject.h.

188{
189 this->pt(this->pt() + tower.pt());// Scalar sum, WTA
190 m_ConstituentList.push_back(tower);
191}

◆ MergeConstituent() [2/2]

void WTAJet::MergeConstituent ( WTATrigObj * tower)
inline

Definition at line 193 of file WTAObject.h.

194{
195 this->pt(this->pt() + tower->pt());// Scalar sum, WTA
196 m_ConstituentList.push_back(*tower);
197}

◆ MergeWTAJet()

void WTAJet::MergeWTAJet ( WTAJet & targetjet)
inline

Definition at line 199 of file WTAObject.h.

200{
201 WTATrigObj tmptower(targetjet.pt(), targetjet.eta(), targetjet.phi(), targetjet.m());
202 this->pt(this->pt() + tmptower.pt()); // Scalar sum, WTA
203 std::vector<WTATrigObj> tmp_const_list = targetjet.GetConstituentList();
204 m_ConstituentList.insert(m_ConstituentList.end(), tmp_const_list.begin(), tmp_const_list.end());
205}
const std::vector< WTATrigObj > & GetConstituentList() const
Definition WTAObject.h:170

◆ operator+()

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

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 };
pt_t m_pt
Definition WTAObject.h:66

◆ phi() [1/2]

phi_t WTATrigObj::phi ( ) const
inlineinherited

Definition at line 35 of file WTAObject.h.

35{return m_phi;};

◆ phi() [2/2]

void WTATrigObj::phi ( phi_t phi)
inlineinherited

Definition at line 36 of file WTAObject.h.

36{m_phi = phi;};

◆ PopOutLastConstituent()

void WTAJet::PopOutLastConstituent ( )
inline

Definition at line 207 of file WTAObject.h.

208{
209 WTATrigObj lastconst = m_ConstituentList.back(); //std::vector::back() returns the last element
210 this->pt(this->pt() - lastconst.pt()); // Scalar subtraction, WTA
211 m_ConstituentList.pop_back(); // Popback the last element
212}

◆ PrintERingInfo()

void WTAJet::PrintERingInfo ( ) const
inline

Definition at line 283 of file WTAObject.h.

283 {
284 std::cout << "WTAJet ERing Info:" << std::endl;
285 std::cout << " Raw Jet Et: " << this->pt() << " , Constituent Count: " << this->GetConstituentCount() << std::endl;
286 std::cout << " Total TobN: " << m_ERingInfo.total_TobN << std::endl;
287 std::cout << " Ring 0: Et = " << m_ERingInfo.ring0_Et << ", TobN = " << m_ERingInfo.ring0_TobN << std::endl;
288 std::cout << " Ring 1: Et = " << m_ERingInfo.ring1_Et << ", TobN = " << m_ERingInfo.ring1_TobN << std::endl;
289 std::cout << " Ring 2: Et = " << m_ERingInfo.ring2_Et << ", TobN = " << m_ERingInfo.ring2_TobN << std::endl;
290 std::cout << " Ring 3: Et = " << m_ERingInfo.ring3_Et << ", TobN = " << m_ERingInfo.ring3_TobN << std::endl;
291 std::cout << " Ring 4: Et = " << m_ERingInfo.ring4_Et << ", TobN = " << m_ERingInfo.ring4_TobN << std::endl;
292}
tobn_t GetConstituentCount() const
Definition WTAObject.h:171

◆ pt() [1/2]

pt_t WTATrigObj::pt ( ) const
inlineinherited

Definition at line 31 of file WTAObject.h.

31{return m_pt;};

◆ pt() [2/2]

void WTATrigObj::pt ( pt_t pt)
inlineinherited

Definition at line 32 of file WTAObject.h.

32{m_pt = pt;};

◆ SetERingInfo()

void WTAJet::SetERingInfo ( const WTA4JetERingInfo & ering_info)
inline

Definition at line 177 of file WTAObject.h.

177{m_ERingInfo = ering_info;}; // When parsing the ref jet, ERingInfo does not get created automatically

Member Data Documentation

◆ m_ConstituentList

std::vector<WTATrigObj> WTAJet::m_ConstituentList
private

Definition at line 181 of file WTAObject.h.

◆ m_ERingInfo

WTA4JetERingInfo WTAJet::m_ERingInfo
private

Definition at line 184 of file WTAObject.h.

◆ m_eta

eta_t WTATrigObj::m_eta
privateinherited

Definition at line 67 of file WTAObject.h.

◆ m_idx

int WTATrigObj::m_idx
privateinherited

Definition at line 70 of file WTAObject.h.

◆ m_jet_dr

tech_t WTAJet::m_jet_dr
private

Definition at line 182 of file WTAObject.h.

◆ m_m

m_t WTATrigObj::m_m
privateinherited

Definition at line 69 of file WTAObject.h.

◆ m_phi

phi_t WTATrigObj::m_phi
privateinherited

Definition at line 68 of file WTAObject.h.

◆ m_pt

pt_t WTATrigObj::m_pt
privateinherited

Definition at line 66 of file WTAObject.h.

◆ m_ring_n

unsigned int WTAJet::m_ring_n
private

Definition at line 183 of file WTAObject.h.

◆ m_Seed

WTATrigObj WTAJet::m_Seed
private

Definition at line 180 of file WTAObject.h.


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