1 #ifndef IOONLINEINCLUDED
2 #define IOONLINEINCLUDED
14 #include "TStreamerInfo.h"
82 evt.
hits.reserve(snapshotHits.size());
84 for (
auto& daqhit : snapshotHits )
88 evt.
hits.push_back( h );
92 for (
auto& daqtrighit : triggeredHits)
94 Hit* g = M[daqtrighit.getModuleID()][daqtrighit.getPMT()][daqtrighit.getT()];
97 g->
trig = daqtrighit.getTriggerMask ();
99 THROW(
Exception,
"Failed to flag snaphot hit " << (
int) daqtrighit.getModuleID() <<
"." << (
int) daqtrighit.getPMT() <<
" " << daqtrighit.getT());
126 for (
auto& daqhit : sf )
129 h.
dom_id = sf.getModuleID();
130 evt.
hits.push_back(h);
147 static TFile* _f = 0;
149 static TBranch* BS = 0;
152 if (!f)
THROW(
Exception,
"get_summary_slice called with TFile pointer that is null");
157 if ( !_f || _f->GetUUID().Compare( f->GetUUID() ) != 0 )
165 const char* name = JDAQSummaryslice::Class()->GetName();
183 std::cout <<
"building index to lookup summary slices..." << std::endl;
184 int n = S->BuildIndex(
"frame_index");
186 BS->SetAddress( &
r );
189 int nbytes = S->GetEntryWithIndex( frame_index );
192 THROW(
Exception,
"Failed to find summary slice entry with frame_index " << frame_index);
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
int getDetectorID() const
Get detector identifier.
int getRunNumber() const
Get run number.
JDAQUTCExtended getTimesliceStart() const
Get start of timeslice.
int getFrameIndex() const
Get frame index.
static JTriggerMask_t getTriggerMask(const JDAQTriggeredHit &hit)
Get trigger mask of given hit.
const std::vector< T > & getHits() const
Get container with hits.
JPMT_t getPMT() const
Get PMT.
JTDC_t getT() const
Get time.
JTOT_t getToT() const
Get time-over-threshold.
int getModuleID() const
Get module identifier.
static int ROOT_IO_VERSION
Streamer version of JDAQSummaryslice as obtained from ROOT file.
JTriggerCounter_t getCounter() const
Get trigger counter.
uint32_t getUTC16nanosecondcycles() const
Get minor time.
uint32_t getUTCseconds() const
Get major time.
JDAQSummaryslice * get_summary_slice(TFile *f, int frame_index)
Get summary slice from given file with given frame index.
void read(Hit &hit, const JDAQHit &daqhit)
Read a hit from a DAQ hit.
KM3NeT DAQ data structures and auxiliaries.
static const char *const TTREE_ONLINE_SUMMARYSLICE
ROOT TTree name.
static const char *const TBRANCH_ONLINE_SUMMARYSLICE
ROOT TBranch name.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
int frame_index
from the raw data
int run_id
DAQ run identifier.
ULong64_t trigger_mask
trigger mask from raw data (i.e. the trigger bits)
std::vector< Hit > hits
list of hits
int det_id
detector identifier from DAQ
ULong64_t trigger_counter
trigger counter
TTimeStamp t
UTC time of the timeslice, or the event_time for MC. (default: 01 Jan 1970 00:00:00)
unsigned int overlays
number of overlaying triggered events
int pmt_id
global PMT identifier as found in evt files
int dom_id
module identifier from the data (unique in the detector).
ULong64_t trig
non-zero if the hit is a trigger hit.
unsigned int tdc
hit tdc (=time in ns)
unsigned int channel_id
PMT channel id {0,1, .., 30} local to moduke.
unsigned int tot
tot value as stored in raw data (int for pyroot)