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

#include <WTAConeMaker.h>

Inheritance diagram for WTAConeMaker:
Collaboration diagram for WTAConeMaker:

Public Member Functions

 WTAConeMaker (bool debug=false, bool verbose=false)
virtual ~WTAConeMaker ()=default
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)
virtual void FillLists (const std::vector< WTATrigObj > &InputTowers)
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)
virtual void SeedCleaning ()
virtual void MergeConstsToSeeds ()
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

Detailed Description

Definition at line 59 of file WTAConeMaker.h.

Constructor & Destructor Documentation

◆ WTAConeMaker()

WTAConeMaker::WTAConeMaker ( bool debug = false,
bool verbose = false )
inline

Definition at line 61 of file WTAConeMaker.h.

61 :
63 {}; // Constructor
const bool debug
bool verbose
Definition hcg.cxx:73

◆ ~WTAConeMaker()

virtual WTAConeMaker::~WTAConeMaker ( )
virtualdefault

Member Function Documentation

◆ ClearLists()

void WTAConeMaker::ClearLists ( )
inline

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 ( )
inline

Definition at line 309 of file WTAConeMaker.h.

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

◆ FillLists()

void WTAConeMaker::FillLists ( const std::vector< WTATrigObj > & InputTowers)
inlinevirtual

Reimplemented in WTACone2PassMaker.

Definition at line 120 of file WTAConeMaker.h.

121{
122 m_ConstituentList.clear(); m_SeedSortingList.clear();
123 const unsigned int MaxSeedSortingN = m_WTAConeMakerParameter.GetMaxSeedSortingN();
124 const unsigned int MaxConstN = m_WTAConeMakerParameter.GetMaxConstN();
125 const int MaxTowersToReadPerEvent = m_WTAConeMakerParameter.GetMaxInputTowers();
126 if(m_DEBUG) std::cout << "MaxTowersToReadPerEvent = " << MaxTowersToReadPerEvent << ", Size of event = " << InputTowers.size() << std::endl;
127 int nTowers = 0;
128 for(const auto& tower: InputTowers)
129 {
130 if(tower.pt() < m_WTAConeMakerParameter.GetConstEtCut())continue; // Skip Et < 2GeV
131 if(tower.pt() >= m_WTAConeMakerParameter.GetSeedEtCut())m_SeedSortingList.push_back(tower); // Harmonize >=
132 else m_ConstituentList.push_back(tower); // Initially, always put soft tower at the back of the m_ConstituentList
133
134 // We can read only first N towers out of entier event
135 nTowers++;
136 if(nTowers>MaxTowersToReadPerEvent) break;
137 }
138 if(m_SeedSortingList.size() > MaxSeedSortingN)m_SeedSortingList.resize(MaxSeedSortingN);
139 if(m_ConstituentList.size() > MaxConstN)m_ConstituentList.resize(MaxConstN); // Resize lists accordingly
140}
WTAParameters m_WTAConeMakerParameter

◆ GetAssociateBits()

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

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
inline

Definition at line 75 of file WTAConeMaker.h.

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

◆ GetDEBUG()

bool WTAConeMaker::GetDEBUG ( )
inline

Definition at line 92 of file WTAConeMaker.h.

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

◆ GetSeedList()

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

Definition at line 77 of file WTAConeMaker.h.

77{return m_SeedList;};

◆ GetSeedSortingList()

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

Definition at line 76 of file WTAConeMaker.h.

76{return m_SeedSortingList;};

◆ GetVERBOSE()

bool WTAConeMaker::GetVERBOSE ( )
inline

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 )
inline

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)
inline

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)
inline

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 )
inline

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 WTAConeMaker::MergeConstsToSeeds ( )
inlinevirtual

Reimplemented in WTACone2PassMaker.

Definition at line 293 of file WTAConeMaker.h.

294{
295 for(auto constituent: m_ConstituentList)
296 {
297 for(unsigned int j = 0; j < m_SeedList.size(); j++) // Assume Seeds are pT sorted, WTA means more energetic jet eats constituent first
298 {
299 if(constituent.IsAssocdR(m_SeedList.at(j), m_WTAConeMakerParameter.GetJet_dR())) // Thistime, the condition is m_Jet_dR, the usual R_PAR
300 {
301 m_SeedList.at(j).MergeConstituent(constituent);
302 ResizeThisJetConstituents(m_SeedList.at(j)); // Check JetConstituent N
303 break; // Break the jet loop, move to the next constituent
304 }
305 }
306 }
307}
void ResizeThisJetConstituents(WTAJet &jet)

◆ PrintSeedList()

void WTAConeMaker::PrintSeedList ( )
inline

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 ( )
inline

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 ( )
inline

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

◆ ResizeSeedNConstLists()

void WTAConeMaker::ResizeSeedNConstLists ( )
inline

Definition at line 69 of file WTAConeMaker.h.

◆ ResizeSeedSortingList()

void WTAConeMaker::ResizeSeedSortingList ( )
inline

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)
inline

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 WTAConeMaker::SeedCleaning ( )
inlinevirtual

Reimplemented in WTACone2PassMaker.

Definition at line 242 of file WTAConeMaker.h.

243{
244 m_SeedList.clear();
245 if(m_DEBUG)std::cout << "Baseline Seed Cleaning......" << std::endl;
246 for(const auto& seed: m_SeedSortingList)
247 {
248 int jet_N = m_SeedList.size();
249 if(jet_N == 0)
250 {
251 m_SeedList.push_back(WTATrigObjToWTAJet(seed)); // Take first seed as jet
252 }
253 else
254 {
255 int MaxPtIndex = -1;
256 std::vector<int> associate_bit = GetAssociateBits(seed, MaxPtIndex); // Associate_bit filling done
257 if(std::find(associate_bit.begin(), associate_bit.end(), 1) != associate_bit.end())
258 { // When there is at least one association
259 if(MaxPtIndex == -1)
260 { // Incoming Seed is the highest et, do the seed cleaning
261 WTAJet IncomingSeedAsJet = WTATrigObjToWTAJet(seed);
262 for(int j = jet_N - 1; j >= 0; j--)
263 { // It's important to read bits from the right, lower et jets first
264 if(associate_bit.at(j) == 1)
265 { // If Incoming seed is the highest, and there is an associated old jth jet, pop out jth jet
266 InsertToConstList(WTAJetToWTATrigObj(m_SeedList.at(j))); // Move jth jet to constituent list
267 m_SeedList.erase(m_SeedList.begin() + j); // Then, erase jth jet
268 }
269 }
270 m_SeedList.push_back(std::move(IncomingSeedAsJet)); // Add this new incoming seed as Jet, well localized protojet
271 }
272 else
273 { // Incoming Seed is not the highest et, add seed to the ConstituentList
274 InsertToConstList(seed);
275 }
276 } // At least one association loop
277 else
278 { // When there is no association
279 WTAJet IncomingSeedAsJet = WTATrigObjToWTAJet(seed);
280 m_SeedList.push_back(std::move(IncomingSeedAsJet)); // Add seed to the SeedList
281 }
282 } // Main merging loop
283 SortByPt(m_SeedList); // PtSort the SeedList. This is important for Baseline seed cleaning!
284 ResizeSeedNConstLists(); // Resize SeedList, and ConstList
285 if(m_VERBOSE)PrintSeedList(); // Print SeedList, for debug
286 } // seed loop
287 if(m_DEBUG){
289 std::cout << "Baseline Seed Cleaning Done......" << std::endl;
290 }
291}
static void SortByPt(std::vector< T > &list)
Definition WTAObject.h:16
void ResizeSeedNConstLists()
std::vector< int > GetAssociateBits(WTATrigObj incoming_seed, int &max_pt_index)
WTAJet WTATrigObjToWTAJet(const WTATrigObj &obj)
void PrintSeedList()

◆ SetDEBUG()

void WTAConeMaker::SetDEBUG ( )
inline

Definition at line 90 of file WTAConeMaker.h.

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

◆ SetVERBOSE()

void WTAConeMaker::SetVERBOSE ( )
inline

Definition at line 91 of file WTAConeMaker.h.

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

◆ WTAJetToWTATrigObj()

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

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)
inline

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
protected

Definition at line 98 of file WTAConeMaker.h.

◆ m_DEBUG

bool WTAConeMaker::m_DEBUG
protected

Definition at line 102 of file WTAConeMaker.h.

◆ m_SeedList

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

Definition at line 100 of file WTAConeMaker.h.

◆ m_SeedSortingList

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

Definition at line 99 of file WTAConeMaker.h.

◆ m_VERBOSE

bool WTAConeMaker::m_VERBOSE
protected

Definition at line 103 of file WTAConeMaker.h.

◆ m_WTAConeMakerParameter

WTAParameters WTAConeMaker::m_WTAConeMakerParameter

Definition at line 95 of file WTAConeMaker.h.


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