GENIEGenerator
Loading...
Searching...
No Matches
PDGCodeList.h
Go to the documentation of this file.
1//____________________________________________________________________________
2/*!
3
4\class genie::PDGCodeList
5
6\brief A list of PDG codes
7
8\author Costas Andreopoulos <c.andreopoulos \at cern.ch>
9 University of Liverpool
10
11\created May 13, 2005
12
13\cpright Copyright (c) 2003-2025, The GENIE Collaboration
14 For the full text of the license visit http://copyright.genie-mc.org
15*/
16//____________________________________________________________________________
17
18#ifndef _PDG_CODE_LIST_H_
19#define _PDG_CODE_LIST_H_
20
21#include <vector>
22#include <ostream>
23
24using std::vector;
25using std::ostream;
26
27namespace genie {
28
29class PDGCodeList;
30ostream & operator << (ostream & stream, const PDGCodeList & list);
31
32class PDGCodeList : public vector<int> {
33
34public :
35
36 PDGCodeList(bool allowdup=false);
37 PDGCodeList(size_type n, bool allowdup=false);
38 PDGCodeList(const PDGCodeList & list);
40
41 //! override the vector<int> insertion methods to explicitly check for
42 //! PDG code validity and that no PDG code is listed more than once
43 void push_back (int pdg_code);
44 void insert (iterator pos, size_type n, const int& x);
45
46 //! PDG code checks used by PDGCodeList
47 bool CheckPDGCode (int pdg_code) const;
48 bool ExistsInPDGLibrary (int pdg_code) const;
49 bool ExistsInPDGCodeList (int pdg_code) const;
50
51 //! copy / print
52 void Copy (const PDGCodeList & list);
53 void Print (ostream & stream) const;
54
55 //! check state
56 bool DuplEntriesAllowed(void) const { return fAllowDuplicateEntries; }
57
58 //! overloaded operators
59 PDGCodeList & operator = (const PDGCodeList & list);
60 friend ostream & operator << (ostream & stream, const PDGCodeList & list);
61
62private:
63
64 bool fAllowDuplicateEntries; ///< allow duplicate entries in the list?
65};
66
67} // genie namespace
68
69#endif // _PDG_CODE_LIST_H_
A list of PDG codes.
Definition PDGCodeList.h:32
void Print(ostream &stream) const
bool DuplEntriesAllowed(void) const
check state
Definition PDGCodeList.h:56
bool ExistsInPDGCodeList(int pdg_code) const
PDGCodeList & operator=(const PDGCodeList &list)
overloaded operators
bool fAllowDuplicateEntries
allow duplicate entries in the list?
Definition PDGCodeList.h:64
PDGCodeList(bool allowdup=false)
void Copy(const PDGCodeList &list)
copy / print
bool ExistsInPDGLibrary(int pdg_code) const
void push_back(int pdg_code)
void insert(iterator pos, size_type n, const int &x)
friend ostream & operator<<(ostream &stream, const PDGCodeList &list)
bool CheckPDGCode(int pdg_code) const
PDG code checks used by PDGCodeList.
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25
ostream & operator<<(ostream &stream, const AlgConfigPool &config_pool)