StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StRnDHitCollection.cxx
1 /***************************************************************************
2  *
3  * $Id: StRnDHitCollection.cxx,v 2.1 2006/01/19 21:42:06 ullrich Exp $
4  *
5  * Author: Thomas Ullrich, Jan 2006
6  ***************************************************************************
7  *
8  * Description:
9  *
10  ***************************************************************************
11  *
12  * $Log: StRnDHitCollection.cxx,v $
13  * Revision 2.1 2006/01/19 21:42:06 ullrich
14  * Initial Revision.
15  *
16  **************************************************************************/
17 #include "StRnDHitCollection.h"
18 #include "StRnDHit.h"
19 
20 ClassImp(StRnDHitCollection)
21 
22 StRnDHitCollection::StRnDHitCollection() { /* noop */ }
23 
24 StRnDHitCollection::~StRnDHitCollection()
25 {
26  //
27  // Usually this wouldn't be necessary but mHits
28  // is a polymorphic container and StRnDHit
29  // provides its own new/delete operator.
30  //
31  for (unsigned int i=0; i<mHits.size(); i++) {
32  delete mHits[i];
33  mHits[i] = 0;
34  }
35 }
36 
37 bool
38 StRnDHitCollection::addHit(StRnDHit* hit)
39 {
40  if (hit) {
41  mHits.push_back(hit);
42  return true;
43  }
44  else
45  return false;
46 }
47