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

#include <WTACone2PassMaker.h>

Inheritance diagram for WTACone2PassMaker:
Collaboration diagram for WTACone2PassMaker:

Public Member Functions

 WTACone2PassMaker (unsigned int RollOffBufferSize=155)
 ~WTACone2PassMaker ()
void FillLists (const std::vector< WTATrigObj > &InputTowers) override
void SeedCleaning () override
void MergeConstsToSeeds () override
void SetRollOffBufferSize (int rolloff_buffersize)
int GetRollOffBufferSize ()
const std::vector< WTATrigObj > & GetRollOffList () const
void ResizeConstituentList ()
void ResizeSeedSortingList ()
void ResizeSeedList ()
void ResizeSeedNConstLists ()
void ResizeThisJetConstituents (WTAJet &jet)
void ClearLists ()
void PrintSeedList ()
WTAJet WTATrigObjToWTAJet (const WTATrigObj &obj)
WTATrigObj WTAJetToWTATrigObj (const WTAJet &jet)
const std::vector< WTATrigObj > & GetConstituentList () const
const std::vector< WTATrigObj > & GetSeedSortingList () const
const std::vector< WTAJet > & GetSeedList () const
std::vector< int > GetAssociateBits (WTATrigObj incoming_seed, int &max_pt_index)
std::vector< WTATrigObjLoadInputs (const std::vector< IntOrFloat > &ptVec, const std::vector< IntOrFloat > &etaVec, const std::vector< IntOrFloat > &phiVec, const std::vector< IntOrFloat > &mVec)
void InitiateInputs (const std::vector< IntOrFloat > &ptVec, const std::vector< IntOrFloat > &etaVec, const std::vector< IntOrFloat > &phiVec, const std::vector< IntOrFloat > &mVec)
void InitiateInputs (const std::vector< WTATrigObj > &InputTowers)
void InsertToConstList (const WTATrigObj &obj)
void SetDEBUG ()
void SetVERBOSE ()
bool GetDEBUG ()
bool GetVERBOSE ()

Public Attributes

WTAParameters m_WTAConeMakerParameter

Protected Attributes

std::vector< WTATrigObjm_ConstituentList
std::vector< WTATrigObjm_SeedSortingList
std::vector< WTAJetm_SeedList
bool m_DEBUG
bool m_VERBOSE

Private Attributes

std::vector< WTATrigObjm_RollOffList
unsigned int m_RollOffBufferSize

Detailed Description

Definition at line 9 of file WTACone2PassMaker.h.

Constructor & Destructor Documentation

◆ WTACone2PassMaker()

WTACone2PassMaker::WTACone2PassMaker ( unsigned int RollOffBufferSize = 155)
inline

Definition at line 11 of file WTACone2PassMaker.h.

12 : WTAConeMaker(), // Calls WTAConeMaker constructor
13 m_RollOffBufferSize(RollOffBufferSize) // Initialize with infinite RollOffBufferSize
14 {}; // Constructor
unsigned int m_RollOffBufferSize
WTAConeMaker(bool debug=false, bool verbose=false)

◆ ~WTACone2PassMaker()

WTACone2PassMaker::~WTACone2PassMaker ( )
inline

Definition at line 15 of file WTACone2PassMaker.h.

15{}; // Destructor

Member Function Documentation

◆ ClearLists()

void WTAConeMaker::ClearLists ( )
inlineinherited

Definition at line 66 of file WTAConeMaker.h.

66{m_ConstituentList.clear(); m_SeedSortingList.clear(); m_SeedList.clear();};
std::vector< WTAJet > m_SeedList
std::vector< WTATrigObj > m_SeedSortingList
std::vector< WTATrigObj > m_ConstituentList

◆ FillLists()

void WTACone2PassMaker::FillLists ( const std::vector< WTATrigObj > & InputTowers)
inlineoverridevirtual

Reimplemented from WTAConeMaker.

Definition at line 30 of file WTACone2PassMaker.h.

31{
32 m_ConstituentList.clear(); m_SeedSortingList.clear(); m_RollOffList.clear();
33 const unsigned int MaxSeedSortingN = m_WTAConeMakerParameter.GetMaxSeedSortingN();
34 const unsigned int MaxConstN = m_WTAConeMakerParameter.GetMaxConstN();
35 for(const auto& tower: InputTowers)
36 {
37 if(tower.pt() < m_WTAConeMakerParameter.GetConstEtCut())continue; // Skip Et < 2GeV
38 if(tower.pt() >= m_WTAConeMakerParameter.GetSeedEtCut())// Harmonize >=
39 {
40 m_SeedSortingList.insert(m_SeedSortingList.begin(), tower); // Insert incoming tower at the beginning of the sorting list
41 SortByPt(m_SeedSortingList); // Do et-sorting as tower comes in, definition of 2-Pass, using std::stable_sort()
42 while (m_SeedSortingList.size() > MaxSeedSortingN) // It only runs when m_SeedSortingList.size() = m_MaxSeedSortingN + 1 though
43 {
44 m_RollOffList.push_back(m_SeedSortingList.back()); // Then, Fill the Roll-Off list
45 m_SeedSortingList.pop_back(); // Discard the 51st seed tower
46 }
47 }
48 else m_ConstituentList.push_back(tower); // Always put soft tower at the back of the m_ConstituentList
49 }
50 if(m_ConstituentList.size() > MaxConstN)m_ConstituentList.resize(MaxConstN); // Truncate the Constituent list
51 if(m_RollOffList.size() > m_RollOffBufferSize)m_RollOffList.resize(m_RollOffBufferSize); // Truncate the Roll-Off list
52}
static void SortByPt(std::vector< T > &list)
Definition WTAObject.h:23
std::vector< WTATrigObj > m_RollOffList
WTAParameters m_WTAConeMakerParameter

◆ GetAssociateBits()

std::vector< int > WTAConeMaker::GetAssociateBits ( WTATrigObj incoming_seed,
int & max_pt_index )
inlineinherited

Definition at line 210 of file WTAConeMaker.h.

211{
212 int jet_N = m_SeedList.size();
213 std::vector<int> associate_bit(jet_N, 0);
214 IntOrFloat MaxPt = tower.pt(); MaxPtIndex = -1;
215 for(int j = 0; j < jet_N; j++)
216 {
217 if(m_VERBOSE)std::cout << "deta, dphi, dR2 = " << tower.d_eta(m_SeedList.at(j)) << " , " << tower.d_phi_MPI_PI(m_SeedList.at(j)) << " , " << tower.dR2(m_SeedList.at(j)) << std::endl;
218 if(tower.IsAssocdR(m_SeedList.at(j), m_WTAConeMakerParameter.GetIso_dR2())) // e.g) dR2 < 0.16, association
219 {
220 associate_bit.at(j) = 1;
221 if(m_SeedList.at(j).pt() > MaxPt)
222 {
223 MaxPtIndex = j;
224 MaxPt = m_SeedList.at(j).pt(); // Update the counter
225 }
226 }
227 } // associate_bit filling done
228 return associate_bit;
229}

◆ GetConstituentList()

const std::vector< WTATrigObj > & WTAConeMaker::GetConstituentList ( ) const
inlineinherited

Definition at line 70 of file WTAConeMaker.h.

70{return m_ConstituentList;}; // Access these lists whenever we need

◆ GetDEBUG()

bool WTAConeMaker::GetDEBUG ( )
inlineinherited

Definition at line 86 of file WTAConeMaker.h.

86{return m_DEBUG;}; // Printout for debug

◆ GetRollOffBufferSize()

int WTACone2PassMaker::GetRollOffBufferSize ( )
inline

Definition at line 21 of file WTACone2PassMaker.h.

21{return m_RollOffBufferSize;}

◆ GetRollOffList()

const std::vector< WTATrigObj > & WTACone2PassMaker::GetRollOffList ( ) const
inline

Definition at line 23 of file WTACone2PassMaker.h.

23{return m_RollOffList;}; // Access the RollOffList

◆ GetSeedList()

const std::vector< WTAJet > & WTAConeMaker::GetSeedList ( ) const
inlineinherited

Definition at line 72 of file WTAConeMaker.h.

72{return m_SeedList;};

◆ GetSeedSortingList()

const std::vector< WTATrigObj > & WTAConeMaker::GetSeedSortingList ( ) const
inlineinherited

Definition at line 71 of file WTAConeMaker.h.

71{return m_SeedSortingList;};

◆ GetVERBOSE()

bool WTAConeMaker::GetVERBOSE ( )
inlineinherited

Definition at line 87 of file WTAConeMaker.h.

87{return m_VERBOSE;};

◆ InitiateInputs() [1/2]

void WTAConeMaker::InitiateInputs ( const std::vector< IntOrFloat > & ptVec,
const std::vector< IntOrFloat > & etaVec,
const std::vector< IntOrFloat > & phiVec,
const std::vector< IntOrFloat > & mVec )
inlineinherited

Definition at line 136 of file WTAConeMaker.h.

137{
138 std::vector<WTATrigObj> InputTowers = LoadInputs(ptVec, etaVec, phiVec, mVec);
139 FillLists(InputTowers);
140 if(m_VERBOSE)std::cout << "InputN, ConstN, SeedN = " << InputTowers.size() << " , " << m_ConstituentList.size() << " , " << m_SeedSortingList.size() << std::endl;
141}
virtual void FillLists(const std::vector< WTATrigObj > &InputTowers)
std::vector< WTATrigObj > LoadInputs(const std::vector< IntOrFloat > &ptVec, const std::vector< IntOrFloat > &etaVec, const std::vector< IntOrFloat > &phiVec, const std::vector< IntOrFloat > &mVec)

◆ InitiateInputs() [2/2]

void WTAConeMaker::InitiateInputs ( const std::vector< WTATrigObj > & InputTowers)
inlineinherited

Definition at line 143 of file WTAConeMaker.h.

144{
145 FillLists(InputTowers);
146 if(m_VERBOSE)std::cout << "InputN, ConstN, SeedN = " << InputTowers.size() << " , " << m_ConstituentList.size() << " , " << m_SeedSortingList.size() << std::endl;
147}

◆ InsertToConstList()

void WTAConeMaker::InsertToConstList ( const WTATrigObj & obj)
inlineinherited

Definition at line 161 of file WTAConeMaker.h.

162{
163 if(m_WTAConeMakerParameter.GetAddConstFirst())m_ConstituentList.insert(m_ConstituentList.begin(), obj); // Insert obj at the beginnning
164 else m_ConstituentList.push_back(obj); // Insert obj at the end
165}

◆ LoadInputs()

std::vector< WTATrigObj > WTAConeMaker::LoadInputs ( const std::vector< IntOrFloat > & ptVec,
const std::vector< IntOrFloat > & etaVec,
const std::vector< IntOrFloat > & phiVec,
const std::vector< IntOrFloat > & mVec )
inlineinherited

Definition at line 101 of file WTAConeMaker.h.

102{
103 std::vector<WTATrigObj> input_towers;
104 unsigned int tower_n = ptVec.size();
105 for(unsigned int t = 0; t < tower_n; t++)
106 {
107 WTATrigObj this_tower(ptVec.at(t), etaVec.at(t), phiVec.at(t), mVec.at(t));
108 input_towers.push_back(this_tower);
109 }
110 return input_towers;
111
112}

◆ MergeConstsToSeeds()

void WTACone2PassMaker::MergeConstsToSeeds ( )
inlineoverridevirtual

Reimplemented from WTAConeMaker.

Definition at line 96 of file WTACone2PassMaker.h.

97{
98 if(m_RollOffList.size() > 0)
99 {
100 for (const auto& off_seed: m_RollOffList)InsertToConstList(off_seed); // m_AddConstFirst is true by default
101 }
102 for(auto constituent: m_ConstituentList)
103 {
104 for(unsigned int j = 0; j < m_SeedList.size(); j++) // Assume Jets are pT sorted, WTA means more energetic jet eats constituent first
105 {
106 IntOrFloat dR2 = constituent.dR2(m_SeedList.at(j));
107 if(constituent.IsAssocdR(m_SeedList.at(j), m_WTAConeMakerParameter.GetJet_dR2()) && dR2!=0) // Thistime, the condition is m_JetArea, the usual R2Par, **WARNING: dR2!=0 IS TEMPORARY FOR INT-SIM. NEED TO KNOW TOPOTOWER CREATION
108 {
109 m_SeedList.at(j).MergeConstituent(constituent);
110 ResizeThisJetConstituents(m_SeedList.at(j)); // Check JetConstituent N
111 break; // Break the jet loop, move to the next constituent
112 }
113 }
114 }
115}
void ResizeThisJetConstituents(WTAJet &jet)
void InsertToConstList(const WTATrigObj &obj)

◆ PrintSeedList()

void WTAConeMaker::PrintSeedList ( )
inlineinherited

Definition at line 149 of file WTAConeMaker.h.

150{
151 int AllJetConstN = 0;
152 for(const auto& jet: m_SeedList)
153 {
154 AllJetConstN += jet.GetConstituentCount();
155 std::cout << "Jet pT, eta, phi, constN = " << jet.pt() << " , " << jet.eta() << " , " << jet.phi() << " , " << jet.GetConstituentCount() << std::endl;
156 }
157 std::cout << "PrintSeedList..." << " , SeedN, AllJetConstN, ConstN = " << m_SeedList.size() << " , " << AllJetConstN << " , " << m_ConstituentList.size() << std::endl;
158 std::cout << "+++++++++++++++++++++++++" << std::endl;
159}

◆ ResizeConstituentList()

void WTAConeMaker::ResizeConstituentList ( )
inlineinherited

Definition at line 167 of file WTAConeMaker.h.

168{
169 const unsigned int MaxConstN = m_WTAConeMakerParameter.GetMaxConstN();
170 while(m_ConstituentList.size() > MaxConstN)m_ConstituentList.pop_back();
171}

◆ ResizeSeedList()

void WTAConeMaker::ResizeSeedList ( )
inlineinherited

Definition at line 188 of file WTAConeMaker.h.

189{
190 const unsigned int MaxSeedN = m_WTAConeMakerParameter.GetMaxSeedN();
191 while(m_SeedList.size() > MaxSeedN)
192 {
194 m_SeedList.pop_back();
195 }
196}
WTATrigObj WTAJetToWTATrigObj(const WTAJet &jet)

◆ ResizeSeedNConstLists()

void WTAConeMaker::ResizeSeedNConstLists ( )
inlineinherited

Definition at line 64 of file WTAConeMaker.h.

◆ ResizeSeedSortingList()

void WTAConeMaker::ResizeSeedSortingList ( )
inlineinherited

Definition at line 173 of file WTAConeMaker.h.

174{
175 const unsigned int MaxSeedSortingN = m_WTAConeMakerParameter.GetMaxSeedSortingN();
176 while(m_SeedSortingList.size() > MaxSeedSortingN)m_SeedSortingList.pop_back();
177}

◆ ResizeThisJetConstituents()

void WTAConeMaker::ResizeThisJetConstituents ( WTAJet & jet)
inlineinherited

Definition at line 179 of file WTAConeMaker.h.

180{
181 const unsigned int MaxConstPerJetN = m_WTAConeMakerParameter.GetMaxConstPerJetN();
182 while(jet.GetConstituentCount() > MaxConstPerJetN)
183 {
184 jet.PopOutLastConstituent(); // Erase the last constituent, it is NOT appended to the Const list
185 }
186}
void PopOutLastConstituent()
Definition WTAObject.h:151
unsigned int GetConstituentCount() const
Definition WTAObject.h:123

◆ SeedCleaning()

void WTACone2PassMaker::SeedCleaning ( )
inlineoverridevirtual

Reimplemented from WTAConeMaker.

Definition at line 54 of file WTACone2PassMaker.h.

55{
56 m_SeedList.clear();
57 if(m_DEBUG)std::cout << "HighEtMerge2Pass Seed Cleaning......" << std::endl;
58 int seed_N = m_SeedSortingList.size(); // Default: Max 50
59 for(int i = 0; i < seed_N; i++){
60 WTATrigObj seed = m_SeedSortingList.at(i);
61 unsigned int jet_N = m_SeedList.size();
62 if(jet_N == 0)m_SeedList.push_back(WTATrigObjToWTAJet(seed)); // Take first seed as jet
63 else
64 {
65 int MaxPtIndex = -1; // MaxPtIndex will be -1 in 2Pass by construction, et-sorted m_SeedSortingList
66 std::vector<int> associate_bit = GetAssociateBits(seed, MaxPtIndex); // Associate_bit filling done
67 if(std::find(associate_bit.begin(), associate_bit.end(), 1) != associate_bit.end())
68 { // When there is at least one association between incoming tower vs existing seeds
69 for(unsigned int j = 0; j < jet_N; j++) // Read high-et seed first
70 {
71 if(associate_bit.at(j) == 1)
72 {
73 m_SeedList.at(j).MergeConstituent(seed);
74 break; // Done, move to the next tower-object
75 }
76 }
77 }
78 else
79 { // No Association
80 if(jet_N < m_WTAConeMakerParameter.GetMaxSeedN()) // There is a slot in the seed list
81 {
82 m_SeedList.push_back(WTATrigObjToWTAJet(seed)); // Insert seed-object to the end of the seed list
83 } // Discard if there is no open slot in the seed list
84 }
85 } // Main loop
86 // No need to pt sort the SeedList. It is sorted by construction
87 // No need to resize the SeedList. Only insert the seed-object if(jet_n < m_MaxSeedN)
88 if(m_VERBOSE)PrintSeedList(); // Print SeedList, for debug
89 } // seed loop
90 if(m_DEBUG){
92 std::cout << "HighEtMerge2Pass Seed Cleaning Done......" << std::endl;
93 }
94}
std::vector< int > GetAssociateBits(WTATrigObj incoming_seed, int &max_pt_index)
WTAJet WTATrigObjToWTAJet(const WTATrigObj &obj)
void PrintSeedList()

◆ SetDEBUG()

void WTAConeMaker::SetDEBUG ( )
inlineinherited

Definition at line 84 of file WTAConeMaker.h.

84{m_DEBUG = true;}; // Printout for debug

◆ SetRollOffBufferSize()

void WTACone2PassMaker::SetRollOffBufferSize ( int rolloff_buffersize)
inline

Definition at line 20 of file WTACone2PassMaker.h.

20{m_RollOffBufferSize = rolloff_buffersize;}

◆ SetVERBOSE()

void WTAConeMaker::SetVERBOSE ( )
inlineinherited

Definition at line 85 of file WTAConeMaker.h.

85{m_DEBUG = true; m_VERBOSE = true;};

◆ WTAJetToWTATrigObj()

WTATrigObj WTAConeMaker::WTAJetToWTATrigObj ( const WTAJet & jet)
inlineinherited

Definition at line 204 of file WTAConeMaker.h.

205{
206 WTATrigObj thisobj(jet.pt(), jet.eta(), jet.phi(), jet.m(), jet.idx());
207 return thisobj;
208}
IntOrFloat m() const
Definition WTAObject.h:44
int idx() const
Definition WTAObject.h:46
IntOrFloat pt() const
Definition WTAObject.h:38
IntOrFloat eta() const
Definition WTAObject.h:40
IntOrFloat phi() const
Definition WTAObject.h:42

◆ WTATrigObjToWTAJet()

WTAJet WTAConeMaker::WTATrigObjToWTAJet ( const WTATrigObj & obj)
inlineinherited

Definition at line 198 of file WTAConeMaker.h.

199{
200 WTAJet thisjet(obj.pt(), obj.eta(), obj.phi(), obj.m(), obj.idx());
201 return thisjet;
202}

Member Data Documentation

◆ m_ConstituentList

std::vector<WTATrigObj> WTAConeMaker::m_ConstituentList
protectedinherited

Definition at line 92 of file WTAConeMaker.h.

◆ m_DEBUG

bool WTAConeMaker::m_DEBUG
protectedinherited

Definition at line 96 of file WTAConeMaker.h.

◆ m_RollOffBufferSize

unsigned int WTACone2PassMaker::m_RollOffBufferSize
private

Definition at line 27 of file WTACone2PassMaker.h.

◆ m_RollOffList

std::vector<WTATrigObj> WTACone2PassMaker::m_RollOffList
private

Definition at line 26 of file WTACone2PassMaker.h.

◆ m_SeedList

std::vector<WTAJet> WTAConeMaker::m_SeedList
protectedinherited

Definition at line 94 of file WTAConeMaker.h.

◆ m_SeedSortingList

std::vector<WTATrigObj> WTAConeMaker::m_SeedSortingList
protectedinherited

Definition at line 93 of file WTAConeMaker.h.

◆ m_VERBOSE

bool WTAConeMaker::m_VERBOSE
protectedinherited

Definition at line 97 of file WTAConeMaker.h.

◆ m_WTAConeMakerParameter

WTAParameters WTAConeMaker::m_WTAConeMakerParameter
inherited

Definition at line 89 of file WTAConeMaker.h.


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