ATLAS Offline Software
Loading...
Searching...
No Matches
ParticleCandidateList.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
6// ParticleCandidateList.h
7// Header file for class ParticleCandidateList
8// Author: S.Binet<binet@cern.ch>
10#ifndef ANALYSISUTILS_PARTICLECANDIDATELIST_H
11#define ANALYSISUTILS_PARTICLECANDIDATELIST_H
12
19
20// STL includes
21#include <list>
22
23// EventKernel includes
26
27// Gaudi includes
28
30 : public AthMessaging
31{
32
34 // typedefs:
36 public:
37
39
40 typedef std::list<int>::iterator iterator;
41 typedef std::list<int>::const_iterator const_iterator;
42 typedef std::list<int>::size_type size_type;
44
46 // Public methods:
48 public:
49
53
57
58 // Constructor with parameters:
59
62 virtual ~ParticleCandidateList();
63
67
69 // Const methods:
71
76 bool hasInList( const int& pdgID,
77 const bool tightMatch = false ) const;
78 void dropList() const;
79
82 const std::list<int>& list() const;
83
85
86 const_iterator begin() const;
87 const_iterator end() const;
88
89 bool empty() const;
90 size_type size() const;
91 size_type max_size() const;
92
94
96 // Non-const methods:
98
101 void push_back(const int& id);
102
105 void clear();
106
107 void addLeptons();
108 void addLightJets();
109 void addLightQuarks();
110 void addBQuark();
111 void addBbarQuark();
112 void addBQuarks();
113 void addBjet();
114 void addWBosons();
115 void addZBoson();
116 void add( const int& partID );
117 void add( const std::string& listOfParticlesName = "LightQuarks" );
118
119 protected:
120 std::list<int> m_list;
121};
122
123
126
127inline
130{
131 if ( this != &rhs ) {
132 m_list = rhs.m_list;
133 }
134 return *this;
135}
136
138// Const methods:
140inline const std::list<int>& ParticleCandidateList::list() const
141{
142 return m_list;
143}
144
149
154
156{
157 return m_list.empty();
158}
159
161{
162 return m_list.size();
163}
164
166{
167 return m_list.max_size();
168}
169
170
172// Non-const methods:
174
175inline void ParticleCandidateList::push_back( const int& partID )
176{
177 m_list.push_back( partID );
178}
179
181{
182 m_list.clear();
183}
184
185inline void ParticleCandidateList::add( const int& partID )
186{
187 push_back( partID );
188}
189
191{
192 add( MC::BQUARK ); //> b
193}
194
196{
197 add( -MC::BQUARK ); //> b_bar
198}
199
201{
202 add( MC::BQUARK ); //> b
203 add( -MC::BQUARK ); //> b_bar
204}
205
207{
208 add( MC::BQUARK ); //> b
209 add( -MC::BQUARK ); //> b_bar
210}
211
213{
214 add( MC::WPLUSBOSON ); //> W+
215 add( -MC::WPLUSBOSON ); //> W-
216 }
217
219{
220 add( MC::Z0BOSON );
221}
222
223#endif //> ANALYSISUTILS_PARTICLECANDIDATELIST_H
ATLAS-specific HepMC functions.
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
A simple wrapper for std::list<int> to model a list of particle identity candidates.
const_iterator begin() const
std::list< int >::size_type size_type
ParticleCandidateList()
Default constructor:
std::list< int >::iterator iterator
void push_back(const int &id)
forward the std::list<int>::push_back() method
ParticleCandidateList & operator=(const ParticleCandidateList &rhs)
Assignment operator:
std::list< int >::const_iterator const_iterator
const std::list< int > & list() const
Return the wrapped STL list.
bool hasInList(const int &pdgID, const bool tightMatch=false) const
Tells if a given particle or pID is in the list if tightMatch = false : look only if std::abs() of pa...
virtual ~ParticleCandidateList()
Destructor:
void addLeptons()
Non-const methods:
void add(const int &partID)
const_iterator end() const
void clear()
forward the std::list<int>::clear() method
static const int Z0BOSON
static const int BQUARK
static const int WPLUSBOSON