4#ifndef WTAConeParallelHelper_h
5#define WTAConeParallelHelper_h
14#ifdef BITWISE_SIMULATION
16const IntOrFloat ETA_MIN = 0;
17const IntOrFloat ETA_MAX = 99;
18const IntOrFloat ETA_LEN = 100;
19const IntOrFloat PHI_MIN = 0;
20const IntOrFloat PHI_MAX = 63;
21const IntOrFloat PHI_LEN = 64;
22const IntOrFloat CORE_DIST = 8;
23#elif defined(FLOATING_POINT_SIMULATION)
25const IntOrFloat ETA_MIN = -2.5;
26const IntOrFloat ETA_MAX = 2.5;
27const IntOrFloat ETA_LEN = 5.0;
28const IntOrFloat PHI_MIN = -
PI;
29const IntOrFloat PHI_MAX =
PI;
30const IntOrFloat PHI_LEN = 2 *
PI;
31const IntOrFloat CORE_DIST = 0.8;
33#error "Simulation type not defined. Define either BITWISE_SIMULATION or FLOATING_POINT_SIMULATION."
47 void CreateBlocks(
const std::vector<WTATrigObj>& all_towers);
49 template<
typename WTAClassType>
66 for(
unsigned int i = 0; i <
m_BlockN; i++)
86 IntOrFloat this_eta = tower.
eta();
87 inside = (this_eta >=
min) && (this_eta <
max);
94 if(min_wrap <= max_wrap){
95 inside = (this_phi >= min_wrap) && (this_phi < max_wrap);
98 inside = !((this_phi >= max_wrap) && (this_phi < min_wrap));
106 IntOrFloat BlockLow = -99;
107 IntOrFloat BlockHigh = -99;
108 const unsigned tower_n = all_towers.size();
109 for(
unsigned int i = 0; i <
m_BlockN; i++)
113 BlockLow = ETA_MIN - CORE_DIST + i * (float)(ETA_LEN /
m_BlockN);
114 BlockHigh = ETA_MAX + CORE_DIST - (
m_BlockN - 1 - i) * (
float)(ETA_LEN /
m_BlockN);
118 BlockLow = PHI_MIN - CORE_DIST + i * (float)(PHI_LEN /
m_BlockN);
119 BlockHigh = PHI_MAX + CORE_DIST - (
m_BlockN - 1 - i) * (
float)(PHI_LEN /
m_BlockN);
121 for(
unsigned int t = 0; t < tower_n; t++)
133template<
typename WTAClassType>
136 for(
unsigned int i = 0; i <
m_BlockN; i++)
139 MyWTAMakerClass->SeedCleaning();
140 MyWTAMakerClass->MergeConstsToSeeds();
147 IntOrFloat BlockLow = -99;
148 IntOrFloat BlockHigh = -99;
149 std::vector<WTAJet> all_jets;
150 for(
unsigned int i = 0; i <
m_BlockN; i++)
154 BlockLow = ETA_MIN + i * (float)(ETA_LEN /
m_BlockN);
159 BlockLow = PHI_MIN + i * (float)(PHI_LEN /
m_BlockN);
165 for(
int j = this_block_jet_n - 1; j >= 0; j--)
176 std::vector<WTAJet> all_jets;
177 for(
unsigned int i = 0; i <
m_BlockN; i++)
Scalar phi() const
phi method
static void SortByPt(std::vector< T > &list)
std::vector< WTAJet > GetAllJets()
IntOrFloat PhiWrap(IntOrFloat phi)
std::vector< std::vector< WTAJet > > m_OutputJetsPerBlock
void RunParallelWTA(std::unique_ptr< WTAClassType > &AnyWTAClass)
WTAConeParallelHelper(unsigned int block_n=1)
void CreateBlocks(const std::vector< WTATrigObj > &all_towers)
bool CheckInsideRegion(const WTATrigObj &tower, IntOrFloat min, IntOrFloat max)
void SetBlockN(unsigned int block_n)
std::vector< std::vector< WTATrigObj > > m_InputTowersPerBlock
void SetDivideByEta(bool divide_by_eta)