StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMcFtpcPlaneHitCollection.cc
1 /***************************************************************************
2  *
3  * $Id: StMcFtpcPlaneHitCollection.cc,v 2.2 2012/03/01 16:48:29 perev Exp $
4  *
5  * Author: Manuel Calderon de la Barca Sanchez, Oct 1999
6  ***************************************************************************
7  *
8  * Description: Monte Carlo Ftpc Plane Hit Collection class
9  *
10  ***************************************************************************
11  *
12  * $Log: StMcFtpcPlaneHitCollection.cc,v $
13  * Revision 2.2 2012/03/01 16:48:29 perev
14  * method Browse() added
15  *
16  * Revision 2.1 2005/01/27 23:40:47 calderon
17  * Adding persistency to StMcEvent as a step for Virtual MonteCarlo.
18  *
19  * Revision 2.0 1999/11/17 02:00:59 calderon
20  * Completely revised for new StEvent
21  *
22  *
23  **************************************************************************/
24 #include "TBrowser.h"
25 #include "StMcFtpcPlaneHitCollection.hh"
26 #include "StMcFtpcHit.hh"
27 static const char rcsid[] = "$Id: StMcFtpcPlaneHitCollection.cc,v 2.2 2012/03/01 16:48:29 perev Exp $";
28 
30 
31 //_____________________________________________________________________________
33 StMcFtpcPlaneHitCollection::~StMcFtpcPlaneHitCollection(){ Clear(); }
34 //_____________________________________________________________________________
35 void StMcFtpcPlaneHitCollection::Clear(const char*)
36 {
37  for (int i=0; i<(int)mHits.size(); i++)
38  {
39  delete mHits[i]; mHits[i] = 0;
40  }
41  mHits.clear();
42 }
43 //_____________________________________________________________________________
44 void StMcFtpcPlaneHitCollection::Browse(TBrowser *b)
45 {
46  // Browse this event (called by TBrowser).
47  for (int i=0; i<(int)mHits.size(); i++) {
48  TObject *obj = mHits[i]; if (!obj) continue;
49  TString ts(obj->GetName()); ts+="#"; ts+=i;
50  b->Add(obj,ts.Data());
51  }
52 }
53 
54 
55 //_____________________________________________________________________________
56 const StSPtrVecMcFtpcHit& StMcFtpcPlaneHitCollection::hits() const { return mHits; }
57 
58 //_____________________________________________________________________________
59 StSPtrVecMcFtpcHit& StMcFtpcPlaneHitCollection::hits() { return mHits; }
60 
61 //_____________________________________________________________________________
62 unsigned long StMcFtpcPlaneHitCollection::numberOfHits() const
63 {
64  return mHits.size();
65 }