5#ifndef WTAConeParallelHelper_h
6#define WTAConeParallelHelper_h
43 void CreateBlocks(
const std::vector<WTATrigObj>& all_towers);
48 template<
typename WTAClassType>
88 for(
unsigned int i = 0; i <
m_BlockN; i++)
102#ifdef FLOATING_POINT_SIMULATION
107 T wrapped =
phi % PHI_LEN;
108 if (wrapped < 0) wrapped = wrapped + PHI_LEN;
115 T block_half_width = ETA_LEN / T(
m_BlockN *2);
116 T block_center = ETA_MIN + ETA_LEN / T(
m_BlockN) * iBlock + block_half_width;
118 block_half_width = block_half_width + T(CORE_DIST);
121 T block_min = block_center - block_half_width;
122 T block_max = block_center + block_half_width;
124 return (tower_pos >= block_min) && (tower_pos < block_max);
129 T block_center = PHI_MIN + PHI_LEN / T(
m_BlockN) * iBlock;
130 T block_half_width = PHI_LEN / T(
m_BlockN *2);
132 block_half_width = block_half_width + T(CORE_DIST);
136 T block_min =
PhiWrap(block_center - block_half_width);
137 T block_max =
PhiWrap(block_center + block_half_width);
138 tower_pos =
PhiWrap(tower_pos);
140 if (block_min < block_max) {
141 return (tower_pos >= block_min) && (tower_pos < block_max);
144 return (tower_pos >= block_min) || (tower_pos < block_max);
150 const unsigned tower_n = all_towers.size();
151 for(
unsigned int iBlock = 0; iBlock <
m_BlockN; iBlock++)
155 for(
unsigned int iTower = 0; iTower < tower_n; iTower++)
157 eta_t tower_pos = all_towers.at(iBlock).eta();
164 for(
unsigned int iTower = 0; iTower < tower_n; iTower++)
166 phi_t tower_pos =
PhiWrap(all_towers.at(iTower).phi());
174template<
typename WTAClassType>
177 for(
unsigned int i = 0; i <
m_BlockN; i++)
182 MyWTAMakerClass->SeedCleaning();
184 MyWTAMakerClass->MergeConstsToSeeds();
185 MyWTAMakerClass->CreateERingInfo();
193 std::vector<WTAJet> all_jets;
194 for(
unsigned int iBlock = 0; iBlock <
m_BlockN; iBlock++)
197 if(this_block_jet_n == 0)
continue;
201 for (
int j = this_block_jet_n - 1; j >= 0; j--)
204 eta_t jet_pos =
jet.eta();
211 for (
int j = this_block_jet_n - 1; j >= 0; j--) {
213 phi_t jet_pos =
jet.phi();
223 std::vector<WTAJet> all_jets;
224 for(
unsigned int i = 0; i <
m_BlockN; i++)
230 std::vector<pt_t> duplicated_pt_list;
231 unsigned int cnt = 0;
232 for(
unsigned int i = 0; i < all_jets.size() - 1; i++){
233 pt_t i_pt = all_jets.at(i).pt();
235 if(std::find(duplicated_pt_list.begin(), duplicated_pt_list.end(),i_pt)!= duplicated_pt_list.end())
continue;
236 for(
unsigned int j = i + 1; j < all_jets.size(); j++){
237 pt_t j_pt = all_jets.at(j).pt();
240 if(std::find(duplicated_pt_list.begin(), duplicated_pt_list.end(),i_pt)!= duplicated_pt_list.end())duplicated_pt_list.push_back(i_pt);
Scalar phi() const
phi method
static void SortByPt(std::vector< T > &list)
std::vector< std::vector< WTATrigObj > > m_stage1_seedSortingListPerBlock
std::vector< WTAJet > GetAllJets()
std::vector< std::vector< WTATrigObj > > m_stage1_constituentListPerBlock
std::vector< std::vector< WTAJet > > m_OutputJetsPerBlock
void RunParallelWTA(std::unique_ptr< WTAClassType > &AnyWTAClass)
bool GetStoreAmbiguousJets()
std::vector< WTATrigObj > GetStage1ConstituentListPerBlock(unsigned int iBlock) const
std::vector< WTAJet > GetStage3ConeJetsPerBlock(unsigned int iBlock) const
WTAConeParallelHelper(unsigned int block_n=1)
std::vector< std::vector< WTAJet > > m_stage3_coneJetsPerBlock
bool m_StoreAmbiguousJets
std::vector< WTAJet > GetStage2ConeSeedsPPerBlock(unsigned int iBlock) const
void SetJetN(unsigned int jet_n)
bool CheckInsideRegionEta(T tower_pos, unsigned int iBlock, bool doWithOverlap=false)
T PhiWrap(T phi)
StoreAmbiguousJets.
std::vector< WTATrigObj > GetStage1SeedSortingPerBlock(unsigned int iBlock) const
void CreateBlocks(const std::vector< WTATrigObj > &all_towers)
std::vector< std::vector< WTAJet > > m_stage2_coneSeedsPerBlock
bool CheckInsideRegionPhi(T tower_pos, unsigned int iBlock, bool doWithOverlap=false)
void SetBlockN(unsigned int block_n)
void SetStoreAmbiguousJets(bool store_ambiguous_jets)
std::vector< std::vector< WTATrigObj > > m_InputTowersPerBlock
void SetDivideByEta(bool divide_by_eta)