Class Reference for E1039 Core & Analysis Software
SQHitVector_v1.h
Go to the documentation of this file.
1 /*
2  * SQHitVector_v1.h
3  *
4  * Created on: Oct 29, 2017
5  * Author: yuhw@nmsu.edu
6  */
7 
8 #ifndef _H_SQHitVector_v1_H_
9 #define _H_SQHitVector_v1_H_
10 
11 #include <phool/PHObject.h>
12 #include <map>
13 #include <iostream>
14 
15 #include "SQHit.h"
16 #include "SQHitVector.h"
17 
18 class SQHitVector_v1 : public SQHitVector {
19 
20 public:
21 
23  SQHitVector_v1(const SQHitVector_v1& hitmap);
24  SQHitVector_v1& operator=(const SQHitVector_v1& hitmap);
25  virtual ~SQHitVector_v1();
26 
27  void identify(std::ostream& os = std::cout) const;
28  void Reset();
29  int isValid() const {return 1;}
30  SQHitVector* Clone() const {return new SQHitVector_v1(*this);}
31 
32  bool empty() const {return _vector.empty();}
33  size_t size() const {return _vector.size();}
34  void clear() {Reset();}
35 
36  const SQHit* at(const size_t idkey) const;
37  SQHit* at(const size_t idkey);
38  void push_back(const SQHit *hit);
39  size_t erase(const size_t idkey) {
40  delete _vector[idkey];
41  _vector.erase(_vector.begin() + idkey);
42  return _vector.size();
43  }
44  Iter erase(Iter pos) { return _vector.erase(pos); }
45 
46  ConstIter begin() const {return _vector.begin();}
47  ConstIter end() const {return _vector.end();}
48 
49  Iter begin() {return _vector.begin();}
50  Iter end() {return _vector.end();}
51 
52 private:
53  HitVector _vector;
54 
55  ClassDef(SQHitVector_v1, 1);
56 };
57 
58 #endif
SQHitVector_v1 & operator=(const SQHitVector_v1 &hitmap)
size_t size() const
bool empty() const
int isValid() const
isValid returns non zero if object contains vailid data
Iter erase(Iter pos)
void Reset()
Clear Event.
ConstIter end() const
const SQHit * at(const size_t idkey) const
void push_back(const SQHit *hit)
SQHitVector * Clone() const
virtual ~SQHitVector_v1()
size_t erase(const size_t idkey)
void identify(std::ostream &os=std::cout) const
ConstIter begin() const
An SQ interface class to hold a list of SQHit objects.
Definition: SQHitVector.h:32
std::vector< SQHit * > HitVector
Definition: SQHitVector.h:36
std::vector< SQHit * >::const_iterator ConstIter
Definition: SQHitVector.h:37
std::vector< SQHit * >::iterator Iter
Definition: SQHitVector.h:38
An SQ interface class to hold one detector hit.
Definition: SQHit.h:20