StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFstSensorHitCollection.cxx
1 /***************************************************************************
2 * $Id: StFstSensorHitCollection.cxx$
3 *
4 * Author: Shenghui Zhang, Oct. 2021
5 ****************************************************************************
6 * Description:
7 * See header file.
8 ***************************************************************************/
9 
10 #include "StFstSensorHitCollection.h"
11 #include "StFstHit.h"
12 
14 
16 
17 StFstSensorHitCollection::~StFstSensorHitCollection()
18 {
19  // Usually this wouldn't be necessary but mHits is a polymorphic container and StFstHit provides
20  // its own new/delete operator
21  for (unsigned int i=0; i<mHits.size(); i++) {
22  delete mHits[i];
23  mHits[i] = 0;
24  }
25 }
26 
27 unsigned int StFstSensorHitCollection::numberOfHits() const
28 {
29  return mHits.size();
30 }
31 
32 const StSPtrVecFstHit & StFstSensorHitCollection::hits() const { return mHits; }
33 
34 StSPtrVecFstHit & StFstSensorHitCollection::hits() { return mHits; }
35 
36 
37 /***************************************************************************
38 * StFstSensorHitCollection.cxx,v 1.0
39 * Revision 1.0 2021/10/04 Shenghui Zhang
40 * Initial version
41 ****************************************************************************/