StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StRpsCollection.cxx
1 /***************************************************************************
2  *
3  * $Id: StRpsCollection.cxx,v 2.3 2015/10/02 19:50:50 ullrich Exp $
4  *
5  * Author: Thomas Ullrich, Nov 2009
6  ***************************************************************************
7  *
8  * Description:
9  *
10  ***************************************************************************
11  *
12  * $Log: StRpsCollection.cxx,v $
13  * Revision 2.3 2015/10/02 19:50:50 ullrich
14  * Added containers for tracks and points.
15  *
16  * Revision 2.2 2010/02/04 18:16:09 ullrich
17  * Added new member mSiliconBunch and referring access methods.
18  *
19  * Revision 2.1 2009/11/23 22:18:25 ullrich
20  * Initial Revision
21  *
22  **************************************************************************/
23 #include "StRpsCollection.h"
24 #include "StRpsPlane.h"
25 
26 static const char rcsid[] = "$Id: StRpsCollection.cxx,v 2.3 2015/10/02 19:50:50 ullrich Exp $";
27 
28 ClassImp(StRpsCollection)
29 
31 {
32  //
33  // Set up all the roman pot and plane IDs
34  //
35  for (unsigned int i=0; i<mNumberOfRomanPots; i++) { // Roman Pots
36  mRomanPots[i].setRomanPotId(static_cast<unsigned char>(i));
37  for (unsigned int j=0; j<mRomanPots[i].numberOfPlanes(); j++) { // planes
38  mRomanPots[i].plane(j)->setPlaneId(static_cast<unsigned char>(j));
39  mRomanPots[i].plane(j)->setRomanPotId(static_cast<unsigned char>(i));
40  }
41  }
42  mSiliconBunch = 0;
43 }
44 
45 StRpsCollection::~StRpsCollection() { /* no op */ }
46 
47 unsigned int
48 StRpsCollection::numberOfRomanPots() const
49 {
50  return mNumberOfRomanPots;
51 }
52 
53 const StRpsRomanPot*
54 StRpsCollection::romanPot(unsigned int i) const
55 {
56  if (i < mNumberOfRomanPots)
57  return &mRomanPots[i];
58  else
59  return 0;
60 }
61 
63 StRpsCollection::romanPot(unsigned int i)
64 {
65  if (i < mNumberOfRomanPots)
66  return &mRomanPots[i];
67  else
68  return 0;
69 }
70 
71 StPtrVecRpsCluster
72 StRpsCollection::clusters() const
73 {
74  StPtrVecRpsCluster vec;
75  for (unsigned int i=0; i<mNumberOfRomanPots; i++) {
76  const StRpsRomanPot *seq = &mRomanPots[i];
77  for (unsigned int j=0; j<seq->numberOfPlanes(); j++) {
78  const StRpsPlane *plane = seq->plane(j);
79  for (unsigned int k=0; k<plane->numberOfClusters(); k++)
80  vec.push_back(plane->cluster(k));
81  }
82  }
83  return vec;
84 }
85 
86 StPtrVecRpsTrackPoint StRpsCollection::trackPoints() const {
87  StPtrVecRpsTrackPoint trackPointsVec;
88  for (unsigned int i=0; i<mTrackPoints.size(); ++i) {
89  trackPointsVec.push_back( mTrackPoints[i] );
90  }
91  return trackPointsVec;
92 }
93 
94 StPtrVecRpsTrack StRpsCollection::tracks() const {
95  StPtrVecRpsTrack tracksVec;
96  for(unsigned int i=0; i<mTracks.size(); ++i){
97  tracksVec.push_back( mTracks[i] );
98  }
99  return tracksVec;
100 }
101 
102 unsigned char
103 StRpsCollection::siliconBunch() const
104 {
105  return mSiliconBunch;
106 }
107 
108 void
109 StRpsCollection::setSiliconBunch(unsigned char val)
110 {
111  mSiliconBunch = val;
112 }
113