StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMcIstSensorHitCollection.cc
1 /***************************************************************************
2  *
3  *
4  * Author: Amilkar Quintero, Feb 2015
5  ***************************************************************************
6  *
7  * Description: Monte Carlo Ist Sensor Hit Collection class
8  *
9  ***************************************************************************/
10 #include "TBrowser.h"
11 #include "StMcIstSensorHitCollection.hh"
12 #include "StMcIstHit.hh"
13 
14 static const char rcsid[] = "$Id: StMcIstSensorHitCollection.cc,v 2.1 2015/03/12 23:23:43 perev Exp $";
16 //_____________________________________________________________________________
17 StMcIstSensorHitCollection::StMcIstSensorHitCollection() { /* noop */ }
18 
19 //_____________________________________________________________________________
20 StMcIstSensorHitCollection::~StMcIstSensorHitCollection()
21 {
22  // StMcIstHit provides its own new/delete operator, and
23  // mHits is a polymorphic container, so we need to do this.
24  Clear();
25 }
26 //_____________________________________________________________________________
27 const StSPtrVecMcIstHit& StMcIstSensorHitCollection::hits() const { return mHits; }
28 
29 //_____________________________________________________________________________
30 StSPtrVecMcIstHit& StMcIstSensorHitCollection::hits() { return mHits; }
31 //_____________________________________________________________________________
32 void StMcIstSensorHitCollection::Clear(const char*)
33 {
34  for (int i=0; i<(int)mHits.size(); i++)
35  {
36  delete mHits[i]; mHits[i] = 0;
37  }
38  mHits.clear();
39 }
40 //_____________________________________________________________________________
41 /*void StMcIstSensorHitCollection::Browse(TBrowser *b)
42 {
43  // Browse this event (called by TBrowser).
44  for (int i=0; i<(int)mHits.size(); i++) {
45  TObject *obj = mHits[i]; if (!obj) continue;
46  TString ts(obj->GetName()); ts+="#"; ts+=i;
47  b->Add(obj,ts.Data());
48  }
49 }*/