StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTofCollection.cxx
1 /***************************************************************************
2  *
3  * $Id: StTofCollection.cxx,v 2.10 2008/06/03 17:41:28 ullrich Exp $
4  *
5  * Author: Thomas Ullrich, Dec 2000
6  ***************************************************************************
7  *
8  * Description:
9  *
10  * Persistent data which is written into StEvent
11  * directly from the reco chain. All ToF stuff goes here
12  * except the StTofPidTraits and the StTofSoftwareMonitor.
13  *
14  ***************************************************************************
15  *
16  * $Log: StTofCollection.cxx,v $
17  * Revision 2.10 2008/06/03 17:41:28 ullrich
18  * Assign defaults values in constructor.
19  *
20  * Revision 2.9 2007/08/27 22:57:49 ullrich
21  * Fixed problem in numberOfVpdEast() and numberOfVpdWest() - X. Dong
22  *
23  * Revision 2.8 2007/04/03 18:16:48 ullrich
24  * Add new data members and methods in preperation for new ToF.
25  *
26  * Revision 2.7 2005/04/11 22:35:25 calderon
27  * Tof Classes for Run 5. Modifications and additions from Xin to
28  * take care of new TOF daq and electronics. Added StTofRawData and
29  * modified containers and includes.
30  *
31  * Revision 2.6 2003/05/23 20:06:12 ullrich
32  * Restore plural for data members.
33  *
34  * Revision 2.5 2003/05/23 16:10:59 ullrich
35  * Changed name of access functions.
36  *
37  * Revision 2.4 2003/05/21 18:22:46 ullrich
38  * Major Revision of ToF classes (F. Geurts)
39  *
40  * Revision 2.3 2001/10/01 19:40:58 ullrich
41  * Added methods and members for StTofData.
42  *
43  * Revision 2.2 2001/04/24 18:20:13 ullrich
44  * Added hits and slats to collection.
45  *
46  * Revision 2.1 2000/12/08 03:52:42 ullrich
47  * Initial Revision
48  *
49  **************************************************************************/
50 #include "StTofCollection.h"
51 
52 static const char rcsid[] = "$Id: StTofCollection.cxx,v 2.10 2008/06/03 17:41:28 ullrich Exp $";
53 
54 ClassImp(StTofCollection)
55 
57  mVpdEast = 0;
58  mVpdWest = 0;
59  mTstart = -999.;
60  mTdiff = -999.;
61  mVzVpd = -999.;
62 }
63 
64 StTofCollection::~StTofCollection() { /* noop */ }
65 
66 const StSPtrVecTofCell&
67 StTofCollection::tofCells() const
68 {
69  return mTofCells;
70 }
71 
72 StSPtrVecTofCell&
73 StTofCollection::tofCells()
74 {
75  return mTofCells;
76 }
77 
78 const StSPtrVecTofSlat&
79 StTofCollection::tofSlats() const
80 {
81  return mTofSlats;
82 }
83 
84 StSPtrVecTofSlat&
85 StTofCollection::tofSlats()
86 {
87  return mTofSlats;
88 }
89 
90 const StSPtrVecTofHit&
91 StTofCollection::tofHits() const
92 {
93  return mTofHits;
94 }
95 
96 StSPtrVecTofHit&
97 StTofCollection::tofHits()
98 {
99  return mTofHits;
100 }
101 
102 const StSPtrVecTofData&
103 StTofCollection::tofData() const
104 {
105  return mTofData;
106 }
107 
108 StSPtrVecTofData&
109 StTofCollection::tofData()
110 {
111  return mTofData;
112 }
113 
114 const StSPtrVecTofRawData&
115 StTofCollection::tofRawData() const
116 {
117  return mTofRawData;
118 }
119 
120 StSPtrVecTofRawData&
121 StTofCollection::tofRawData()
122 {
123  return mTofRawData;
124 }
125 
126 void
127 StTofCollection::addCell(const StTofCell* aCell)
128 {
129  if (aCell) mTofCells.push_back(aCell);
130 }
131 
132 void
133 StTofCollection::addSlat(const StTofSlat* aSlat)
134 {
135  if (aSlat) mTofSlats.push_back(aSlat);
136 }
137 
138 void
139 StTofCollection::addHit(const StTofHit* aHit)
140 {
141  if (aHit) mTofHits.push_back(aHit);
142 }
143 
144 void
145 StTofCollection::addData(const StTofData* aData)
146 {
147  if (aData) mTofData.push_back(aData);
148 }
149 
150 void
151 StTofCollection::addRawData(const StTofRawData* aRawData)
152 {
153  if (aRawData) mTofRawData.push_back(aRawData);
154 }
155 
156 
157 bool
158 StTofCollection::cellsPresent() const
159 {
160  return mTofCells.size();
161 }
162 
163 bool
164 StTofCollection::slatsPresent() const
165 {
166  return mTofSlats.size();
167 }
168 
169 bool
170 StTofCollection::hitsPresent() const
171 {
172  return mTofHits.size();
173 }
174 
175 bool
176 StTofCollection::dataPresent() const
177 {
178  return mTofData.size();
179 }
180 
181 bool
182 StTofCollection::rawdataPresent() const
183 {
184  return mTofRawData.size();
185 }
186 
187 unsigned int
188 StTofCollection::numberOfVpdEast() const
189 {
190  unsigned int num = 0;
191  for(int i=0;i<32;i++) {
192  num += mVpdEast>>i & 1;
193  }
194  return num;
195 }
196 
197 unsigned int
198 StTofCollection::numberOfVpdWest() const
199 {
200  unsigned int num = 0;
201  for(int i=0;i<32;i++) {
202  num += mVpdWest>>i & 1;
203  }
204  return num;
205 }