Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
JetMap.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file JetMap.h
1 #ifndef JETBASE_JETMAP_H
2 #define JETBASE_JETMAP_H
3 
4 #include "Jet.h"
5 
6 #include <phool/PHObject.h>
7 
8 #include <cmath>
9 #include <cstddef> // for size_t
10 #include <iostream>
11 #include <map>
12 #include <vector>
13 #include <functional>
14 #include <set>
15 
16 class JetMap : public PHObject
17 {
18  public:
19  // jet object iterators
20  typedef std::map<unsigned int, Jet*> typ_JetMap;
21  typedef typ_JetMap::const_iterator ConstIter;
22  typedef typ_JetMap::iterator Iter;
23 
24  typedef std::vector<Jet*> vec_JetMap; // to be used when sorting typ_JetMap to iterate over
25 
26  // source identifier iterators
27  typedef std::set<Jet::SRC>::const_iterator ConstSrcIter;
28  typedef std::set<Jet::SRC>::iterator SrcIter;
29 
30  JetMap() = default;
31  ~JetMap() override = default;
32 
33  void identify(std::ostream& os = std::cout) const override;
34  int isValid() const override { return 0; }
35  PHObject* CloneMe() const override { return nullptr; }
36 
37  // map content info ----------------------------------------------------------
38 
39  virtual void set_algo(Jet::ALGO /*algo*/) { return; }
40  virtual Jet::ALGO get_algo() const { return Jet::NONE; }
41 
42  virtual void set_par(float) { return; }
43  virtual float get_par() const { return NAN; }
44 
45  // set access to list of source identifiers ----------------------------------
46 
47  virtual bool empty_src() const { return true; }
48  virtual void insert_src(Jet::SRC /*src*/) { return; }
49 
50  virtual ConstSrcIter begin_src() const;
51  virtual ConstSrcIter find_src(Jet::SRC src) const;
52  virtual ConstSrcIter end_src() const;
53 
54  virtual SrcIter begin_src();
55  virtual SrcIter find_src(Jet::SRC src);
56  virtual SrcIter end_src();
57 
58 
59  // map access to jets --------------------------------------------------------
60 
61  virtual bool empty() const { return true; }
62  virtual size_t size() const { return 0; }
63  virtual size_t count(unsigned int /*idkey*/) const { return 0; }
64  virtual void clear() { return; }
65 
66  virtual const Jet* get(unsigned int /*idkey*/) const { return nullptr; }
67  virtual Jet* get(unsigned int /*idkey*/) { return nullptr; }
68 
69  virtual Jet* insert(Jet* /*jet*/) { return nullptr; }
70  virtual size_t erase(unsigned int /*idkey*/) { return 0; }
71 
72 
73  virtual ConstIter begin() const;
74  virtual ConstIter find(unsigned int idkey) const;
75  virtual ConstIter end() const;
76 
77  virtual Iter begin();
78  virtual Iter find(unsigned int idkey);
79  virtual Iter end();
80 
81  virtual std::vector<Jet*> vec()=0;
82 
83  private:
85 };
86 
87 #endif