EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
KFParticle_Container.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file KFParticle_Container.h
1 #ifndef KFPARTICLESPHENIX_KFPARTICLECONTAINER_H
2 #define KFPARTICLESPHENIX_KFPARTICLECONTAINER_H
3 
4 #include <phool/PHObject.h>
5 
6 #include <cstddef> // for size_t
7 #include <iostream> // for cout, ostream
8 #include <map>
9 #include <utility> // for pair
10 
11 class KFParticle;
12 
20 {
21  public:
22  typedef std::map<unsigned int, KFParticle*> Map;
23  typedef std::map<unsigned int, KFParticle*>::const_iterator ConstIter;
24  typedef std::map<unsigned int, KFParticle*>::iterator Iter;
25 
27  KFParticle_Container(const KFParticle_Container& kfparticlemap);
29  virtual ~KFParticle_Container();
30 
31  void identify(std::ostream& os = std::cout) const override;
32  void Reset() override;
33  int isValid() const override { return 1; }
34  PHObject* CloneMe() const override { return new KFParticle_Container(*this); }
35 
36  bool empty() const { return m_kfpmap.empty(); }
37  size_t size() const { return m_kfpmap.size(); }
38  size_t count(unsigned int key) const { return m_kfpmap.count(key); }
39  void clear() { Reset(); }
40 
41  const KFParticle* get(unsigned int key) const;
42  KFParticle* get(unsigned int key);
43 
44  ConstIter begin() const { return m_kfpmap.begin(); }
45  ConstIter find(unsigned int key) const { return m_kfpmap.find(key); }
46  ConstIter end() const { return m_kfpmap.end(); }
47 
48  Iter begin() { return m_kfpmap.begin(); }
49  Iter find(unsigned int key) { return m_kfpmap.find(key); }
50  Iter end() { return m_kfpmap.end(); }
51 
52  KFParticle* insert(const KFParticle* particle);
53  ConstIter addParticle(KFParticle* particle);
54  ConstIter addParticleSpecifyKey(unsigned int key, KFParticle* particle);
55 
57  Map returnParticlesByPDGid(int PDGid);
58 
59  size_t erase(unsigned int key);
60 
61  private:
63 
64  ClassDefOverride(KFParticle_Container, 1)
65 };
66 
67 #endif //KFPARTICLESPHENIX_KFPARTICLECONTAINER_H