StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMuTofHitCollection.cxx
1 /****************************************************************
2  * $Id: StMuTofHitCollection.cxx,v 1.2 2004/04/06 01:48:09 perev Exp $
3  *
4  * Author: Xin Dong, April 2004
5  *
6  *****************************************************************
7  * Description:
8  * TOF hits collection for Micro Dst
9  *
10  *****************************************************************
11  *
12  * $Log: StMuTofHitCollection.cxx,v $
13  * Revision 1.2 2004/04/06 01:48:09 perev
14  * Small leak + incorrect filing StMuTofHitCollection
15  *
16  * Revision 1.1 2004/04/02 03:39:12 jeromel
17  * New files for TTOF
18  *
19  ****************************************************************/
20 
21 #include <memory>
22 
23 #include "StGlobals.hh"
24 
25 #include "StMuTofHitCollection.h"
26 
27 StMuTofHitCollection::StMuTofHitCollection()
28 { }
29 
30 StMuTofHitCollection::~StMuTofHitCollection()
31 {
32  clear();
33 }
34 
35 void
36 StMuTofHitCollection::clear()
37 {
38  int n = mHitVector.size();
39  for (int i=0;i<n;i++) { delete mHitVector[i];}
40  mHitVector.clear();
41 }
42 
43 bool
44 StMuTofHitCollection::push_back(StMuTofHit* hit)
45 {
46  mHitVector.push_back(hit);
47  return true;
48 }
49 
51 StMuTofHitCollection::front() const
52 {
53  return mHitVector.front();
54 }
55 
57 StMuTofHitCollection::getHit(size_t index) const
58 {
59  return mHitVector[index];
60 }
61 
63 StMuTofHitCollection::back() const
64 {
65  return mHitVector.back();
66 }
67 
68 size_t
69 StMuTofHitCollection::size() const
70 {
71  return mHitVector.size();
72 }
73