19 [](
const T &
a,
const T &b)
21 return a.pt() > b.pt();
37 m_t
m()
const {
return m_m;};
42#ifdef FLOATING_POINT_SIMULATION
58 new_obj.
m_pt = this->
pt() + obj.
pt();
61 new_obj.
m_m = this->
m();
74#ifdef FLOATING_POINT_SIMULATION
75inline phi_t WTATrigObj::d_phi_0_2PI(
const WTATrigObj& o2)
const
77 phi_t tmp =
m_phi - o2.phi();
78 while(tmp < 0)tmp += 2*
PI;
79 while(tmp > 2*
PI)tmp -= 2*
PI;
93 if (
m_phi >= o2.phi()){
94 tmp =
m_phi - o2.phi();
96 tmp = o2.phi() -
m_phi;
100 if (tmp < -HALF_PHI_LEN) tmp = tmp + PHI_LEN;
101 else if (tmp >= HALF_PHI_LEN) tmp = tmp - PHI_LEN;
107#ifdef FLOATING_POINT_SIMULATION
111 bool assoc = (dr*dr) >= (
d_eta*
d_eta + d_phi*d_phi);
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");
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);
123 for (
unsigned int i = 0; i <= dr; i++){
124 unsigned int max_j = sqrt(
static_cast<double>(dr*dr - i*i));
125 for(
unsigned int j = 0; j <= max_j; j++){
126 if(
d_eta <= i && d_phi <= j){
152 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) :
158 #ifdef FLOATING_POINT_SIMULATION
159 m_ring_n =
static_cast<unsigned int>(jet_dr / 0.1);
189 this->
pt(this->
pt() + tower.
pt());
195 this->
pt(this->
pt() + tower->
pt());
202 this->
pt(this->
pt() + tmptower.
pt());
210 this->
pt(this->
pt() - lastconst.
pt());
214#ifdef FLOATING_POINT_SIMULATION
218 tech_t dr = std::sqrt(
d_eta*
d_eta + d_phi*d_phi);
219 unsigned int ring_n =
static_cast<unsigned int>(std::ceil(dr / 0.1));
222#elif defined(BITWISE_SIMULATION)
225 phi_t raw_dphi = abs(int32_t(this->
phi()) - int32_t(tower.
phi()));
226 phi_t d_phi = std::min(raw_dphi, PHI_LEN - raw_dphi);
227 unsigned int ring_n = std::max(
d_eta,
static_cast<eta_t
>(d_phi.raw()));
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));
245 std::cerr <<
"Error: Constituent list is empty. Cannot create ERingInfo." << std::endl;
254 unsigned int ring_n = this->
GetRingN(tower);
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;
static void SortByPt(std::vector< T > &list)
void MergeWTAJet(WTAJet &targetjet)
void PopOutLastConstituent()
WTA4JetERingInfo m_ERingInfo
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)
tobn_t GetConstituentCount() const
unsigned int GetRingN(const WTATrigObj &tower) const
void SetERingInfo(const WTA4JetERingInfo &ering_info)
const std::vector< WTATrigObj > & GetConstituentList() const
const WTATrigObj & GetSeed() const
const WTA4JetERingInfo & GetERingInfo() const
std::vector< WTATrigObj > m_ConstituentList
void MergeConstituent(WTATrigObj &tower)
void PrintERingInfo() const
friend bool operator<(const WTATrigObj &o1, const WTATrigObj &o2)
phi_t d_phi_MPI_PI(const WTATrigObj &o2) const
friend bool operator<=(const WTATrigObj &o1, const WTATrigObj &o2)
bool IsAssocdR(WTATrigObj &tower, tech_t dr)
WTATrigObj operator+(const WTATrigObj &obj)
friend bool operator>=(const WTATrigObj &o1, const WTATrigObj &o2)
WTATrigObj(pt_t pt=0, eta_t eta=0, phi_t phi=0, m_t m=0, int idx=-99)
friend bool operator>(const WTATrigObj &o1, const WTATrigObj &o2)
eta_t d_eta(const WTATrigObj &o2) const
void stable_sort(DataModel_detail::iterator< DVL > beg, DataModel_detail::iterator< DVL > end)
Specialization of stable_sort for DataVector/List.