Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
KM3NETDAQ::JDQSimulator::JData Class Reference
Inheritance diagram for KM3NETDAQ::JDQSimulator::JData:
std::vector< JTimeslice >

Public Member Functions

 JData ()
 Default constructor.
 
void setRunNumber (int run_number)
 Set run number.
 
void reset ()
 Reset internal iterator to begin.
 
void next ()
 Increment internal iterator.
 
const_iterator operator-> ()
 Smart pointer operator.
 

Private Attributes

JData::const_iterator page
 

Detailed Description

Definition at line 384 of file JDQSimulator.cc.

Constructor & Destructor Documentation

◆ JData()

KM3NETDAQ::JDQSimulator::JData::JData ( )
inline

Default constructor.

Definition at line 391 of file JDQSimulator.cc.

391 :
393 {}

Member Function Documentation

◆ setRunNumber()

void KM3NETDAQ::JDQSimulator::JData::setRunNumber ( int run_number)
inline

Set run number.

Parameters
run_numberrun number

Definition at line 401 of file JDQSimulator.cc.

402 {
404
405 for (iterator timeslice = begin(); timeslice != end(); ++timeslice) {
406
407 for (JTimeslice::iterator frame = timeslice->begin(); frame != timeslice->end(); ++frame) {
408
410
411 in.seekg(getSizeof<JDAQPreamble>());
412
413 in >> header;
414
415 header.setRunNumber(run_number);
416
417 frame->seekp(getSizeof<JDAQPreamble>());
418
419 *frame << header;
420 }
421 }
422 }
int run_number
Definition JDAQCHSM.hh:167
Byte array binary input.
std::vector< value_type >::iterator iterator
Definition JTimeslice.hh:33
void setRunNumber(const int run)
Set run number.
size_t getSizeof< JDAQSuperFrameHeader >()
Get size of type.
size_t getSizeof< JDAQPreamble >()
Get size of type.

◆ reset()

void KM3NETDAQ::JDQSimulator::JData::reset ( )
inline

Reset internal iterator to begin.

Definition at line 428 of file JDQSimulator.cc.

429 {
430 page = begin();
431 }
JData::const_iterator page

◆ next()

void KM3NETDAQ::JDQSimulator::JData::next ( )
inline

Increment internal iterator.

When the internal iterator reaches the end of the data, the frame indices of the data are increased and the internal iterator is reset to the begin of data.

Definition at line 440 of file JDQSimulator.cc.

441 {
442 if (page != end() && ++page == end()) {
443
445
446 for (iterator timeslice = begin(); timeslice != end(); ++timeslice) {
447
448 for (JTimeslice::iterator frame = timeslice->begin(); frame != timeslice->end(); ++frame) {
449
451
452 in.seekg(getSizeof<JDAQPreamble>());
453
454 in >> header;
455
456 header.setFrameIndex(header.getFrameIndex() + this->size());
457 header.setTimesliceStart(JDAQUTCExtended(getTimeOfFrame(header.getFrameIndex())));
458
459 frame->seekp(getSizeof<JDAQPreamble>());
460
461 *frame << header;
462 }
463 }
464
465 reset();
466 }
467 }
void setFrameIndex(const int frame_index)
Set frame index.
Data structure for UTC time.
void reset()
Reset internal iterator to begin.
double getTimeOfFrame(const int frame_index)
Get start time of frame in ns since start of run for a given frame index.
Definition JDAQClock.hh:185

◆ operator->()

const_iterator KM3NETDAQ::JDQSimulator::JData::operator-> ( )
inline

Smart pointer operator.

Returns
current iterator

Definition at line 475 of file JDQSimulator.cc.

476 {
477 return page;
478 }

Member Data Documentation

◆ page

JData::const_iterator KM3NETDAQ::JDQSimulator::JData::page
private

Definition at line 482 of file JDQSimulator.cc.


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