StFms  0.0.0
FMS software in the STAR framework
StMuFmsCollection.cxx
Go to the documentation of this file.
1 /***************************************************************************
2  *
3  * $Id: StMuFmsCollection.cxx,v 1.2 2012/11/26 23:14:33 fisyak Exp $
4  *
5  * Author: Jingguo Ma, Dec 2009
6  ***************************************************************************
7  *
8  * Description: FMS data interface to StMuFmsHit, StMuFmsCluster and StMuFmsPoint
9  *
10  ***************************************************************************
11  *
12  * $Log: StMuFmsCollection.cxx,v $
13  * Revision 1.2 2012/11/26 23:14:33 fisyak
14  * Replace GetEntries() by GetEntriesFast(), fix print outs
15  *
16  * Revision 1.1 2010/01/25 03:57:39 tone421
17  * Added FMS and Roman pot arrays
18  *
19  **************************************************************************/
24 
25 static const char rcsid[] = "$Id: StMuFmsCollection.cxx,v 1.2 2012/11/26 23:14:33 fisyak Exp $";
26 
28 
29 StMuFmsCollection::StMuFmsCollection() { mHits = 0; mClusters = 0; mPoints = 0;}
30 
32  if (mHits) {
33  delete mHits;
34  } // if
35  if (mClusters) {
36  delete mClusters;
37  } // if
38  if (mPoints) {
39  delete mPoints;
40  } // if
41  mHits = mClusters = mPoints = NULL;
42 }
43 
45  mHits = new TClonesArray("StMuFmsHit", 0);
46  mClusters = new TClonesArray("StMuFmsCluster", 0);
47  mPoints = new TClonesArray("StMuFmsPoint", 0);
48 }
49 
51  if(!mHits) init();
52  int counter = mHits->GetEntriesFast();
53  new ((*mHits)[counter]) StMuFmsHit();
54  return;
55 }
56 
58  if (!mClusters) init();
59  int counter = mClusters->GetEntriesFast();
60  new ((*mClusters)[counter]) StMuFmsCluster;
61 }
62 
64  if (!mPoints) init();
65  int counter = mPoints->GetEntriesFast();
66  return new ((*mPoints)[counter]) StMuFmsPoint;
67 }
68 
69 unsigned int StMuFmsCollection::numberOfHits() const{
70  if(!mHits) return 0;
71  return mHits->GetEntriesFast();
72 }
73 
75  if (!mClusters) return 0;
76  return mClusters->GetEntriesFast();
77 }
78 
79 unsigned int StMuFmsCollection::numberOfPoints() const {
80  if (!mPoints) return 0;
81  return mPoints->GetEntriesFast();
82 }
83 
85  if(!mHits) return NULL;
86  return (StMuFmsHit*) mHits->At(hitId);
87 }
88 
90  if (!mClusters) return NULL;
91  return static_cast<StMuFmsCluster*>(mClusters->At(index));
92 }
93 
95  if (!mPoints) return NULL;
96  return static_cast<StMuFmsPoint*>(mPoints->At(index));
97 }
Declaration of StMuFmsPoint, the MuDST FMS "point" class.
unsigned int numberOfPoints() const
ClassImp(StMuFmsCollection) StMuFmsCollection
unsigned int numberOfClusters() const
TClonesArray * mClusters
StMuFmsPoint * addPoint()
StMuFmsCluster * getCluster(int index)
TClonesArray * mHits
unsigned int numberOfHits() const
Declaration of StMuFmsCluster, the MuDST FMS cluster class.
TClonesArray * mPoints
static const char rcsid[]
StMuFmsPoint * getPoint(int index)
StMuFmsHit * getHit(int hitId)