Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
JetMapv1.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file JetMapv1.h
1 #ifndef JETBASE_JETMAPV1_H
2 #define JETBASE_JETMAPV1_H
3 
4 #include "JetMap.h"
5 
6 #include "Jet.h"
7 
8 #include <cstddef> // for size_t
9 #include <iostream>
10 #include <set>
11 
12 class PHObject;
13 
14 class JetMapv1 : public JetMap
15 {
16  public:
17  JetMapv1() = default;
18  explicit JetMapv1(const JetMap& jets);
19  JetMapv1& operator=(const JetMap& jets);
20  ~JetMapv1() override;
21 
22  void identify(std::ostream& os = std::cout) const override;
23  void Reset() override;
24  int isValid() const override { return 1; }
25  PHObject* CloneMe() const override { return new JetMapv1(*this);}
26 
27  // map content info ----------------------------------------------------------
28 
29  void set_algo(Jet::ALGO algo) override { _algo = algo; }
30  Jet::ALGO get_algo() const override { return _algo; }
31 
32  void set_par(float par) override { _par = par; }
33  float get_par() const override { return _par; }
34 
35  // set access to source identifiers ------------------------------------------
36 
37  bool empty_src() const override { return _src.empty(); }
38  void insert_src(Jet::SRC src) override { _src.insert(src); }
39 
40  ConstSrcIter begin_src() const override { return _src.begin(); }
41  ConstSrcIter find_src(Jet::SRC src) const override { return _src.find(src); }
42  ConstSrcIter end_src() const override { return _src.end(); }
43 
44  SrcIter begin_src() override { return _src.begin(); }
45  SrcIter find_src(Jet::SRC src) override { return _src.find(src); }
46  SrcIter end_src() override { return _src.end(); }
47 
48  // map access to jets --------------------------------------------------------
49 
50  bool empty() const override { return _map.empty(); }
51  size_t size() const override { return _map.size(); }
52  size_t count(unsigned int idkey) const override { return _map.count(idkey); }
53  void clear() override { Reset(); }
54 
55  const Jet* get(unsigned int idkey) const override;
56  Jet* get(unsigned int idkey) override;
57 
59  Jet* insert(Jet* jet) override;
60  size_t erase(unsigned int idkey) override { return _map.erase(idkey); }
61 
62  ConstIter begin() const override { return _map.begin(); }
63  ConstIter find(unsigned int idkey) const override { return _map.find(idkey); }
64  ConstIter end() const override { return _map.end(); }
65 
66  Iter begin() override { return _map.begin(); }
67  Iter find(unsigned int idkey) override { return _map.find(idkey); }
68  Iter end() override { return _map.end(); }
69 
70  std::vector<Jet*> vec() override; // defaulted to PT in JetMap.h
71 
72  private:
73  Jet::ALGO _algo = Jet::NONE; //< algorithm used to reconstruct jets
74  float _par = NAN; //< algorithm parameter setting (e.g. radius)
75  std::set<Jet::SRC> _src; //< list of sources (clusters, towers, etc)
76  typ_JetMap _map; //< jet algorithm output storage
77 
79 };
80 
81 #endif