Go to the documentation of this file. 1 #ifndef IOONLINEINCLUDED
2 #define IOONLINEINCLUDED
9 #include "../online/JDAQEvent.hh"
10 #include "../online/JDAQKeyHit.hh"
11 #include "../online/JDAQTimeslice.hh"
12 #include "../online/JDAQSummaryslice.hh"
14 #include "TStreamerInfo.h"
34 hit.
t = daqhit.
getT();
50 hit.
t = daqhit.
getT();
81 evt.
hits.reserve(snapshotHits.size());
83 for(
auto& daqhit : snapshotHits )
87 evt.
hits.push_back( h );
91 for(
auto& daqtrighit: triggeredHits)
93 Hit* g = M[daqtrighit.getModuleID()][daqtrighit.getPMT()][daqtrighit.getT()];
94 if (g) g->
trig = daqtrighit.getTriggerMask ();
97 THROW(
Exception,
"Failed to flag snaphot hit" << (
int) daqtrighit.getPMT() <<
" " << daqtrighit.getT());
124 for(
auto& daqhit: sf )
127 h.
dom_id = sf.getModuleID();
128 evt.
hits.push_back(h);
153 static TBranch* BS=0;
168 S = (TTree*) _f->Get(
"KM3NET_SUMMARYSLICE");
174 BS = S->GetBranch(
"KM3NET_SUMMARYSLICE");
180 std::cout <<
"building index to lookup timeslices..." << std::endl;
181 int n = S->BuildIndex(
"frame_index");
183 BS->SetAddress( &
r );
187 int nbytes = S->GetEntryWithIndex( frame_index );
190 THROW(
Exception,
"Failed to find entry with frame_index " << frame_index);
void read(Hit &hit, const JDAQHit &daqhit)
Read a hit from a DAQ hit.
std::vector< Hit > hits
list of hits
JPMT_t getPMT() const
Get PMT.
JTriggerCounter_t getCounter() const
Get trigger counter.
int pmt_id
global PMT identifier as found in evt files
JDAQUTCExtended getTimesliceStart() const
Get start of timeslice.
JUINT32_t getUTCseconds() const
Get time.
int run_id
DAQ run identifier.
int getFrameIndex() const
Get frame index.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
int getModuleID() const
Get module identifier.
int getDetectorID() const
Get detector identifier.
static int ROOT_IO_VERSION
Streamer version of JDAQSummaryslice as obtained from ROOT file.
double t
hit time (from calibration or MC truth)
unsigned int tot
tot value as stored in raw data (int for pyroot)
JTDC_t getT() const
Get time.
const std::vector< T > & getHits() const
Get container with hits.
int dom_id
module identifier from the data (unique in the detector).
JDAQSummaryslice * get_summary_slice(TFile *f, int frame_index)
Get summary slice from given file with given frame index.
JUINT32_t getUTC16nanosecondcycles() const
Get time.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
int trig
non-zero if the hit is a trigger hit.
JTOT_t getToT() const
Get time-over-threshold.
int getRunNumber() const
Get run number.
TTimeStamp t
UTC time of the start of the timeslice the event came from.
KM3NeT DAQ data structures and auxiliaries.
int frame_index
from the raw data
unsigned int overlays
number of overlaying triggered events
ULong64_t trigger_mask
trigger mask from raw data (i.e. the trigger bits)
double getTimeNanoSecond() const
Get time (limited to 16 ns cycles).
int det_id
detector identifier from DAQ
static JTriggerMask_t getTriggerMask(const JDAQTriggeredHit &hit)
Get trigger mask of given hit.
unsigned int channel_id
PMT channel id {0,1, .., 31} local to moduke.
ULong64_t trigger_counter
trigger counter