ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
TrigGepPerf
TrigGepPerf
WTACone2PassMaker.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef WTACone2PassMaker_h
6
#define WTACone2PassMaker_h
7
8
#include <iostream>
9
#include <algorithm>
10
#include <map>
11
#include "
./WTAConeMaker.h
"
// Use the parent class
12
13
class
WTACone2PassMaker
:
public
WTAConeMaker
{
// The 2Pass maker class
14
// Stage1. Reading the input cell towers as they come, et sorted SeedList as result
15
// Stage2. Do the SeedCleaning, critical to have the SeedList et sorted
16
// Stage3. Do the tower>Seed clustering in WTA scheme(Jet eta,phi = seed eta,phi)
17
public
:
18
WTACone2PassMaker
(
unsigned
int
RollOffBufferSize = 155)
19
:
WTAConeMaker
(),
// Calls WTAConeMaker constructor
20
m_RollOffBufferSize
(RollOffBufferSize)
// Initialize with infinite RollOffBufferSize
21
{};
// Constructor
22
~WTACone2PassMaker
() {};
// Destructor
23
24
void
FillLists
(
const
std::vector<WTATrigObj>& InputTowers)
override
;
// Overwrite the WTAConeMaker::FillLists()
25
void
SeedCleaning
()
override
;
// Overwrite the WTAConeMaker::SeedCleaning()
26
void
MergeConstsToSeeds
()
override
;
// Overwrite the WTAConeMaker::MergeConstsToSeeds()
27
void
SetRollOffBufferSize
(
int
rolloff_buffersize){
m_RollOffBufferSize
= rolloff_buffersize;}
28
int
GetRollOffBufferSize
(){
return
m_RollOffBufferSize
;}
29
30
const
std::vector<WTATrigObj>&
GetRollOffList
()
const
{
return
m_RollOffList
;};
// Access the RollOffList
31
32
private
:
33
std::vector<WTATrigObj>
m_RollOffList
;
// For 2-Pass
34
unsigned
int
m_RollOffBufferSize
;
// For 2-Pass
35
};
36
37
inline
void
WTACone2PassMaker::FillLists
(
const
std::vector<WTATrigObj>& InputTowers)
// 2Pass FillLists()
38
{
39
m_ConstituentList
.clear();
m_SeedSortingList
.clear();
m_RollOffList
.clear();
40
const
unsigned
int
MaxSeedSortingN =
m_WTAConeMakerParameter
.GetMaxSeedSortingN();
41
const
unsigned
int
MaxConstN =
m_WTAConeMakerParameter
.GetMaxConstN();
42
for
(
const
auto
& tower: InputTowers)
43
{
44
if
(tower.pt() <
m_WTAConeMakerParameter
.GetConstEtCut())
continue
;
// Skip Et < 2GeV
45
if
(tower.pt() >=
m_WTAConeMakerParameter
.GetSeedEtCut())
// Harmonize >=
46
{
47
m_SeedSortingList
.insert(
m_SeedSortingList
.begin(), tower);
// Insert incoming tower at the beginning of the sorting list
48
SortByPt
(
m_SeedSortingList
);
// Do et-sorting as tower comes in, definition of 2-Pass, using std::stable_sort()
49
while
(
m_SeedSortingList
.size() > MaxSeedSortingN)
// It only runs when m_SeedSortingList.size() = m_MaxSeedSortingN + 1 though
50
{
51
m_RollOffList
.push_back(
m_SeedSortingList
.back());
// Then, Fill the Roll-Off list
52
m_SeedSortingList
.pop_back();
// Discard the 51st seed tower
53
}
54
}
55
else
m_ConstituentList
.push_back(tower);
// Always put soft tower at the back of the m_ConstituentList
56
}
57
if
(
m_ConstituentList
.size() > MaxConstN)
m_ConstituentList
.resize(MaxConstN);
// Truncate the Constituent list
58
if
(
m_RollOffList
.size() >
m_RollOffBufferSize
)
m_RollOffList
.resize(
m_RollOffBufferSize
);
// Truncate the Roll-Off list
59
}
60
61
inline
void
WTACone2PassMaker::SeedCleaning
()
// 2Pass
62
{
63
m_SeedList
.clear();
64
if
(
m_DEBUG
)std::cout <<
"HighEtMerge2Pass Seed Cleaning......"
<< std::endl;
65
int
seed_N =
m_SeedSortingList
.size();
// Default: Max 50
66
for
(
int
i = 0; i < seed_N; i++){
67
WTATrigObj
seed =
m_SeedSortingList
.at(i);
68
unsigned
int
jet_N =
m_SeedList
.size();
69
if
(jet_N == 0)
m_SeedList
.push_back(
WTATrigObjToWTAJet
(seed));
// Take first seed as jet
70
else
71
{
72
int
MaxPtIndex = -1;
// MaxPtIndex will be -1 in 2Pass by construction, et-sorted m_SeedSortingList
73
std::vector<int> associate_bit =
GetAssociateBits
(seed, MaxPtIndex);
// Associate_bit filling done
74
if
(std::find(associate_bit.begin(), associate_bit.end(), 1) != associate_bit.end())
75
{
// When there is at least one association between incoming tower vs existing seeds
76
for
(
unsigned
int
j = 0; j < jet_N; j++)
// Read high-et seed first
77
{
78
if
(associate_bit.at(j) == 1)
79
{
80
m_SeedList
.at(j).MergeConstituent(seed);
81
break
;
// Done, move to the next tower-object
82
}
83
}
84
}
85
else
86
{
// No Association
87
if
(jet_N <
m_WTAConeMakerParameter
.GetMaxSeedN())
// There is a slot in the seed list
88
{
89
m_SeedList
.push_back(
WTATrigObjToWTAJet
(seed));
// Insert seed-object to the end of the seed list
90
}
// Discard if there is no open slot in the seed list
91
}
92
}
// Main loop
93
// No need to pt sort the SeedList. It is sorted by construction
94
// No need to resize the SeedList. Only insert the seed-object if(jet_n < m_MaxSeedN)
95
if
(
m_VERBOSE
)
PrintSeedList
();
// Print SeedList, for debug
96
}
// seed loop
97
if
(
m_DEBUG
){
98
PrintSeedList
();
99
std::cout <<
"HighEtMerge2Pass Seed Cleaning Done......"
<< std::endl;
100
}
101
}
102
103
inline
void
WTACone2PassMaker::MergeConstsToSeeds
()
104
{
105
if
(
m_RollOffList
.size() > 0)
106
{
107
for
(
const
auto
& off_seed:
m_RollOffList
)
InsertToConstList
(off_seed);
// m_AddConstFirst is true by default
108
}
109
for
(
auto
constituent:
m_ConstituentList
)
110
{
111
for
(
unsigned
int
j = 0; j <
m_SeedList
.size(); j++)
// Assume Jets are pT sorted, WTA means more energetic jet eats constituent first
112
{
113
if
(constituent.IsAssocdR(
m_SeedList
.at(j),
m_WTAConeMakerParameter
.GetJet_dR()))
// Thistime, the condition is m_Jet_dR, the usual R_PAR
114
{
115
m_SeedList
.at(j).MergeConstituent(constituent);
116
ResizeThisJetConstituents
(
m_SeedList
.at(j));
// Check JetConstituent N
117
break
;
// Break the jet loop, move to the next constituent
118
}
119
}
120
}
121
}
122
123
#endif
WTAConeMaker.h
SortByPt
static void SortByPt(std::vector< T > &list)
Definition
WTAObject.h:16
WTACone2PassMaker::m_RollOffList
std::vector< WTATrigObj > m_RollOffList
Definition
WTACone2PassMaker.h:33
WTACone2PassMaker::SetRollOffBufferSize
void SetRollOffBufferSize(int rolloff_buffersize)
Definition
WTACone2PassMaker.h:27
WTACone2PassMaker::MergeConstsToSeeds
void MergeConstsToSeeds() override
Definition
WTACone2PassMaker.h:103
WTACone2PassMaker::SeedCleaning
void SeedCleaning() override
Definition
WTACone2PassMaker.h:61
WTACone2PassMaker::~WTACone2PassMaker
~WTACone2PassMaker()
Definition
WTACone2PassMaker.h:22
WTACone2PassMaker::GetRollOffList
const std::vector< WTATrigObj > & GetRollOffList() const
Definition
WTACone2PassMaker.h:30
WTACone2PassMaker::m_RollOffBufferSize
unsigned int m_RollOffBufferSize
Definition
WTACone2PassMaker.h:34
WTACone2PassMaker::FillLists
void FillLists(const std::vector< WTATrigObj > &InputTowers) override
Definition
WTACone2PassMaker.h:37
WTACone2PassMaker::WTACone2PassMaker
WTACone2PassMaker(unsigned int RollOffBufferSize=155)
Definition
WTACone2PassMaker.h:18
WTACone2PassMaker::GetRollOffBufferSize
int GetRollOffBufferSize()
Definition
WTACone2PassMaker.h:28
WTAConeMaker::ResizeThisJetConstituents
void ResizeThisJetConstituents(WTAJet &jet)
Definition
WTAConeMaker.h:185
WTAConeMaker::m_SeedList
std::vector< WTAJet > m_SeedList
Definition
WTAConeMaker.h:100
WTAConeMaker::WTAConeMaker
WTAConeMaker(bool debug=false, bool verbose=false)
Definition
WTAConeMaker.h:61
WTAConeMaker::m_VERBOSE
bool m_VERBOSE
Definition
WTAConeMaker.h:103
WTAConeMaker::m_WTAConeMakerParameter
WTAParameters m_WTAConeMakerParameter
Definition
WTAConeMaker.h:95
WTAConeMaker::InsertToConstList
void InsertToConstList(const WTATrigObj &obj)
Definition
WTAConeMaker.h:167
WTAConeMaker::GetAssociateBits
std::vector< int > GetAssociateBits(WTATrigObj incoming_seed, int &max_pt_index)
Definition
WTAConeMaker.h:216
WTAConeMaker::m_DEBUG
bool m_DEBUG
Definition
WTAConeMaker.h:102
WTAConeMaker::m_SeedSortingList
std::vector< WTATrigObj > m_SeedSortingList
Definition
WTAConeMaker.h:99
WTAConeMaker::m_ConstituentList
std::vector< WTATrigObj > m_ConstituentList
Definition
WTAConeMaker.h:98
WTAConeMaker::WTATrigObjToWTAJet
WTAJet WTATrigObjToWTAJet(const WTATrigObj &obj)
Definition
WTAConeMaker.h:204
WTAConeMaker::PrintSeedList
void PrintSeedList()
Definition
WTAConeMaker.h:155
WTATrigObj
Definition
WTAObject.h:26
Generated on
for ATLAS Offline Software by
1.17.0