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< pt_t > &ptVec, const std::vector< eta_t > &etaVec, const std::vector< phi_t > &phiVec, const std::vector< m_t > &mVec)
void InitiateInputs (const std::vector< pt_t > &ptVec, const std::vector< eta_t > &etaVec, const std::vector< phi_t > &phiVec, const std::vector< m_t > &mVec)
void InitiateInputs (const std::vector< WTATrigObj > &InputTowers)
void InsertToConstList (const WTATrigObj &obj)
void CreateERingInfo ()
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 13 of file WTACone2PassMaker.h.

Constructor & Destructor Documentation

◆ WTACone2PassMaker()

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

Definition at line 18 of file WTACone2PassMaker.h.

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

◆ ~WTACone2PassMaker()

WTACone2PassMaker::~WTACone2PassMaker ( )
inline

Definition at line 22 of file WTACone2PassMaker.h.

22{}; // Destructor

Member Function Documentation

◆ ClearLists()

void WTAConeMaker::ClearLists ( )
inlineinherited

Definition at line 71 of file WTAConeMaker.h.

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

◆ CreateERingInfo()

void WTAConeMaker::CreateERingInfo ( )
inlineinherited

Definition at line 309 of file WTAConeMaker.h.

310{
311 for(auto& jet: m_SeedList)
312 {
313 jet.CreateERingInfo();
314 }
315}

◆ FillLists()

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

Reimplemented from WTAConeMaker.

Definition at line 37 of file WTACone2PassMaker.h.

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}
static void SortByPt(std::vector< T > &list)
Definition WTAObject.h:16
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 216 of file WTAConeMaker.h.

217{
218 int jet_N = m_SeedList.size();
219 std::vector<int> associate_bit(jet_N, 0);
220 pt_t MaxPt = tower.pt(); MaxPtIndex = -1;
221 for(int j = 0; j < jet_N; j++)
222 {
223 if(m_VERBOSE)
224#ifdef FLOATING_POINT_SIMULATION
225 std::cout << "deta, dphi = " << tower.d_eta(m_SeedList.at(j)) << " , " << tower.d_phi_MPI_PI(m_SeedList.at(j)) << std::endl;
226#else
227 std::cout << "deta, dphi = " << tower.d_eta(m_SeedList.at(j)) << " , " << tower.d_phi_MPI_PI(m_SeedList.at(j)) << std::endl;
228#endif
229 if(tower.IsAssocdR(m_SeedList.at(j), m_WTAConeMakerParameter.GetIso_dR())) // e.g) dR < 0.4, association
230 {
231 associate_bit.at(j) = 1;
232 if(m_SeedList.at(j).pt() > MaxPt)
233 {
234 MaxPtIndex = j;
235 MaxPt = m_SeedList.at(j).pt(); // Update the counter
236 }
237 }
238 } // associate_bit filling done
239 return associate_bit;
240}
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)

◆ GetConstituentList()

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

Definition at line 75 of file WTAConeMaker.h.

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

◆ GetDEBUG()

bool WTAConeMaker::GetDEBUG ( )
inlineinherited

Definition at line 92 of file WTAConeMaker.h.

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

◆ GetRollOffBufferSize()

int WTACone2PassMaker::GetRollOffBufferSize ( )
inline

Definition at line 28 of file WTACone2PassMaker.h.

28{return m_RollOffBufferSize;}

◆ GetRollOffList()

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

Definition at line 30 of file WTACone2PassMaker.h.

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

◆ GetSeedList()

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

Definition at line 77 of file WTAConeMaker.h.

77{return m_SeedList;};

◆ GetSeedSortingList()

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

Definition at line 76 of file WTAConeMaker.h.

76{return m_SeedSortingList;};

◆ GetVERBOSE()

bool WTAConeMaker::GetVERBOSE ( )
inlineinherited

Definition at line 93 of file WTAConeMaker.h.

93{return m_VERBOSE;};

◆ InitiateInputs() [1/2]

void WTAConeMaker::InitiateInputs ( const std::vector< pt_t > & ptVec,
const std::vector< eta_t > & etaVec,
const std::vector< phi_t > & phiVec,
const std::vector< m_t > & mVec )
inlineinherited

Definition at line 142 of file WTAConeMaker.h.

143{
144 std::vector<WTATrigObj> InputTowers = LoadInputs(ptVec, etaVec, phiVec, mVec);
145 FillLists(InputTowers);
146 if(m_VERBOSE)std::cout << "InputN, ConstN, SeedN = " << InputTowers.size() << " , " << m_ConstituentList.size() << " , " << m_SeedSortingList.size() << std::endl;
147}
std::vector< WTATrigObj > LoadInputs(const std::vector< pt_t > &ptVec, const std::vector< eta_t > &etaVec, const std::vector< phi_t > &phiVec, const std::vector< m_t > &mVec)
virtual void FillLists(const std::vector< WTATrigObj > &InputTowers)

◆ InitiateInputs() [2/2]

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

Definition at line 149 of file WTAConeMaker.h.

150{
151 FillLists(InputTowers);
152 if(m_VERBOSE)std::cout << "InputN, ConstN, SeedN = " << InputTowers.size() << " , " << m_ConstituentList.size() << " , " << m_SeedSortingList.size() << std::endl;
153}

◆ InsertToConstList()

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

Definition at line 167 of file WTAConeMaker.h.

168{
169 if(m_WTAConeMakerParameter.GetAddConstFirst())m_ConstituentList.insert(m_ConstituentList.begin(), obj); // Insert obj at the beginnning
170 else m_ConstituentList.push_back(obj); // Insert obj at the end
171}

◆ LoadInputs()

std::vector< WTATrigObj > WTAConeMaker::LoadInputs ( const std::vector< pt_t > & ptVec,
const std::vector< eta_t > & etaVec,
const std::vector< phi_t > & phiVec,
const std::vector< m_t > & mVec )
inlineinherited

Definition at line 107 of file WTAConeMaker.h.

108{
109 std::vector<WTATrigObj> input_towers;
110 unsigned int tower_n = ptVec.size();
111 for(unsigned int t = 0; t < tower_n; t++)
112 {
113 WTATrigObj this_tower(ptVec.at(t), etaVec.at(t), phiVec.at(t), mVec.at(t));
114 input_towers.push_back(this_tower);
115 }
116 return input_towers;
117
118}

◆ MergeConstsToSeeds()

void WTACone2PassMaker::MergeConstsToSeeds ( )
inlineoverridevirtual

Reimplemented from WTAConeMaker.

Definition at line 103 of file WTACone2PassMaker.h.

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}
void ResizeThisJetConstituents(WTAJet &jet)
void InsertToConstList(const WTATrigObj &obj)

◆ PrintSeedList()

void WTAConeMaker::PrintSeedList ( )
inlineinherited

Definition at line 155 of file WTAConeMaker.h.

156{
157 int AllJetConstN = 0;
158 for(const auto& jet: m_SeedList)
159 {
160 AllJetConstN += jet.GetConstituentCount();
161 std::cout << "Jet pT, eta, phi, constN = " << jet.pt() << " , " << jet.eta() << " , " << jet.phi() << " , " << jet.GetConstituentCount() << std::endl;
162 }
163 std::cout << "PrintSeedList..." << " , SeedN, AllJetConstN, ConstN = " << m_SeedList.size() << " , " << AllJetConstN << " , " << m_ConstituentList.size() << std::endl;
164 std::cout << "+++++++++++++++++++++++++" << std::endl;
165}

◆ ResizeConstituentList()

void WTAConeMaker::ResizeConstituentList ( )
inlineinherited

Definition at line 173 of file WTAConeMaker.h.

174{
175 const unsigned int MaxConstN = m_WTAConeMakerParameter.GetMaxConstN();
176 while(m_ConstituentList.size() > MaxConstN)m_ConstituentList.pop_back();
177}

◆ ResizeSeedList()

void WTAConeMaker::ResizeSeedList ( )
inlineinherited

Definition at line 194 of file WTAConeMaker.h.

195{
196 const unsigned int MaxSeedN = m_WTAConeMakerParameter.GetMaxSeedN();
197 while(m_SeedList.size() > MaxSeedN)
198 {
200 m_SeedList.pop_back();
201 }
202}
WTATrigObj WTAJetToWTATrigObj(const WTAJet &jet)

◆ ResizeSeedNConstLists()

void WTAConeMaker::ResizeSeedNConstLists ( )
inlineinherited

Definition at line 69 of file WTAConeMaker.h.

◆ ResizeSeedSortingList()

void WTAConeMaker::ResizeSeedSortingList ( )
inlineinherited

Definition at line 179 of file WTAConeMaker.h.

180{
181 const unsigned int MaxSeedSortingN = m_WTAConeMakerParameter.GetMaxSeedSortingN();
182 while(m_SeedSortingList.size() > MaxSeedSortingN)m_SeedSortingList.pop_back();
183}

◆ ResizeThisJetConstituents()

void WTAConeMaker::ResizeThisJetConstituents ( WTAJet & jet)
inlineinherited

Definition at line 185 of file WTAConeMaker.h.

186{
187 const unsigned int MaxConstPerJetN = m_WTAConeMakerParameter.GetMaxConstPerJetN();
188 while(jet.GetConstituentCount() > MaxConstPerJetN)
189 {
190 jet.PopOutLastConstituent(); // Erase the last constituent, it is NOT appended to the Const list
191 }
192}
void PopOutLastConstituent()
Definition WTAObject.h:207
tobn_t GetConstituentCount() const
Definition WTAObject.h:171

◆ SeedCleaning()

void WTACone2PassMaker::SeedCleaning ( )
inlineoverridevirtual

Reimplemented from WTAConeMaker.

Definition at line 61 of file WTACone2PassMaker.h.

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){
99 std::cout << "HighEtMerge2Pass Seed Cleaning Done......" << std::endl;
100 }
101}
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 90 of file WTAConeMaker.h.

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

◆ SetRollOffBufferSize()

void WTACone2PassMaker::SetRollOffBufferSize ( int rolloff_buffersize)
inline

Definition at line 27 of file WTACone2PassMaker.h.

27{m_RollOffBufferSize = rolloff_buffersize;}

◆ SetVERBOSE()

void WTAConeMaker::SetVERBOSE ( )
inlineinherited

Definition at line 91 of file WTAConeMaker.h.

91{m_DEBUG = true; m_VERBOSE = true;};

◆ WTAJetToWTATrigObj()

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

Definition at line 210 of file WTAConeMaker.h.

211{
212 WTATrigObj thisobj(jet.pt(), jet.eta(), jet.phi(), jet.m(), jet.idx());
213 return thisobj;
214}
eta_t eta() const
Definition WTAObject.h:33
phi_t phi() const
Definition WTAObject.h:35
pt_t pt() const
Definition WTAObject.h:31
int idx() const
Definition WTAObject.h:39
m_t m() const
Definition WTAObject.h:37

◆ WTATrigObjToWTAJet()

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

Definition at line 204 of file WTAConeMaker.h.

205{
206 WTAJet thisjet(obj.pt(), obj.eta(), obj.phi(), obj.m(), obj.idx());
207 return thisjet;
208}

Member Data Documentation

◆ m_ConstituentList

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

Definition at line 98 of file WTAConeMaker.h.

◆ m_DEBUG

bool WTAConeMaker::m_DEBUG
protectedinherited

Definition at line 102 of file WTAConeMaker.h.

◆ m_RollOffBufferSize

unsigned int WTACone2PassMaker::m_RollOffBufferSize
private

Definition at line 34 of file WTACone2PassMaker.h.

◆ m_RollOffList

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

Definition at line 33 of file WTACone2PassMaker.h.

◆ m_SeedList

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

Definition at line 100 of file WTAConeMaker.h.

◆ m_SeedSortingList

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

Definition at line 99 of file WTAConeMaker.h.

◆ m_VERBOSE

bool WTAConeMaker::m_VERBOSE
protectedinherited

Definition at line 103 of file WTAConeMaker.h.

◆ m_WTAConeMakerParameter

WTAParameters WTAConeMaker::m_WTAConeMakerParameter
inherited

Definition at line 95 of file WTAConeMaker.h.


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