Class Reference for E1039 Core & Analysis Software
SQHitMap.h
Go to the documentation of this file.
1 /*
2  * HitMap.h
3  *
4  * Created on: Oct 29, 2017
5  * Author: yuhw@nmsu.edu
6  */
7 
8 #ifndef _H_SQHitMap_H_
9 #define _H_SQHitMap_H_
10 
11 
12 #include <phool/PHObject.h>
13 
14 #include <map>
15 #include <iostream>
16 
17 #include "SQHit.h"
18 
20 
23 class SQHitMap : public PHObject {
24 
25 public:
26 
27  typedef std::map<unsigned int, SQHit*> HitMap;
28  typedef std::map<unsigned int, SQHit*>::const_iterator ConstIter;
29  typedef std::map<unsigned int, SQHit*>::iterator Iter;
30 
31  virtual ~SQHitMap() {}
32 
33  virtual void identify(std::ostream& os = std::cout) const {
34  os << "SQHitMap base class" << std::endl;
35  }
36  virtual void Reset() {}
37  virtual int isValid() const {return 0;}
38  virtual SQHitMap* Clone() const {return NULL;}
39 
40  virtual bool empty() const {return true;}
41  virtual size_t size() const {return 0;}
42  virtual size_t count(unsigned int idkey) const {return 0;}
43  virtual void clear() {}
44 
45  virtual const SQHit* get(unsigned int idkey) const {return NULL;}
46  virtual SQHit* get(unsigned int idkey) {return NULL;}
47  virtual SQHit* insert(const SQHit *hit) {return NULL;}
48  virtual size_t erase(unsigned int idkey) {return 0;}
49 
50  virtual ConstIter begin() const {return HitMap().end();}
51  virtual ConstIter find(unsigned int idkey) const {return HitMap().end();}
52  virtual ConstIter end() const {return HitMap().end();}
53 
54  virtual Iter begin() {return HitMap().end();}
55  virtual Iter find(unsigned int idkey) {return HitMap().end();}
56  virtual Iter end() {return HitMap().end();}
57 
58 protected:
59  SQHitMap() {}
60 
61 private:
62 
63  ClassDef(SQHitMap, 1);
64 };
65 
66 
67 
68 #endif /* _H_SQHitMap_H_ */
#define NULL
Definition: Pdb.h:9
An SQ interface class to hold a list of SQHit objects as std::map.
Definition: SQHitMap.h:23
std::map< unsigned int, SQHit * >::iterator Iter
Definition: SQHitMap.h:29
virtual size_t count(unsigned int idkey) const
Definition: SQHitMap.h:42
virtual ~SQHitMap()
Definition: SQHitMap.h:31
std::map< unsigned int, SQHit * >::const_iterator ConstIter
Definition: SQHitMap.h:28
virtual SQHit * insert(const SQHit *hit)
Definition: SQHitMap.h:47
virtual size_t size() const
Definition: SQHitMap.h:41
virtual void identify(std::ostream &os=std::cout) const
Definition: SQHitMap.h:33
virtual size_t erase(unsigned int idkey)
Definition: SQHitMap.h:48
virtual void clear()
Definition: SQHitMap.h:43
virtual const SQHit * get(unsigned int idkey) const
Definition: SQHitMap.h:45
virtual void Reset()
Clear Event.
Definition: SQHitMap.h:36
virtual Iter begin()
Definition: SQHitMap.h:54
virtual ConstIter end() const
Definition: SQHitMap.h:52
virtual Iter end()
Definition: SQHitMap.h:56
virtual Iter find(unsigned int idkey)
Definition: SQHitMap.h:55
SQHitMap()
Definition: SQHitMap.h:59
virtual int isValid() const
isValid returns non zero if object contains vailid data
Definition: SQHitMap.h:37
virtual ConstIter begin() const
Definition: SQHitMap.h:50
std::map< unsigned int, SQHit * > HitMap
Definition: SQHitMap.h:27
virtual SQHit * get(unsigned int idkey)
Definition: SQHitMap.h:46
virtual ConstIter find(unsigned int idkey) const
Definition: SQHitMap.h:51
virtual bool empty() const
Definition: SQHitMap.h:40
virtual SQHitMap * Clone() const
Definition: SQHitMap.h:38
An SQ interface class to hold one detector hit.
Definition: SQHit.h:20