ATLAS Offline Software
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 
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 
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 
125 {}
126 
127 inline
130 {
131  if ( this != &rhs ) {
132  m_list = rhs.m_list;
133  }
134  return *this;
135 }
136 
138 // Const methods:
140 inline const std::list<int>& ParticleCandidateList::list() const
141 {
142  return m_list;
143 }
144 
146 {
147  return m_list.begin();
148 }
149 
151 {
152  return m_list.end();
153 }
154 
155 inline bool ParticleCandidateList::empty() const
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 
175 inline void ParticleCandidateList::push_back( const int& partID )
176 {
177  m_list.push_back( partID );
178 }
179 
181 {
182  m_list.clear();
183 }
184 
185 inline 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
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
ParticleCandidateList::begin
const_iterator begin() const
Definition: ParticleCandidateList.h:145
python.CreateTierZeroArgdict.partID
partID
Definition: CreateTierZeroArgdict.py:135
ParticleCandidateList::max_size
size_type max_size() const
Definition: ParticleCandidateList.h:165
ParticleCandidateList::m_list
std::list< int > m_list
Definition: ParticleCandidateList.h:120
ParticleCandidateList::addLightJets
void addLightJets()
Definition: ParticleCandidateList.cxx:93
ParticleCandidateList::dropList
void dropList() const
Definition: ParticleCandidateList.cxx:59
ParticleCandidateList::iterator
std::list< int >::iterator iterator
Definition: ParticleCandidateList.h:40
ParticleCandidateList::push_back
void push_back(const int &id)
forward the std::list<int>::push_back() method
Definition: ParticleCandidateList.h:175
ParticleCandidateList::addBbarQuark
void addBbarQuark()
Definition: ParticleCandidateList.h:195
ParticleCandidateList::~ParticleCandidateList
virtual ~ParticleCandidateList()
Destructor:
Definition: ParticleCandidateList.h:124
ParticleCandidateList::clear
void clear()
forward the std::list<int>::clear() method
Definition: ParticleCandidateList.h:180
ParticleCandidateList::ParticleCandidateList
ParticleCandidateList()
Default constructor:
Definition: ParticleCandidateList.cxx:19
ParticleCandidateList::list
const std::list< int > & list() const
Return the wrapped STL list.
Definition: ParticleCandidateList.h:140
ParticleCandidateList::size_type
std::list< int >::size_type size_type
Definition: ParticleCandidateList.h:42
ParticleCandidateList::empty
bool empty() const
Definition: ParticleCandidateList.h:155
ParticleCandidateList::addZBoson
void addZBoson()
Definition: ParticleCandidateList.h:218
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
ParticleCandidateList::operator=
ParticleCandidateList & operator=(const ParticleCandidateList &rhs)
Assignment operator:
Definition: ParticleCandidateList.h:129
ParticleCandidateList::addBQuarks
void addBQuarks()
Definition: ParticleCandidateList.h:200
ParticleCandidateList::addBjet
void addBjet()
Definition: ParticleCandidateList.h:206
ParticleCandidateList::addLeptons
void addLeptons()
Non-const methods:
Definition: ParticleCandidateList.cxx:75
ParticleCandidateList::addWBosons
void addWBosons()
Definition: ParticleCandidateList.h:212
ParticleCandidateList::addLightQuarks
void addLightQuarks()
Definition: ParticleCandidateList.cxx:110
ParticleCandidateList::hasInList
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...
Definition: ParticleCandidateList.cxx:29
AthMessaging.h
ParticleCandidateList::end
const_iterator end() const
Definition: ParticleCandidateList.h:150
ParticleCandidateList::size
size_type size() const
Definition: ParticleCandidateList.h:160
ParticleCandidateList::const_iterator
std::list< int >::const_iterator const_iterator
Definition: ParticleCandidateList.h:41
ParticleCandidateList
A simple wrapper for std::list<int> to model a list of particle identity candidates.
Definition: ParticleCandidateList.h:31
ParticleCandidateList::add
void add(const int &partID)
Definition: ParticleCandidateList.h:185
ParticleCandidateList::addBQuark
void addBQuark()
Definition: ParticleCandidateList.h:190
HepMCHelpers.h