StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMcIstLadderHitCollection.cc
1 /***************************************************************************
2  *
3  *
4  * Author: Amilkar Quintero, Feb 2015
5  ***************************************************************************
6  *
7  * Description: Monte Carlo Ist Ladder Hit Collection class
8  *
9  ***************************************************************************
10  *
11  *
12  **************************************************************************/
13 #include "TBrowser.h"
14 #include "StMcIstLadderHitCollection.hh"
15 #include "StMcIstHit.hh"
16 static const char rcsid[] = "$Id: StMcIstLadderHitCollection.cc,v 2.1 2015/03/12 23:23:43 perev Exp $";
17 
19 
20 //_____________________________________________________________________________
22 //_____________________________________________________________________________
23 StMcIstLadderHitCollection::~StMcIstLadderHitCollection(){ Clear(); }
24 //_____________________________________________________________________________
25 void StMcIstLadderHitCollection::Clear(const char*)
26 {
27  /*for (int i=0; i<(int)mSensors.size(); i++)
28  {
29  delete mSensors[i]; mSensors[i] = 0;
30  }*/
31  //mSensors.clear();
32 }
33 
34 //_____________________________________________________________________________
35 StMcIstSensorHitCollection* StMcIstLadderHitCollection::sensor(unsigned int i)
36 {
37  if (i < numberOfSensors())
38  return &(mSensors[i]);
39  else
40  return 0;
41 }
42 //_____________________________________________________________________________
43 const StMcIstSensorHitCollection* StMcIstLadderHitCollection::sensor(unsigned int i) const {
44  if (i < numberOfSensors())
45  return &(mSensors[i]);
46  else
47  return 0;
48 }
49 
50 //_____________________________________________________________________________
51 unsigned long StMcIstLadderHitCollection::numberOfHits() const
52 {
53  unsigned long sum = 0;
54  for (unsigned int j=0; j<numberOfSensors(); j++) {
55  sum += mSensors[j].hits().size();
56  }
57  return sum;
58 }