Class Reference for E1039 Core & Analysis Software
SQTrackVector_v1.cxx
Go to the documentation of this file.
1 #include "SQTrackVector_v1.h"
2 using namespace std;
4 
6 {
7  ;
8 }
9 
11 {
12  for (ConstIter iter = obj.begin(); iter != obj.end(); ++iter) {
13  _vector.push_back((*iter)->Clone());
14  }
15 }
16 
18 {
19  Reset();
20  for (ConstIter iter = obj.begin(); iter != obj.end(); ++iter) {
21  _vector.push_back((*iter)->Clone());
22  }
23  return *this;
24 }
25 
27 {
28  Reset();
29 }
30 
32 {
33  for (Iter iter = _vector.begin(); iter != _vector.end(); ++iter) delete *iter;
34  _vector.clear();
35 }
36 
37 void SQTrackVector_v1::identify(ostream& os) const
38 {
39  os << "SQTrackVector_v1: size = " << _vector.size() << endl;
40 }
41 
42 const SQTrack* SQTrackVector_v1::at(const size_t id) const
43 {
44  if (id >= _vector.size()) return nullptr;
45  return _vector[id];
46 }
47 
48 SQTrack* SQTrackVector_v1::at(const size_t id)
49 {
50  if (id >= _vector.size()) return nullptr;
51  return _vector[id];
52 }
53 
55 {
56  _vector.push_back(trk->Clone());
57 }
58 
59 size_t SQTrackVector_v1::erase(const size_t id)
60 {
61  delete _vector[id];
62  _vector.erase(_vector.begin() + id);
63  return _vector.size();
64 }
ClassImp(SQTrackVector_v1) SQTrackVector_v1
size_t erase(const size_t id)
ConstIter end() const
SQTrackVector_v1 & operator=(const SQTrackVector_v1 &obj)
const SQTrack * at(const size_t id) const
void Reset()
Clear Event.
void identify(std::ostream &os=std::cout) const
ConstIter begin() const
void push_back(const SQTrack *trk)
virtual ~SQTrackVector_v1()
std::vector< SQTrack * >::iterator Iter
Definition: SQTrackVector.h:23
std::vector< SQTrack * >::const_iterator ConstIter
Definition: SQTrackVector.h:22
An SQ interface class to hold one true or reconstructed track.
Definition: SQTrack.h:8
virtual SQTrack * Clone() const =0