StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StETofHeader.cxx
1 /***************************************************************************
2  *
3  * $Id: StETofHeader.cxx,v 2.3 2021/03/19 19:55:56 ullrich Exp $
4  *
5  * Author: Pengfei Lyu, April 2018
6  ***************************************************************************
7  *
8  * Description: This class stores ETofHeader information from the DAQ stream,
9  * e.g. trigger time and STAR time (reset time stamp of the bTOF clock)
10  * and other event-wise information
11  *
12  ***************************************************************************
13  *
14  * $Log: StETofHeader.cxx,v $
15  * Revision 2.3 2021/03/19 19:55:56 ullrich
16  * include the front-end missmatch
17  *
18  * Revision 2.2 2018/07/27 13:44:55 jeromel
19  * Changes by Florian
20  *
21  * Revision 2.1 2018/07/09 14:53:48 ullrich
22  * Initial Revision.
23  *
24  *
25  ***************************************************************************/
26 #include "StETofHeader.h"
27 #include "StETofUtil/StETofConstants.h"
28 
29 #include <map>
30 #include <vector>
31 #include <iostream>
32 
33 StETofHeader::StETofHeader()
34 : mTrgGdpbFullTime( 0 ),
35  mTrgStarFullTime( 0 ),
36  mStarToken( 0 ),
37  mStarDaqCmdIn( 0 ),
38  mStarTrgCmdIn( 0 ),
39  mEventStatusFlag( 0 ),
40  mMissMatchFlagVec( eTofConst::nGet4sInSystem, false ),
41  mGoodEventFlagVec( eTofConst::nGet4sInSystem, false ),
42  mHasPulsersVec( eTofConst::nCountersInSystem, false )
43 {
44  mRocGdpbTs.clear();
45  mRocStarTs.clear();
46 }
47 
48 
49 StETofHeader::StETofHeader( const double& trgGdpbTime, const double& trgStarTime,
50  const map< unsigned int, uint64_t >& gdpbTs, const map< unsigned int, uint64_t >& starTs,
51  const unsigned int& starToken, const unsigned int& starDaqCmdIn, const unsigned int& starTrgCmdIn,
52  const uint64_t& eventStatusFlag )
53 : mTrgGdpbFullTime( trgGdpbTime ),
54  mTrgStarFullTime( trgStarTime ),
55  mStarToken( starToken ),
56  mStarDaqCmdIn( starDaqCmdIn ),
57  mStarTrgCmdIn( starTrgCmdIn ),
58  mEventStatusFlag( eventStatusFlag ),
59  mMissMatchFlagVec( eTofConst::nGet4sInSystem, false ),
60  mGoodEventFlagVec( eTofConst::nGet4sInSystem, false ),
61  mHasPulsersVec( eTofConst::nCountersInSystem, false )
62 {
63  setRocGdpbTs( gdpbTs );
64  setRocStarTs( starTs );
65 }
66 
67 StETofHeader::StETofHeader( const double& trgGdpbTime, const double& trgStarTime,
68  const map< unsigned int, uint64_t >& gdpbTs, const map< unsigned int, uint64_t >& starTs,
69  const unsigned int& starToken, const unsigned int& starDaqCmdIn, const unsigned int& starTrgCmdIn,
70  const uint64_t& eventStatusFlag, const std::vector<bool>& MissMatchFlagVec )
71 : mTrgGdpbFullTime( trgGdpbTime ),
72  mTrgStarFullTime( trgStarTime ),
73  mStarToken( starToken ),
74  mStarDaqCmdIn( starDaqCmdIn ),
75  mStarTrgCmdIn( starTrgCmdIn ),
76  mEventStatusFlag( eventStatusFlag ),
77  mMissMatchFlagVec( MissMatchFlagVec ),
78  mGoodEventFlagVec( eTofConst::nGet4sInSystem, false ),
79  mHasPulsersVec( eTofConst::nCountersInSystem, false )
80 {
81  setRocGdpbTs( gdpbTs );
82  setRocStarTs( starTs );
83 }
84 
85 StETofHeader::StETofHeader( const double& trgGdpbTime, const double& trgStarTime,
86  const map< unsigned int, uint64_t >& gdpbTs, const map< unsigned int, uint64_t >& starTs,
87  const unsigned int& starToken, const unsigned int& starDaqCmdIn, const unsigned int& starTrgCmdIn,
88  const uint64_t& eventStatusFlag, const std::vector<bool>& MissMatchFlagVec, const std::vector<bool>& GoodEventFlagVec, const std::vector<bool>& HasPulsersVec )
89 : mTrgGdpbFullTime( trgGdpbTime ),
90  mTrgStarFullTime( trgStarTime ),
91  mStarToken( starToken ),
92  mStarDaqCmdIn( starDaqCmdIn ),
93  mStarTrgCmdIn( starTrgCmdIn ),
94  mEventStatusFlag( eventStatusFlag ),
95  mMissMatchFlagVec( MissMatchFlagVec ),
96  mGoodEventFlagVec( GoodEventFlagVec ),
97  mHasPulsersVec( HasPulsersVec )
98 {
99  setRocGdpbTs( gdpbTs );
100  setRocStarTs( starTs );
101 }
102 
103 
104 StETofHeader::~StETofHeader()
105 {/* no op */}
106 
107 double
108 StETofHeader::trgGdpbFullTime() const
109 {
110  return mTrgGdpbFullTime;
111 }
112 
113 double
114 StETofHeader::trgStarFullTime() const
115 {
116  return mTrgStarFullTime;
117 }
118 
119 
120 map< unsigned int, uint64_t >
121 StETofHeader::rocGdpbTs() const
122 {
123  map< unsigned int, uint64_t > map_root_type( mRocGdpbTs.begin(), mRocGdpbTs.end() );
124 
125  return map_root_type;
126 }
127 
128 
129 map< unsigned int, uint64_t >
130 StETofHeader::rocStarTs() const
131 {
132  map< unsigned int, uint64_t > map_root_type( mRocStarTs.begin(), mRocStarTs.end() );
133 
134  return map_root_type;
135 }
136 
137 
138 unsigned int
139 StETofHeader::starToken() const
140 {
141  return mStarToken;
142 }
143 
144 
145 unsigned int
146 StETofHeader::starDaqCmdIn() const
147 {
148  return mStarDaqCmdIn;
149 }
150 
151 
152 unsigned int
153 StETofHeader::starTrgCmdIn() const
154 {
155  return mStarTrgCmdIn;
156 }
157 
158 
159 uint64_t
160 StETofHeader::eventStatusFlag() const
161 {
162  return mEventStatusFlag;
163 }
164 
165 std::vector <bool>
167 {
168  return mMissMatchFlagVec;
169 }
170 
171 std::vector <bool>
173 {
174  return mGoodEventFlagVec;
175 }
176 std::vector <bool>
177 StETofHeader::hasPulsersVec() const
178 {
179  return mHasPulsersVec;
180 }
181 
182 void
183 StETofHeader::setTrgGdpbFullTime( const double& gdpbFullTime )
184 {
185  mTrgGdpbFullTime = gdpbFullTime;
186 }
187 
188 
189 void
190 StETofHeader::setTrgStarFullTime( const double& starFullTime )
191 {
192  mTrgStarFullTime = starFullTime;
193 }
194 
195 
196 void
197 StETofHeader::setRocGdpbTs( const map< unsigned int, uint64_t >& gdpbTs )
198 {
199  mRocGdpbTs.insert( gdpbTs.begin(), gdpbTs.end() );
200 }
201 
202 
203 void
204 StETofHeader::setRocStarTs( const map< unsigned int, uint64_t >& starTs )
205 {
206  mRocStarTs.insert( starTs.begin(), starTs.end() );
207 }
208 
209 
210 void
211 StETofHeader::setStarToken( const unsigned int& token )
212 {
213  mStarToken = token;
214 }
215 
216 
217 void
218 StETofHeader::setStarDaqCmdIn( const unsigned int& daqCmdIn )
219 {
220  mStarDaqCmdIn = daqCmdIn;
221 }
222 
223 
224 void
225 StETofHeader::setStarTrgCmdIn( const unsigned int& trgCmdIn )
226 {
227  mStarTrgCmdIn = trgCmdIn;
228 }
229 
230 
231 void
232 StETofHeader::setEventStatusFlag( const uint64_t& statusFlag )
233 {
234  mEventStatusFlag = statusFlag;
235 }
236 
237 void
238 StETofHeader::setGoodEventFlagVec( const std::vector<bool>& FlagVec )
239 {
240  mGoodEventFlagVec = FlagVec;
241 }
242 
243 void
244 StETofHeader::setHasPulsersVec( const std::vector<bool>& PulserVec )
245 {
246  mHasPulsersVec = PulserVec;
247 }
std::vector< bool > goodEventFlagVec() const
Flag to mark if the event is good for physics analysis for each counter. A counter is considered good...
std::vector< bool > missMatchFlagVec() const
Flag for each Get4 TDC to mark if it is available in this event.