Jpp  17.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
KM3NETDAQ::JDAQEvent Class Reference

DAQ Event. More...

#include <JDAQEvent.hh>

Inheritance diagram for KM3NETDAQ::JDAQEvent:
KM3NETDAQ::JDAQPreamble KM3NETDAQ::JDAQEventHeader KM3NETDAQ::JDAQAbstractPreamble TObject KM3NETDAQ::JDAQHeader KM3NETDAQ::JDAQTriggerCounter KM3NETDAQ::JDAQTriggerMask KM3NETDAQ::JDAQChronometer JTRIGGER::JTriggeredEvent

Classes

class  const_iterator
 Template const_iterator. More...
 
class  const_reverse_iterator
 Template const_reverse_iterator. More...
 

Public Member Functions

 JDAQEvent ()
 Default constructor. More...
 
 JDAQEvent (const JDAQChronometer &chronometer, const JDAQTriggerMask &mask=JDAQTriggerMask())
 Constructor. More...
 
template<class T >
const std::vector< T > & getHits () const
 Get container with hits. More...
 
template<class T >
std::vector< T > & getHits ()
 Get container with hits. More...
 
template<class T >
const_iterator< Tbegin () const
 Get begin of data. More...
 
template<class T >
const_iterator< Tend () const
 Get end of data. More...
 
template<class T >
const_reverse_iterator< Trbegin () const
 Get reverse begin of data. More...
 
template<class T >
const_reverse_iterator< Trend () const
 Get reverse end of data. More...
 
template<class T >
unsigned int size () const
 Get number of hits. More...
 
template<class T >
bool empty () const
 Check emptyness of hit container. More...
 
void clear ()
 Clear event. More...
 
void push_back (const JDAQKeyHit &hit)
 Add hit. More...
 
void push_back (const JDAQTriggeredHit &hit)
 Add hit. More...
 
JTriggerMask_t getTriggerMask (const JDAQSnapshotHit &hit) const
 Get trigger mask of given hit. More...
 
std::ostream & print (std::ostream &out, const bool lpr=false) const
 Print DAQ Event. More...
 
 ClassDef (JDAQEvent, 4)
 
template<>
const std::vector
< JDAQTriggeredHit > & 
getHits () const
 Get triggered hits. More...
 
template<>
const std::vector< JDAQKeyHit > & getHits () const
 Get snapshot hits. More...
 
template<>
std::vector< JDAQTriggeredHit > & getHits ()
 Get triggered hits. More...
 
template<>
std::vector< JDAQKeyHit > & getHits ()
 Get snapshot hits. More...
 
template<>
JDAQEvent::const_iterator
< JDAQTriggeredHit
begin () const
 Get begin of triggered hits. More...
 
template<>
JDAQEvent::const_iterator
< JDAQTriggeredHit
end () const
 Get end of triggered hits. More...
 
template<>
JDAQEvent::const_iterator
< JDAQSnapshotHit
begin () const
 Get begin of snapshot hits. More...
 
template<>
JDAQEvent::const_iterator
< JDAQSnapshotHit
end () const
 Get end of snapshot hits. More...
 
template<>
JDAQEvent::const_reverse_iterator
< JDAQTriggeredHit
rbegin () const
 Get reverse begin of triggered hits. More...
 
template<>
JDAQEvent::const_reverse_iterator
< JDAQTriggeredHit
rend () const
 Get reverse end of triggered hits. More...
 
template<>
JDAQEvent::const_reverse_iterator
< JDAQSnapshotHit
rbegin () const
 Get reverse begin of snapshot hits. More...
 
template<>
JDAQEvent::const_reverse_iterator
< JDAQSnapshotHit
rend () const
 Get reverse end of snapshot hits. More...
 
template<>
unsigned int size () const
 Get number of triggered hits. More...
 
template<>
unsigned int size () const
 Get number of snapshot hits. More...
 
template<>
bool empty () const
 Check emptyness of triggered data. More...
 
template<>
bool empty () const
 Check emptyness of snapshot data. More...
 
 ClassDef (JDAQPreamble, 1)
 
int getLength () const
 Get length. More...
 
int getDataType () const
 Get data type. More...
 
 ClassDefNV (JDAQAbstractPreamble, 1)
 
const JDAQEventHeadergetDAQEventHeader () const
 Get DAQ event header. More...
 
bool is_same (const JDAQEventHeader &header) const
 Check if header is same. More...
 
unsigned int getOverlays () const
 Get number of overlays. More...
 
 ClassDef (JDAQEventHeader, 3)
 
 ClassDef (JDAQHeader, 2)
 
 ClassDef (JDAQChronometer, 3)
 
 ClassDef (JDAQTriggerCounter, 1)
 
 ClassDef (JDAQTriggerMask, 1)
 
const JDAQHeadergetDAQHeader () const
 Get DAQ header. More...
 
void setDAQHeader (const JDAQHeader &header)
 Set DAQ header. More...
 
const JDAQChronometergetDAQChronometer () const
 Get DAQ chronometer. More...
 
void setDAQChronometer (const JDAQChronometer &chronometer)
 Set DAQ chronometer. More...
 
int getDetectorID () const
 Get detector identifier. More...
 
int getRunNumber () const
 Get run number. More...
 
int getFrameIndex () const
 Get frame index. More...
 
JDAQUTCExtended getTimesliceStart () const
 Get start of timeslice. More...
 
void setRunNumber (const int run)
 Set run number. More...
 
void setFrameIndex (const int frame_index)
 Set frame index. More...
 
void setTimesliceStart (const JDAQUTCExtended &timeslice_start)
 Set timeslice start time. More...
 
const JDAQTriggerCountergetDAQTriggerCounter () const
 Get DAQ trigger counter. More...
 
JTriggerCounter_t getCounter () const
 Get trigger counter. More...
 
void setCounter (const JTriggerCounter_t counter)
 Set trigger counter. More...
 
JTriggerCounter_t next ()
 Increment trigger counter. More...
 
const JDAQTriggerMaskgetDAQTriggerMask () const
 Get DAQ trigger mask. More...
 
JTriggerMask_t getTriggerMask () const
 Get trigger mask. More...
 
void setDAQTriggerMask (const JDAQTriggerMask &mask)
 Set trigger mask. More...
 
void setTriggerMask (const JTriggerMask_t mask)
 Set trigger mask. More...
 
JDAQTriggerMaskaddTriggerMask (const JDAQTriggerMask &mask)
 Add trigger bit pattern. More...
 
bool hasTriggerMask (const JDAQTriggerMask &mask) const
 Has trigger bit pattern. More...
 
JDAQTriggerMaskaddTriggerBit (const unsigned int bit)
 Add trigger bit. More...
 
bool hasTriggerBit (const unsigned int bit) const
 Check trigger bit. More...
 
std::string toString () const
 Convert trigger mask. More...
 

Static Public Member Functions

static JTriggerMask_t getTriggerMask (const JDAQTriggeredHit &hit)
 Get trigger mask of given hit. More...
 
template<class T >
static JDAQPreamble getDAQPreamble (const T &object)
 Get DAQ preamble. More...
 
static JDAQTriggerCountergetInstance ()
 Get reference to unique instance of this class object. More...
 
static void reset ()
 Reset counter of unique instance of this class object. More...
 
static JDAQTriggerMask valueOf (const std::string &buffer)
 Extract trigger mask. More...
 

Protected Attributes

std::vector< JDAQTriggeredHittriggeredHits
 
std::vector< JDAQSnapshotHitsnapshotHits
 
int length
 
int type
 
unsigned int overlays
 
int detector_id
 
int run
 
int frame_index
 
JDAQUTCExtended timeslice_start
 
JTriggerCounter_t trigger_counter
 
JTriggerMask_t trigger_mask
 

Friends

size_t getSizeof (const JDAQEvent &)
 Get size of object. More...
 
JReaderoperator>> (JReader &, JDAQEvent &)
 Read DAQ event from input. More...
 
JWriteroperator<< (JWriter &, const JDAQEvent &)
 Write DAQ event to output. More...
 

Detailed Description

DAQ Event.

Definition at line 30 of file JDAQEvent.hh.

Constructor & Destructor Documentation

KM3NETDAQ::JDAQEvent::JDAQEvent ( )
inline

Default constructor.

Definition at line 45 of file JDAQEvent.hh.

45  :
48  {}
Auxiliary class for a DAQ type holder.
JDAQPreamble()
Default constructor.
Definition: JDAQPreamble.hh:51
JDAQEventHeader()
Default constructor.
KM3NETDAQ::JDAQEvent::JDAQEvent ( const JDAQChronometer chronometer,
const JDAQTriggerMask mask = JDAQTriggerMask() 
)
inline

Constructor.

Parameters
chronometerDAQ chronometer
masktrigger mask

Definition at line 57 of file JDAQEvent.hh.

58  :
60  JDAQEventHeader(chronometer, mask)
61  {}
Auxiliary class for a DAQ type holder.
JDAQPreamble()
Default constructor.
Definition: JDAQPreamble.hh:51
JDAQEventHeader()
Default constructor.

Member Function Documentation

template<class T >
const std::vector<T>& KM3NETDAQ::JDAQEvent::getHits ( ) const

Get container with hits.

Returns
container with hits
template<class T >
std::vector<T>& KM3NETDAQ::JDAQEvent::getHits ( )

Get container with hits.

Returns
container with hits
template<class T >
const_iterator<T> KM3NETDAQ::JDAQEvent::begin ( ) const

Get begin of data.

Returns
begin of data
template<class T >
const_iterator<T> KM3NETDAQ::JDAQEvent::end ( ) const

Get end of data.

Returns
end of data
template<class T >
const_reverse_iterator<T> KM3NETDAQ::JDAQEvent::rbegin ( ) const

Get reverse begin of data.

Returns
begin of data
template<class T >
const_reverse_iterator<T> KM3NETDAQ::JDAQEvent::rend ( ) const

Get reverse end of data.

Returns
end of data
template<class T >
unsigned int KM3NETDAQ::JDAQEvent::size ( ) const

Get number of hits.

Returns
number of hits
template<class T >
bool KM3NETDAQ::JDAQEvent::empty ( ) const

Check emptyness of hit container.

Returns
true if empty; else false
void KM3NETDAQ::JDAQEvent::clear ( )
inline

Clear event.

Definition at line 193 of file JDAQEvent.hh.

194  {
195  snapshotHits .clear();
196  triggeredHits.clear();
197  }
std::vector< JDAQTriggeredHit > triggeredHits
Definition: JDAQEvent.hh:266
std::vector< JDAQSnapshotHit > snapshotHits
Definition: JDAQEvent.hh:267
void KM3NETDAQ::JDAQEvent::push_back ( const JDAQKeyHit hit)
inline

Add hit.

Parameters
hithit

Definition at line 205 of file JDAQEvent.hh.

206  {
207  snapshotHits.push_back(hit);
208  }
std::vector< JDAQSnapshotHit > snapshotHits
Definition: JDAQEvent.hh:267
void KM3NETDAQ::JDAQEvent::push_back ( const JDAQTriggeredHit hit)
inline

Add hit.

Parameters
hithit

Definition at line 216 of file JDAQEvent.hh.

217  {
218  triggeredHits.push_back(hit);
219  }
std::vector< JDAQTriggeredHit > triggeredHits
Definition: JDAQEvent.hh:266
static JTriggerMask_t KM3NETDAQ::JDAQEvent::getTriggerMask ( const JDAQTriggeredHit hit)
inlinestatic

Get trigger mask of given hit.

Parameters
hithit
Returns
trigger mask

Definition at line 228 of file JDAQEvent.hh.

229  {
230  return hit.getTriggerMask();
231  }
JTriggerMask_t getTriggerMask() const
Get trigger mask.
JTriggerMask_t KM3NETDAQ::JDAQEvent::getTriggerMask ( const JDAQSnapshotHit hit) const
inline

Get trigger mask of given hit.

Parameters
hithit
Returns
trigger mask

Definition at line 240 of file JDAQEvent.hh.

241  {
243  if (*i == hit) {
244  return i->getTriggerMask();
245  }
246  }
247 
248  return JTriggerMask_t(0);
249  }
std::vector< JDAQTriggeredHit > triggeredHits
Definition: JDAQEvent.hh:266
unsigned long long int JTriggerMask_t
Type definition of trigger mask.
std::ostream & KM3NETDAQ::JDAQEvent::print ( std::ostream &  out,
const bool  lpr = false 
) const

Print DAQ Event.

Parameters
outoutput stream
lprlong print
Returns
output stream

Definition at line 226 of file externals/km3net-dataformat/src/JDAQEvent.cc.

227  {
228  using namespace std;
229 
230  out << this->ClassName() << endl;
231  out << dynamic_cast<const JDAQPreamble&> (*this) << endl;
232  out << dynamic_cast<const JDAQChronometer&>(*this) << endl;
233 
234  out << "Trigger counter " << this->getCounter() << endl;
235  out << "Trigger mask (hex) " << hex << this->getTriggerMask() << dec << endl;
236  out << "Overlays " << this->getOverlays() << endl;
237  out << "Triggered hits " << this->size<JDAQTriggeredHit>() << endl;
238  out << "Snapshot hits " << this->size<JDAQSnapshotHit> () << endl;
239 
240  {
241  typedef JDAQTriggeredHit JHit_t;
242 
243  for (JDAQEvent::const_iterator<JHit_t> hit = this->begin<JHit_t>(); hit != this->end<JHit_t>(); ++hit) {
244  out << setw(5) << hit->getModuleID() << ' '
245  << setw(2) << (int) hit->getPMT() << ' '
246  << setw(10) << (int) hit->getT() << ' '
247  << setw(3) << (int) hit->getToT() << ' '
248  << setw(10) << hex << hit->getTriggerMask() << dec << endl;
249  }
250  }
251 
252  if (lpr) {
253 
254  typedef JDAQSnapshotHit JHit_t;
255 
256  for (JDAQEvent::const_iterator<JHit_t> hit = this->begin<JHit_t>(); hit != this->end<JHit_t>(); ++hit) {
257  out << setw(5) << hit->getModuleID() << ' '
258  << setw(2) << (int) hit->getPMT() << ' '
259  << setw(10) << (int) hit->getT() << ' '
260  << setw(3) << (int) hit->getToT() << endl;
261  }
262  }
263 
264  return out;
265  }
DAQ key hit.
Definition: JDAQKeyHit.hh:19
int getModuleID() const
Get module identifier.
JTriggerMask_t getTriggerMask() const
Get trigger mask.
Template const_iterator.
Definition: JDAQEvent.hh:68
unsigned int getOverlays() const
Get number of overlays.
Auxiliary class to set-up Hit.
Definition: JSirene.hh:55
JTriggerCounter_t getCounter() const
Get trigger counter.
KM3NETDAQ::JDAQEvent::ClassDef ( JDAQEvent  ,
 
)
template<>
const std::vector<JDAQTriggeredHit>& KM3NETDAQ::JDAQEvent::getHits ( ) const

Get triggered hits.

Returns
triggered hits

Definition at line 17 of file externals/km3net-dataformat/src/JDAQEvent.cc.

18  {
19  return triggeredHits;
20  }
std::vector< JDAQTriggeredHit > triggeredHits
Definition: JDAQEvent.hh:266
template<>
const std::vector<JDAQKeyHit>& KM3NETDAQ::JDAQEvent::getHits ( ) const

Get snapshot hits.

Returns
snapshot hits

Definition at line 29 of file externals/km3net-dataformat/src/JDAQEvent.cc.

30  {
31  return snapshotHits;
32  }
std::vector< JDAQSnapshotHit > snapshotHits
Definition: JDAQEvent.hh:267
template<>
std::vector<JDAQTriggeredHit>& KM3NETDAQ::JDAQEvent::getHits ( )

Get triggered hits.

Returns
triggered hits

Definition at line 41 of file externals/km3net-dataformat/src/JDAQEvent.cc.

42  {
43  return triggeredHits;
44  }
std::vector< JDAQTriggeredHit > triggeredHits
Definition: JDAQEvent.hh:266
template<>
std::vector<JDAQKeyHit>& KM3NETDAQ::JDAQEvent::getHits ( )

Get snapshot hits.

Returns
snapshot hits

Definition at line 53 of file externals/km3net-dataformat/src/JDAQEvent.cc.

54  {
55  return snapshotHits;
56  }
std::vector< JDAQSnapshotHit > snapshotHits
Definition: JDAQEvent.hh:267
template<>
JDAQEvent::const_iterator<JDAQTriggeredHit> KM3NETDAQ::JDAQEvent::begin ( ) const

Get begin of triggered hits.

Returns
begin triggered hits

Definition at line 65 of file externals/km3net-dataformat/src/JDAQEvent.cc.

66  {
67  return triggeredHits.begin();
68  }
std::vector< JDAQTriggeredHit > triggeredHits
Definition: JDAQEvent.hh:266
template<>
JDAQEvent::const_iterator<JDAQTriggeredHit> KM3NETDAQ::JDAQEvent::end ( ) const

Get end of triggered hits.

Returns
end triggered hits

Definition at line 77 of file externals/km3net-dataformat/src/JDAQEvent.cc.

78  {
79  return triggeredHits.end();
80  }
std::vector< JDAQTriggeredHit > triggeredHits
Definition: JDAQEvent.hh:266
template<>
JDAQEvent::const_iterator<JDAQSnapshotHit> KM3NETDAQ::JDAQEvent::begin ( ) const

Get begin of snapshot hits.

Returns
begin snapshot hits

Definition at line 89 of file externals/km3net-dataformat/src/JDAQEvent.cc.

90  {
91  return snapshotHits.begin();
92  }
std::vector< JDAQSnapshotHit > snapshotHits
Definition: JDAQEvent.hh:267
template<>
JDAQEvent::const_iterator<JDAQSnapshotHit> KM3NETDAQ::JDAQEvent::end ( ) const

Get end of snapshot hits.

Returns
end snapshot hits

Definition at line 101 of file externals/km3net-dataformat/src/JDAQEvent.cc.

102  {
103  return snapshotHits.end();
104  }
std::vector< JDAQSnapshotHit > snapshotHits
Definition: JDAQEvent.hh:267
template<>
JDAQEvent::const_reverse_iterator<JDAQTriggeredHit> KM3NETDAQ::JDAQEvent::rbegin ( ) const

Get reverse begin of triggered hits.

Returns
begin triggered hits

Definition at line 113 of file externals/km3net-dataformat/src/JDAQEvent.cc.

114  {
115  return triggeredHits.rbegin();
116  }
std::vector< JDAQTriggeredHit > triggeredHits
Definition: JDAQEvent.hh:266
template<>
JDAQEvent::const_reverse_iterator<JDAQTriggeredHit> KM3NETDAQ::JDAQEvent::rend ( ) const

Get reverse end of triggered hits.

Returns
end triggered hits

Definition at line 125 of file externals/km3net-dataformat/src/JDAQEvent.cc.

126  {
127  return triggeredHits.rend();
128  }
std::vector< JDAQTriggeredHit > triggeredHits
Definition: JDAQEvent.hh:266
template<>
JDAQEvent::const_reverse_iterator<JDAQSnapshotHit> KM3NETDAQ::JDAQEvent::rbegin ( ) const

Get reverse begin of snapshot hits.

Returns
begin snapshot hits

Definition at line 137 of file externals/km3net-dataformat/src/JDAQEvent.cc.

138  {
139  return snapshotHits.rbegin();
140  }
std::vector< JDAQSnapshotHit > snapshotHits
Definition: JDAQEvent.hh:267
template<>
JDAQEvent::const_reverse_iterator<JDAQSnapshotHit> KM3NETDAQ::JDAQEvent::rend ( ) const

Get reverse end of snapshot hits.

Returns
end snapshot hits

Definition at line 149 of file externals/km3net-dataformat/src/JDAQEvent.cc.

150  {
151  return snapshotHits.rend();
152  }
std::vector< JDAQSnapshotHit > snapshotHits
Definition: JDAQEvent.hh:267
template<>
unsigned int KM3NETDAQ::JDAQEvent::size ( ) const

Get number of triggered hits.

Returns
number of triggered hits

Definition at line 161 of file externals/km3net-dataformat/src/JDAQEvent.cc.

162  {
163  return triggeredHits.size();
164  }
std::vector< JDAQTriggeredHit > triggeredHits
Definition: JDAQEvent.hh:266
template<>
unsigned int KM3NETDAQ::JDAQEvent::size ( ) const

Get number of snapshot hits.

Returns
number of snapshot hits

Definition at line 173 of file externals/km3net-dataformat/src/JDAQEvent.cc.

174  {
175  return snapshotHits.size();
176  }
std::vector< JDAQSnapshotHit > snapshotHits
Definition: JDAQEvent.hh:267
template<>
bool KM3NETDAQ::JDAQEvent::empty ( ) const

Check emptyness of triggered data.

Returns
emptyness triggered hits

Definition at line 185 of file externals/km3net-dataformat/src/JDAQEvent.cc.

186  {
187  return triggeredHits.empty();
188  }
std::vector< JDAQTriggeredHit > triggeredHits
Definition: JDAQEvent.hh:266
template<>
bool KM3NETDAQ::JDAQEvent::empty ( ) const

Check emptyness of snapshot data.

Returns
emptyness snapshot hits

Definition at line 197 of file externals/km3net-dataformat/src/JDAQEvent.cc.

198  {
199  return snapshotHits.empty();
200  }
std::vector< JDAQSnapshotHit > snapshotHits
Definition: JDAQEvent.hh:267
template<class T >
static JDAQPreamble KM3NETDAQ::JDAQPreamble::getDAQPreamble ( const T object)
inlinestaticinherited

Get DAQ preamble.

This method should be used for binary I/O to get the actual data for the given object.
To this end, the following method should be overloaded for the corresponding data type.

   size_t  getSizeof(const T&);
Parameters
objectobject
Returns
preamble

Definition at line 76 of file JDAQPreamble.hh.

77  {
78  static JDAQPreamble preamble;
79 
80  preamble.length = getSizeof(object);
81  preamble.type = KM3NETDAQ::getDataType<T>();
82 
83  return preamble;
84  }
friend size_t getSizeof()
Definition of method to get size of data type.
KM3NETDAQ::JDAQPreamble::ClassDef ( JDAQPreamble  ,
 
)
inherited
int KM3NETDAQ::JDAQAbstractPreamble::getLength ( ) const
inlineinherited

Get length.

Returns
number of bytes

Definition at line 49 of file JDAQAbstractPreamble.hh.

50  {
51  return length;
52  }
int KM3NETDAQ::JDAQAbstractPreamble::getDataType ( ) const
inlineinherited

Get data type.

Returns
data type

Definition at line 60 of file JDAQAbstractPreamble.hh.

61  {
62  return type;
63  }
KM3NETDAQ::JDAQAbstractPreamble::ClassDefNV ( JDAQAbstractPreamble  ,
 
)
inherited
const JDAQEventHeader& KM3NETDAQ::JDAQEventHeader::getDAQEventHeader ( ) const
inlineinherited

Get DAQ event header.

Returns
DAQ event header

Definition at line 61 of file JDAQEventHeader.hh.

62  {
63  return static_cast<const JDAQEventHeader&>(*this);
64  }
bool KM3NETDAQ::JDAQEventHeader::is_same ( const JDAQEventHeader header) const
inlineinherited

Check if header is same.

Parameters
headerDAQ event header
Returns
true if event headers are same; else false

Definition at line 73 of file JDAQEventHeader.hh.

74  {
75  return (this->getDetectorID() == header.getDetectorID() &&
76  this->getRunNumber() == header.getRunNumber() &&
77  this->getFrameIndex() == header.getFrameIndex() &&
78  this->getCounter() == header.getCounter());
79  }
int getDetectorID() const
Get detector identifier.
int getRunNumber() const
Get run number.
int getFrameIndex() const
Get frame index.
JTriggerCounter_t getCounter() const
Get trigger counter.
unsigned int KM3NETDAQ::JDAQEventHeader::getOverlays ( ) const
inlineinherited

Get number of overlays.

Returns
number of overlays

Definition at line 87 of file JDAQEventHeader.hh.

88  {
89  return overlays;
90  }
KM3NETDAQ::JDAQEventHeader::ClassDef ( JDAQEventHeader  ,
 
)
inherited
KM3NETDAQ::JDAQHeader::ClassDef ( JDAQHeader  ,
 
)
inherited
KM3NETDAQ::JDAQChronometer::ClassDef ( JDAQChronometer  ,
 
)
inherited
KM3NETDAQ::JDAQTriggerCounter::ClassDef ( JDAQTriggerCounter  ,
 
)
inherited
KM3NETDAQ::JDAQTriggerMask::ClassDef ( JDAQTriggerMask  ,
 
)
inherited
const JDAQHeader& KM3NETDAQ::JDAQHeader::getDAQHeader ( ) const
inlineinherited

Get DAQ header.

Returns
DAQ header

Definition at line 49 of file JDAQHeader.hh.

50  {
51  return static_cast<const JDAQHeader&>(*this);
52  }
void KM3NETDAQ::JDAQHeader::setDAQHeader ( const JDAQHeader header)
inlineinherited

Set DAQ header.

Parameters
headerDAQ header

Definition at line 60 of file JDAQHeader.hh.

61  {
62  static_cast<JDAQHeader&>(*this) = header;
63  }
const JDAQChronometer& KM3NETDAQ::JDAQChronometer::getDAQChronometer ( ) const
inlineinherited

Get DAQ chronometer.

Returns
DAQ chronometer

Definition at line 88 of file JDAQChronometer.hh.

89  {
90  return static_cast<const JDAQChronometer&>(*this);
91  }
void KM3NETDAQ::JDAQChronometer::setDAQChronometer ( const JDAQChronometer chronometer)
inlineinherited

Set DAQ chronometer.

Parameters
chronometerDAQ chronometer

Definition at line 99 of file JDAQChronometer.hh.

100  {
101  static_cast<JDAQChronometer&>(*this) = chronometer;
102  }
int KM3NETDAQ::JDAQChronometer::getDetectorID ( ) const
inlineinherited

Get detector identifier.

Returns
detector identifier

Definition at line 110 of file JDAQChronometer.hh.

111  {
112  return detector_id;
113  }
int KM3NETDAQ::JDAQChronometer::getRunNumber ( ) const
inlineinherited

Get run number.

Returns
run number

Definition at line 121 of file JDAQChronometer.hh.

122  {
123  return run;
124  }
int KM3NETDAQ::JDAQChronometer::getFrameIndex ( ) const
inlineinherited

Get frame index.

Returns
frame index

Definition at line 132 of file JDAQChronometer.hh.

133  {
134  return frame_index;
135  }
JDAQUTCExtended KM3NETDAQ::JDAQChronometer::getTimesliceStart ( ) const
inlineinherited

Get start of timeslice.

Returns
timeslice start

Definition at line 144 of file JDAQChronometer.hh.

145  {
146  return timeslice_start;
147  }
void KM3NETDAQ::JDAQChronometer::setRunNumber ( const int  run)
inlineinherited

Set run number.

Parameters
runrun number

Definition at line 155 of file JDAQChronometer.hh.

156  {
157  this->run = run;
158  }
void KM3NETDAQ::JDAQChronometer::setFrameIndex ( const int  frame_index)
inlineinherited

Set frame index.

Parameters
frame_indexframe index

Definition at line 166 of file JDAQChronometer.hh.

167  {
168  this->frame_index = frame_index;
169  }
void KM3NETDAQ::JDAQChronometer::setTimesliceStart ( const JDAQUTCExtended timeslice_start)
inlineinherited

Set timeslice start time.

Parameters
timeslice_starttimeslice start time

Definition at line 177 of file JDAQChronometer.hh.

178  {
179  this->timeslice_start = timeslice_start;
180  }
static JDAQTriggerCounter& KM3NETDAQ::JDAQTriggerCounter::getInstance ( )
inlinestaticinherited

Get reference to unique instance of this class object.

Returns
reference to this class object

Definition at line 66 of file JDAQTriggerCounter.hh.

67  {
68  static JDAQTriggerCounter counter(0);
69 
70  return counter;
71  }
Auxiliary class to count triggers.
const JDAQTriggerCounter& KM3NETDAQ::JDAQTriggerCounter::getDAQTriggerCounter ( ) const
inlineinherited

Get DAQ trigger counter.

Returns
DAQ trigger counter

Definition at line 79 of file JDAQTriggerCounter.hh.

80  {
81  return static_cast<const JDAQTriggerCounter&>(*this);
82  }
Auxiliary class to count triggers.
static void KM3NETDAQ::JDAQTriggerCounter::reset ( )
inlinestaticinherited

Reset counter of unique instance of this class object.

Definition at line 88 of file JDAQTriggerCounter.hh.

89  {
91  }
static JDAQTriggerCounter & getInstance()
Get reference to unique instance of this class object.
JTriggerCounter_t KM3NETDAQ::JDAQTriggerCounter::getCounter ( ) const
inlineinherited

Get trigger counter.

Returns
counter value

Definition at line 99 of file JDAQTriggerCounter.hh.

100  {
101  return trigger_counter;
102  }
void KM3NETDAQ::JDAQTriggerCounter::setCounter ( const JTriggerCounter_t  counter)
inlineinherited

Set trigger counter.

Parameters
countercounter value

Definition at line 110 of file JDAQTriggerCounter.hh.

111  {
112  this->trigger_counter = counter;
113  }
JTriggerCounter_t KM3NETDAQ::JDAQTriggerCounter::next ( )
inlineinherited

Increment trigger counter.

Returns
counter value

Definition at line 121 of file JDAQTriggerCounter.hh.

122  {
123  return trigger_counter++;
124  }
const JDAQTriggerMask& KM3NETDAQ::JDAQTriggerMask::getDAQTriggerMask ( ) const
inlineinherited

Get DAQ trigger mask.

Returns
DAQ trigger mask

Definition at line 95 of file JDAQTriggerMask.hh.

96  {
97  return static_cast<const JDAQTriggerMask&>(*this);
98  }
Auxiliary class for trigger mask.
JTriggerMask_t KM3NETDAQ::JDAQTriggerMask::getTriggerMask ( ) const
inlineinherited

Get trigger mask.

Returns
trigger mask

Definition at line 106 of file JDAQTriggerMask.hh.

107  {
108  return trigger_mask;
109  }
void KM3NETDAQ::JDAQTriggerMask::setDAQTriggerMask ( const JDAQTriggerMask mask)
inlineinherited

Set trigger mask.

Parameters
masktrigger mask

Definition at line 117 of file JDAQTriggerMask.hh.

118  {
119  trigger_mask = mask.trigger_mask;
120  }
void KM3NETDAQ::JDAQTriggerMask::setTriggerMask ( const JTriggerMask_t  mask)
inlineinherited

Set trigger mask.

Parameters
masktrigger mask

Definition at line 128 of file JDAQTriggerMask.hh.

129  {
130  trigger_mask = mask;
131  }
JDAQTriggerMask& KM3NETDAQ::JDAQTriggerMask::addTriggerMask ( const JDAQTriggerMask mask)
inlineinherited

Add trigger bit pattern.

Parameters
masktrigger mask
Returns
trigger mask

Definition at line 140 of file JDAQTriggerMask.hh.

141  {
142  trigger_mask |= mask.trigger_mask;
143 
144  return *this;
145  }
bool KM3NETDAQ::JDAQTriggerMask::hasTriggerMask ( const JDAQTriggerMask mask) const
inlineinherited

Has trigger bit pattern.

Parameters
masktrigger mask
Returns
true if one of the bits is set; else false

Definition at line 154 of file JDAQTriggerMask.hh.

155  {
156  return trigger_mask & mask.trigger_mask;
157  }
JDAQTriggerMask& KM3NETDAQ::JDAQTriggerMask::addTriggerBit ( const unsigned int  bit)
inlineinherited

Add trigger bit.

Parameters
bittrigger bit
Returns
trigger mask

Definition at line 166 of file JDAQTriggerMask.hh.

167  {
169 
170  return *this;
171  }
JTriggerMask_t getTriggerMask(const unsigned int bit)
Convert trigger bit to trigger mask.
bool KM3NETDAQ::JDAQTriggerMask::hasTriggerBit ( const unsigned int  bit) const
inlineinherited

Check trigger bit.

Parameters
bittrigger bit
Returns
true if bit is set; else false

Definition at line 180 of file JDAQTriggerMask.hh.

181  {
183  }
JTriggerMask_t getTriggerMask(const unsigned int bit)
Convert trigger bit to trigger mask.
static JDAQTriggerMask KM3NETDAQ::JDAQTriggerMask::valueOf ( const std::string &  buffer)
inlinestaticinherited

Extract trigger mask.

Parameters
buffertrigger bit pattern (i.e. sequence of '0' and '1').
Returns
trigger mask

Definition at line 192 of file JDAQTriggerMask.hh.

193  {
195 
196  unsigned int bit = 0;
197 
198  for (std::string::const_reverse_iterator i = buffer.rbegin(); i != buffer.rend() && bit != NUMBER_OF_TRIGGER_BITS; ++i, ++bit) {
199  if (*i == '1') {
200  trigger_mask.addTriggerBit(bit);
201  }
202  }
203 
204  return trigger_mask;
205  }
static const unsigned int NUMBER_OF_TRIGGER_BITS
Number of trigger bits.
Auxiliary class for trigger mask.
JDAQTriggerMask & addTriggerBit(const unsigned int bit)
Add trigger bit.
std::string KM3NETDAQ::JDAQTriggerMask::toString ( ) const
inlineinherited

Convert trigger mask.

Returns
trigger bit pattern (i.e. sequence of '0' and '1').

Definition at line 213 of file JDAQTriggerMask.hh.

214  {
215  std::string buffer(NUMBER_OF_TRIGGER_BITS, '0');
216 
217  unsigned int bit = 0;
218 
219  for (std::string::reverse_iterator i = buffer.rbegin(); i != buffer.rend() && bit != NUMBER_OF_TRIGGER_BITS; ++i, ++bit) {
220  if (hasTriggerBit(bit)) {
221  *i = '1';
222  }
223  }
224 
225  return buffer;
226  }
bool hasTriggerBit(const unsigned int bit) const
Check trigger bit.
static const unsigned int NUMBER_OF_TRIGGER_BITS
Number of trigger bits.

Friends And Related Function Documentation

size_t getSizeof ( const JDAQEvent object)
friend

Get size of object.

Parameters
objectDAQ event
Returns
number of bytes

Definition at line 26 of file JDAQEventIO.hh.

27  {
28  return (getSizeof<JDAQPreamble>() +
29  sizeof(Version_t) +
31  getSizeof(static_cast<const JDAQEvent&>(object).triggeredHits) +
32  getSizeof(static_cast<const JDAQEvent&>(object).snapshotHits));
33  }
std::vector< JDAQTriggeredHit > triggeredHits
Definition: JDAQEvent.hh:266
size_t getSizeof< JDAQEventHeader >()
Get size of type.
size_t getSizeof< JDAQPreamble >()
Get size of type.
std::vector< JDAQSnapshotHit > snapshotHits
Definition: JDAQEvent.hh:267
friend size_t getSizeof()
Definition of method to get size of data type.
JReader& operator>> ( JReader in,
JDAQEvent object 
)
friend

Read DAQ event from input.

Parameters
inreader
objectDAQ event
Returns
reader

Definition at line 43 of file JDAQEventIO.hh.

44  {
45  Version_t version;
46 
47  in >> static_cast<JDAQPreamble&> (object);
48  in >> version;
49  in >> static_cast<JDAQEventHeader&>(object);
50  in >> object.triggeredHits;
51  in >> object.snapshotHits;
52 
53  return in;
54  }
version
Definition: JEditTuneHV.sh:5
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
JWriter& operator<< ( JWriter out,
const JDAQEvent object 
)
friend

Write DAQ event to output.

Parameters
outwriter
objectDAQ event
Returns
writer

Definition at line 64 of file JDAQEventIO.hh.

65  {
66  out << JDAQPreamble::getDAQPreamble(object);
67  out << JDAQEvent::Class_Version();
68  out << static_cast<const JDAQEventHeader&>(object);
69  out << object.triggeredHits;
70  out << object.snapshotHits;
71 
72  return out;
73  }
static JDAQPreamble getDAQPreamble(const T &object)
Get DAQ preamble.
Definition: JDAQPreamble.hh:76

Member Data Documentation

std::vector<JDAQTriggeredHit> KM3NETDAQ::JDAQEvent::triggeredHits
protected

Definition at line 266 of file JDAQEvent.hh.

std::vector<JDAQSnapshotHit> KM3NETDAQ::JDAQEvent::snapshotHits
protected

Definition at line 267 of file JDAQEvent.hh.

int KM3NETDAQ::JDAQAbstractPreamble::length
protectedinherited

Definition at line 69 of file JDAQAbstractPreamble.hh.

int KM3NETDAQ::JDAQAbstractPreamble::type
protectedinherited

Definition at line 70 of file JDAQAbstractPreamble.hh.

unsigned int KM3NETDAQ::JDAQEventHeader::overlays
protectedinherited

Definition at line 97 of file JDAQEventHeader.hh.

int KM3NETDAQ::JDAQChronometer::detector_id
protectedinherited

Definition at line 187 of file JDAQChronometer.hh.

int KM3NETDAQ::JDAQChronometer::run
protectedinherited

Definition at line 188 of file JDAQChronometer.hh.

int KM3NETDAQ::JDAQChronometer::frame_index
protectedinherited

Definition at line 189 of file JDAQChronometer.hh.

JDAQUTCExtended KM3NETDAQ::JDAQChronometer::timeslice_start
protectedinherited

Definition at line 190 of file JDAQChronometer.hh.

JTriggerCounter_t KM3NETDAQ::JDAQTriggerCounter::trigger_counter
protectedinherited

Definition at line 131 of file JDAQTriggerCounter.hh.

JTriggerMask_t KM3NETDAQ::JDAQTriggerMask::trigger_mask
protectedinherited

Definition at line 267 of file JDAQTriggerMask.hh.


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