StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMuETofHeader.cxx
1 /***************************************************************************
2  *
3  * $Id: StMuETofHeader.cxx,v 1.2 2021/05/11 19:40:43 jdb Exp $
4  *
5  * Author: Florian Seck, November 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 in MuDsts
11  *
12  ***************************************************************************
13  *
14  * $Log: StMuETofHeader.cxx,v $
15  * Revision 1.2 2021/05/11 19:40:43 jdb
16  * StETofHeader update from philipp W. modified classes to include the front-end missmatch pattern
17  *
18  * Revision 1.1 2019/02/21 13:32:54 jdb
19  * Inclusion of ETOF MuDst code. This code adds support for the full set of ETOF data which includes EtofDigi, EtofHit, EtofHeader. The code essentially copies similar structures from StEvent and additionally rebuilds the maps between Digis and Hits. Accessor methods are added based on the pattern from BTOF to provide access to data at various levels. The code for accessing the PID traits provided by ETOF is also provided
20  *
21  *
22  ***************************************************************************/
23 #include "StMuETofHeader.h"
24 #include "StETofHeader.h"
25 #include "StETofUtil/StETofConstants.h"
26 
27 
28 StMuETofHeader::StMuETofHeader()
29 : mTrgGdpbFullTime( 0 ),
30  mTrgStarFullTime( 0 ),
31  mStarToken( 0 ),
32  mStarDaqCmdIn( 0 ),
33  mStarTrgCmdIn( 0 ),
34  mEventStatusFlag( 0 ),
35  mMissMatchFlagVec( eTofConst::nGet4sInSystem, false ),
36  mGoodEventFlagVec( eTofConst::nCountersInSystem, false )
37 {
38  mRocGdpbTs.clear();
39  mRocStarTs.clear();
40 }
41 
42 
43 StMuETofHeader::StMuETofHeader( const double& trgGdpbTime, const double& trgStarTime,
44  const std::map< unsigned int, uint64_t >& gdpbTs, const std::map< unsigned int, uint64_t >& starTs,
45  const unsigned int& starToken, const unsigned int& starDaqCmdIn, const unsigned int& starTrgCmdIn,
46  const uint64_t& eventStatusFlag )
47 : mTrgGdpbFullTime( trgGdpbTime ),
48  mTrgStarFullTime( trgStarTime ),
49  mStarToken( starToken ),
50  mStarDaqCmdIn( starDaqCmdIn ),
51  mStarTrgCmdIn( starTrgCmdIn ),
52  mEventStatusFlag( eventStatusFlag ),
53  mMissMatchFlagVec( eTofConst::nGet4sInSystem, false ),
54  mGoodEventFlagVec( eTofConst::nCountersInSystem, false )
55 {
56  setRocGdpbTs( gdpbTs );
57  setRocStarTs( starTs );
58 }
59 
60 StMuETofHeader::StMuETofHeader( const double& trgGdpbTime, const double& trgStarTime,
61  const map< unsigned int, uint64_t >& gdpbTs, const map< unsigned int, uint64_t >& starTs,
62  const unsigned int& starToken, const unsigned int& starDaqCmdIn, const unsigned int& starTrgCmdIn,
63  const uint64_t& eventStatusFlag, const std::vector< Bool_t >& MissMatchFlagVec )
64 : mTrgGdpbFullTime( trgGdpbTime ),
65  mTrgStarFullTime( trgStarTime ),
66  mStarToken( starToken ),
67  mStarDaqCmdIn( starDaqCmdIn ),
68  mStarTrgCmdIn( starTrgCmdIn ),
69  mEventStatusFlag( eventStatusFlag ),
70  mMissMatchFlagVec( MissMatchFlagVec ),
71  mGoodEventFlagVec( eTofConst::nCountersInSystem, false )
72 {
73  setRocGdpbTs( gdpbTs );
74  setRocStarTs( starTs );
75 }
76 
77 StMuETofHeader::StMuETofHeader( const double& trgGdpbTime, const double& trgStarTime,
78  const map< unsigned int, uint64_t >& gdpbTs, const map< unsigned int, uint64_t >& starTs,
79  const unsigned int& starToken, const unsigned int& starDaqCmdIn, const unsigned int& starTrgCmdIn,
80  const uint64_t& eventStatusFlag, const std::vector<bool>& MissMatchFlagVec, const std::vector<bool>& GoodEventFlagVec )
81 : mTrgGdpbFullTime( trgGdpbTime ),
82  mTrgStarFullTime( trgStarTime ),
83  mStarToken( starToken ),
84  mStarDaqCmdIn( starDaqCmdIn ),
85  mStarTrgCmdIn( starTrgCmdIn ),
86  mEventStatusFlag( eventStatusFlag ),
87  mMissMatchFlagVec( MissMatchFlagVec ),
88  mGoodEventFlagVec( GoodEventFlagVec )
89 {
90  setRocGdpbTs( gdpbTs );
91  setRocStarTs( starTs );
92 }
93 
94 StMuETofHeader::StMuETofHeader( const StETofHeader* header )
95 : mTrgGdpbFullTime( header->trgGdpbFullTime() ),
96  mTrgStarFullTime( header->trgStarFullTime() ),
97  mStarToken( header->starToken() ),
98  mStarDaqCmdIn( header->starDaqCmdIn() ),
99  mStarTrgCmdIn( header->starTrgCmdIn() ),
100  mEventStatusFlag( header->eventStatusFlag() ),
101  mMissMatchFlagVec(header->missMatchFlagVec()),
102  mGoodEventFlagVec(header->goodEventFlagVec())
103 {
104  setRocGdpbTs( header->rocGdpbTs() );
105  setRocStarTs( header->rocStarTs() );
106 }
107 
108 StMuETofHeader::~StMuETofHeader()
109 {/* no op */}
110 
111 double
112 StMuETofHeader::trgGdpbFullTime() const
113 {
114  return mTrgGdpbFullTime;
115 }
116 
117 double
118 StMuETofHeader::trgStarFullTime() const
119 {
120  return mTrgStarFullTime;
121 }
122 
123 
124 std::map< unsigned int, uint64_t >
125 StMuETofHeader::rocGdpbTs() const
126 {
127  std::map< unsigned int, uint64_t > map_root_type( mRocGdpbTs.begin(), mRocGdpbTs.end() );
128 
129  return map_root_type;
130 }
131 
132 
133 std::map< unsigned int, uint64_t >
134 StMuETofHeader::rocStarTs() const
135 {
136  std::map< unsigned int, uint64_t > map_root_type( mRocStarTs.begin(), mRocStarTs.end() );
137 
138  return map_root_type;
139 }
140 
141 
142 unsigned int
143 StMuETofHeader::starToken() const
144 {
145  return mStarToken;
146 }
147 
148 
149 unsigned int
150 StMuETofHeader::starDaqCmdIn() const
151 {
152  return mStarDaqCmdIn;
153 }
154 
155 
156 unsigned int
157 StMuETofHeader::starTrgCmdIn() const
158 {
159  return mStarTrgCmdIn;
160 }
161 
162 
163 uint64_t
164 StMuETofHeader::eventStatusFlag() const
165 {
166  return mEventStatusFlag;
167 }
168 
169 
170 std::vector < Bool_t >
172 {
173  return mMissMatchFlagVec;
174 }
175 
176 std::vector <bool>
178 {
179  return mGoodEventFlagVec;
180 }
181 std::vector <bool>
182 StMuETofHeader::hasPulsersVec() const
183 {
184  return mHasPulsersVec;
185 }
186 
187 void
188 StMuETofHeader::setTrgGdpbFullTime( const double& gdpbFullTime )
189 {
190  mTrgGdpbFullTime = gdpbFullTime;
191 }
192 
193 
194 void
195 StMuETofHeader::setTrgStarFullTime( const double& starFullTime )
196 {
197  mTrgStarFullTime = starFullTime;
198 }
199 
200 
201 void
202 StMuETofHeader::setRocGdpbTs( const std::map< unsigned int, uint64_t >& gdpbTs )
203 {
204  mRocGdpbTs.insert( gdpbTs.begin(), gdpbTs.end() );
205 }
206 
207 
208 void
209 StMuETofHeader::setRocStarTs( const std::map< unsigned int, uint64_t >& starTs )
210 {
211  mRocStarTs.insert( starTs.begin(), starTs.end() );
212 }
213 
214 
215 void
216 StMuETofHeader::setStarToken( const unsigned int& token )
217 {
218  mStarToken = token;
219 }
220 
221 
222 void
223 StMuETofHeader::setStarDaqCmdIn( const unsigned int& daqCmdIn )
224 {
225  mStarDaqCmdIn = daqCmdIn;
226 }
227 
228 
229 void
230 StMuETofHeader::setStarTrgCmdIn( const unsigned int& trgCmdIn )
231 {
232  mStarTrgCmdIn = trgCmdIn;
233 }
234 
235 
236 void
237 StMuETofHeader::setEventStatusFlag( const uint64_t& statusFlag )
238 {
239  mEventStatusFlag = statusFlag;
240 }
241 
242 void
243 StMuETofHeader::setGoodEventFlagVec( const std::vector<bool>& FlagVec )
244 {
245  mGoodEventFlagVec = FlagVec;
246 }
247 void
248 StMuETofHeader::setHasPulsersVec( const std::vector<bool>& PulserVec )
249 {
250  mHasPulsersVec = PulserVec;
251 }
std::vector< bool > missMatchFlagVec() const
Flag for each Get4 TDC to mark if it is available in this event.
std::vector< bool > goodEventFlagVec() const
Flag to mark if the event is good for physics analysis for each counter. A counter is considered good...