LDMX Software
Public Member Functions | Public Attributes | List of all members
packing::FiberTrackerBinaryPacket Struct Reference

Each one of these packets represents an entire spill of data. More...

Public Member Functions

bool next (FiberTrackerEvent &e)
 
utility::Readerread (utility::Reader &r)
 27 fields in order, all are present
 

Public Attributes

int acqMode
 
long int acqStamp
 
int acqType
 
int acqTypeAllowed
 
std::string coincidenceInUse
 
int counts
 
long int countsRecords
 
long int countsRecordsWithZeroEvents
 
long int countsTrigs
 
std::string cycleName
 
long int cycleStamp
 
std::string equipmentName
 
int eventSelectionAcq
 
std::vector< FiberTrackerEventeventsData
 This is the actual event data in which we are interested.
 
int i_event {0}
 index of event we are on (for next)
 
double meanSNew
 
std::string message
 
std::vector< double > profile
 
std::vector< double > profileStandAlone
 
std::string timeFirstEvent
 
std::string timeFirstTrigger
 
std::string timeLastEvent
 
std::string timeLastTrigger
 
int trigger
 
int triggerOffsetAcq
 
int triggerSelectionAcq
 

Detailed Description

Each one of these packets represents an entire spill of data.

Definition at line 159 of file FiberTrackerRawDecoder.cxx.

Member Function Documentation

◆ next()

bool packing::FiberTrackerBinaryPacket::next ( FiberTrackerEvent e)
inline

Definition at line 192 of file FiberTrackerRawDecoder.cxx.

192 {
193 i_event++;
194 if (i_event < eventsData.size()) {
195 e = eventsData.at(i_event);
196 return true;
197 }
198 return false;
199 }
std::vector< FiberTrackerEvent > eventsData
This is the actual event data in which we are interested.
int i_event
index of event we are on (for next)

◆ read()

utility::Reader & packing::FiberTrackerBinaryPacket::read ( utility::Reader r)
inline

27 fields in order, all are present

Definition at line 204 of file FiberTrackerRawDecoder.cxx.

204 {
205 int i_field{0};
206 acqMode = FiberTrackerField(r, ++i_field).to_int();
207#ifdef DEBUG
208 std::cout << i_field << " "
209 << "acqMode = " << acqMode << std::endl;
210#endif
211 acqStamp = FiberTrackerField(r, ++i_field).to_long();
212#ifdef DEBUG
213 std::cout << i_field << " "
214 << "acqStamp = " << acqStamp << std::endl;
215#endif
216 acqType = FiberTrackerField(r, ++i_field).to_int();
217#ifdef DEBUG
218 std::cout << i_field << " "
219 << "acqType = " << acqType << std::endl;
220#endif
221 acqTypeAllowed = FiberTrackerField(r, ++i_field).to_int();
222#ifdef DEBUG
223 std::cout << i_field << " "
224 << "acqTypeAllowed = " << acqTypeAllowed << std::endl;
225#endif
226 coincidenceInUse = FiberTrackerField(r, ++i_field).to_string();
227#ifdef DEBUG
228 std::cout << i_field << " "
229 << "coincidenceInUse = " << coincidenceInUse << std::endl;
230#endif
231 counts = FiberTrackerField(r, ++i_field).to_int();
232#ifdef DEBUG
233 std::cout << i_field << " "
234 << "counts = " << counts << std::endl;
235#endif
236 countsRecords = FiberTrackerField(r, ++i_field).to_long();
237#ifdef DEBUG
238 std::cout << i_field << " "
239 << "countsRecords = " << countsRecords << std::endl;
240#endif
241 countsRecordsWithZeroEvents = FiberTrackerField(r, ++i_field).to_long();
242#ifdef DEBUG
243 std::cout << i_field << " "
244 << "countsRecordsWithZeroEvents = " << countsRecordsWithZeroEvents
245 << std::endl;
246#endif
247 countsTrigs = FiberTrackerField(r, ++i_field).to_long();
248#ifdef DEBUG
249 std::cout << i_field << " "
250 << "countsTrigs = " << countsTrigs << std::endl;
251#endif
252 cycleName = FiberTrackerField(r, ++i_field).to_string();
253#ifdef DEBUG
254 std::cout << i_field << " "
255 << "cycleName = " << cycleName << std::endl;
256#endif
257 cycleStamp = FiberTrackerField(r, ++i_field).to_long();
258#ifdef DEBUG
259 std::cout << i_field << " "
260 << "cycleStamp = " << cycleStamp << std::endl;
261#endif
262 equipmentName = FiberTrackerField(r, ++i_field).to_string();
263#ifdef DEBUG
264 std::cout << i_field << " "
265 << "equipmentName = " << equipmentName << std::endl;
266#endif
267 eventSelectionAcq = FiberTrackerField(r, ++i_field).to_int();
268#ifdef DEBUG
269 std::cout << i_field << " "
270 << "eventSelectionAcq = " << eventSelectionAcq << std::endl;
271#endif
272 FiberTrackerField events_data_field(r, ++i_field);
273 i_event = -1;
274 eventsData.clear();
275 eventsData.reserve(events_data_field.value().size() / 10);
276 for (std::size_t i_word{0}; i_word < events_data_field.value().size();
277 i_word += 10) {
278 eventsData.emplace_back(events_data_field.value(), i_word);
279 }
280#ifdef DEBUG
281 std::cout << i_field << " "
282 << "eventsData (size = " << eventsData.size() << ")" << std::endl;
283#endif
284 meanSNew = FiberTrackerField(r, ++i_field).to_double();
285#ifdef DEBUG
286 std::cout << i_field << " "
287 << "meanSNew = " << meanSNew << std::endl;
288#endif
289 message = FiberTrackerField(r, ++i_field).to_string();
290#ifdef DEBUG
291 std::cout << i_field << " "
292 << "message = " << message << std::endl;
293#endif
294 FiberTrackerField profile_field(r, ++i_field);
295 profile.clear();
296 profile.reserve(profile_field.value().size() / 2);
297 for (std::size_t i_word{0}; i_word < profile_field.value().size();
298 i_word += 2) {
299 profile.push_back(profile_field.to_double(i_word));
300 }
301#ifdef DEBUG
302 std::cout << i_field << " "
303 << "profile size " << profile.size() << std::endl;
304#endif
305 // fields 18 and 19 are skipped
306 i_field += 2;
307 FiberTrackerField profileStandAlone_field(r, ++i_field);
308 profileStandAlone.clear();
309 profileStandAlone.reserve(profileStandAlone_field.value().size() / 2);
310 for (std::size_t i_word{0}; i_word < profileStandAlone_field.value().size();
311 i_word += 2) {
312 profileStandAlone.push_back(profileStandAlone_field.to_double(i_word));
313 }
314#ifdef DEBUG
315 std::cout << i_field << " "
316 << "profileStandAlone size " << profileStandAlone.size()
317 << std::endl;
318#endif
319 timeFirstEvent = FiberTrackerField(r, ++i_field).to_string();
320#ifdef DEBUG
321 std::cout << i_field << " "
322 << "timeFirstEvent = " << timeFirstEvent << std::endl;
323#endif
324 timeFirstTrigger = FiberTrackerField(r, ++i_field).to_string();
325#ifdef DEBUG
326 std::cout << i_field << " "
327 << "timeFirstTrigger = " << timeFirstTrigger << std::endl;
328#endif
329 timeLastEvent = FiberTrackerField(r, ++i_field).to_string();
330#ifdef DEBUG
331 std::cout << i_field << " "
332 << "timeLastEvent = " << timeLastEvent << std::endl;
333#endif
334 timeLastTrigger = FiberTrackerField(r, ++i_field).to_string();
335#ifdef DEBUG
336 std::cout << i_field << " "
337 << "timeLastTrigger = " << timeLastTrigger << std::endl;
338#endif
339 trigger = FiberTrackerField(r, ++i_field).to_int();
340#ifdef DEBUG
341 std::cout << i_field << " "
342 << "trigger = " << trigger << std::endl;
343#endif
344 triggerOffsetAcq = FiberTrackerField(r, ++i_field).to_int();
345#ifdef DEBUG
346 std::cout << i_field << " "
347 << "triggerOffsetAcq = " << triggerOffsetAcq << std::endl;
348#endif
349 triggerSelectionAcq = FiberTrackerField(r, ++i_field).to_int();
350#ifdef DEBUG
351 std::cout << i_field << " "
352 << "triggerSelectionAcq = " << triggerSelectionAcq << std::endl;
353#endif
354 return r;
355 }

References eventsData, i_event, packing::FiberTrackerField::to_double(), packing::FiberTrackerField::to_int(), packing::FiberTrackerField::to_long(), packing::FiberTrackerField::to_string(), and packing::FiberTrackerField::value().

Member Data Documentation

◆ acqMode

int packing::FiberTrackerBinaryPacket::acqMode

Definition at line 160 of file FiberTrackerRawDecoder.cxx.

◆ acqStamp

long int packing::FiberTrackerBinaryPacket::acqStamp

Definition at line 161 of file FiberTrackerRawDecoder.cxx.

◆ acqType

int packing::FiberTrackerBinaryPacket::acqType

Definition at line 162 of file FiberTrackerRawDecoder.cxx.

◆ acqTypeAllowed

int packing::FiberTrackerBinaryPacket::acqTypeAllowed

Definition at line 163 of file FiberTrackerRawDecoder.cxx.

◆ coincidenceInUse

std::string packing::FiberTrackerBinaryPacket::coincidenceInUse

Definition at line 164 of file FiberTrackerRawDecoder.cxx.

◆ counts

int packing::FiberTrackerBinaryPacket::counts

Definition at line 165 of file FiberTrackerRawDecoder.cxx.

◆ countsRecords

long int packing::FiberTrackerBinaryPacket::countsRecords

Definition at line 166 of file FiberTrackerRawDecoder.cxx.

◆ countsRecordsWithZeroEvents

long int packing::FiberTrackerBinaryPacket::countsRecordsWithZeroEvents

Definition at line 167 of file FiberTrackerRawDecoder.cxx.

◆ countsTrigs

long int packing::FiberTrackerBinaryPacket::countsTrigs

Definition at line 168 of file FiberTrackerRawDecoder.cxx.

◆ cycleName

std::string packing::FiberTrackerBinaryPacket::cycleName

Definition at line 169 of file FiberTrackerRawDecoder.cxx.

◆ cycleStamp

long int packing::FiberTrackerBinaryPacket::cycleStamp

Definition at line 170 of file FiberTrackerRawDecoder.cxx.

◆ equipmentName

std::string packing::FiberTrackerBinaryPacket::equipmentName

Definition at line 171 of file FiberTrackerRawDecoder.cxx.

◆ eventsData

std::vector<FiberTrackerEvent> packing::FiberTrackerBinaryPacket::eventsData

This is the actual event data in which we are interested.

Definition at line 176 of file FiberTrackerRawDecoder.cxx.

Referenced by read().

◆ eventSelectionAcq

int packing::FiberTrackerBinaryPacket::eventSelectionAcq

Definition at line 172 of file FiberTrackerRawDecoder.cxx.

◆ i_event

int packing::FiberTrackerBinaryPacket::i_event {0}

index of event we are on (for next)

Definition at line 178 of file FiberTrackerRawDecoder.cxx.

178{0};

Referenced by read().

◆ meanSNew

double packing::FiberTrackerBinaryPacket::meanSNew

Definition at line 180 of file FiberTrackerRawDecoder.cxx.

◆ message

std::string packing::FiberTrackerBinaryPacket::message

Definition at line 181 of file FiberTrackerRawDecoder.cxx.

◆ profile

std::vector<double> packing::FiberTrackerBinaryPacket::profile

Definition at line 182 of file FiberTrackerRawDecoder.cxx.

◆ profileStandAlone

std::vector<double> packing::FiberTrackerBinaryPacket::profileStandAlone

Definition at line 183 of file FiberTrackerRawDecoder.cxx.

◆ timeFirstEvent

std::string packing::FiberTrackerBinaryPacket::timeFirstEvent

Definition at line 184 of file FiberTrackerRawDecoder.cxx.

◆ timeFirstTrigger

std::string packing::FiberTrackerBinaryPacket::timeFirstTrigger

Definition at line 185 of file FiberTrackerRawDecoder.cxx.

◆ timeLastEvent

std::string packing::FiberTrackerBinaryPacket::timeLastEvent

Definition at line 186 of file FiberTrackerRawDecoder.cxx.

◆ timeLastTrigger

std::string packing::FiberTrackerBinaryPacket::timeLastTrigger

Definition at line 187 of file FiberTrackerRawDecoder.cxx.

◆ trigger

int packing::FiberTrackerBinaryPacket::trigger

Definition at line 188 of file FiberTrackerRawDecoder.cxx.

◆ triggerOffsetAcq

int packing::FiberTrackerBinaryPacket::triggerOffsetAcq

Definition at line 189 of file FiberTrackerRawDecoder.cxx.

◆ triggerSelectionAcq

int packing::FiberTrackerBinaryPacket::triggerSelectionAcq

Definition at line 190 of file FiberTrackerRawDecoder.cxx.


The documentation for this struct was generated from the following file: