Public Member Functions | |
NOvASocketInputDriver (fhicl::ParameterSet const &pset, art::ProductRegistryHelper &help, art::SourceHelper const &pm) | |
void | closeCurrentFile () |
void | readFile (std::string const &name, art::FileBlock *&fb) |
bool | readNext (art::RunPrincipal *const &inR, art::SubRunPrincipal *const &inSR, art::RunPrincipal *&outR, art::SubRunPrincipal *&outSR, art::EventPrincipal *&outE) |
Protected Member Functions | |
std::string | getDetectorGDML (const int detid) const |
Private Types | |
typedef std::vector< uint32_t > | eb_t |
Event buffer type. More... | |
typedef eb_t::value_type | ebe_t |
Event buffer element type. More... | |
typedef std::vector< uint8_t > | cb_t |
Command buffer type. More... | |
Static Private Member Functions | |
static size_t | in_bytes (size_t nElements) |
static size_t | in_elements (size_t nBytes) |
Private Attributes | |
art::SourceHelper const & | fSourceHelper |
Class to help with {Run, SubRun, Event}Principal construction. More... | |
std::string | fCurrentFilename |
Hang on to the current filename. More... | |
art::SubRunID | fCurrentSubRunID |
Keep track of the current subRun details. More... | |
boost::asio::io_service | fIoService |
Object representing IO services of the OS. More... | |
boost::asio::ip::tcp::socket | fSocket |
Object representing the socket from which we read. More... | |
size_t | fCurrentEventCapacity |
Current event capacity in buffer elements (current buffer size is 1 more than this);. More... | |
size_t | fMaxEventSizeBytes |
Will not try to read an event bigger than this. More... | |
std::vector< uint32_t > | fSocketBuffer |
Raw data buffer for socket communication. More... | |
bool | fFilterCorruptedNanoslices |
Filter the corrupted nanaslices in the unpacking? More... | |
bool | fDoFillFlatDAQData |
Do we need to fill FlatDAQData object? More... | |
int | fMaxReadAttempts |
Maximum number of read attempts before we throw. More... | |
int | fCorruptEventCount |
Counter for the total number of corrupt events encountered. More... | |
int | fConsecutiveCorruptEventCount |
Counter for the number of consecutive corrupt events encountered. More... | |
int | fBadReadCount |
Counter for the total number of corrupt events encountered. More... | |
int | fConsecutiveBadReadCount |
Counter for the number of consecutive corrupt events encountered. More... | |
uint32_t | trigmask_word1 |
Lowest word in the trigger mask only the lower 24 bit are used. More... | |
uint32_t | trigmask_word2 |
Middle word (bits 31-63) in the trigger mask. More... | |
uint32_t | trigmask_word3 |
High word (bits 64-96) in the trigger mask. More... | |
int | fTransmitDelay |
Delay in microseconds to wait between command transmission. More... | |
Definition at line 49 of file NOvASocketInputDriver.h.
|
private |
Command buffer type.
Definition at line 71 of file NOvASocketInputDriver.h.
|
private |
Event buffer type.
Definition at line 69 of file NOvASocketInputDriver.h.
|
private |
Event buffer element type.
Definition at line 70 of file NOvASocketInputDriver.h.
daq2raw::NOvASocketInputDriver::NOvASocketInputDriver | ( | fhicl::ParameterSet const & | pset, |
art::ProductRegistryHelper & | help, | ||
art::SourceHelper const & | pm | ||
) |
Class to fill the constraints on a template argument to the class, art::Source
Definition at line 68 of file NOvASocketInputDriver.cxx.
References fDoFillFlatDAQData, art::InEvent, art::InRun, and art::ProductRegistryHelper::reconstitutes().
void daq2raw::NOvASocketInputDriver::closeCurrentFile | ( | ) |
Definition at line 109 of file NOvASocketInputDriver.cxx.
References fSocket.
|
protectedinherited |
Definition at line 22 of file NOvAInputDriverBase.cxx.
References daq2raw::NOvAInputDriverBase::fGDMLBase, novadaq::cnv::kFARDET, novadaq::cnv::kNDOS, novadaq::cnv::kNEARDET, novadaq::cnv::kTESTBEAM, and string.
Referenced by daq2raw::DAQHit2Raw::beginRun(), daq2raw::NOvARawInputDriver::readNext(), readNext(), and daq2raw::TestBeamRawInputDriver::readNext().
|
inlinestaticprivate |
Definition at line 73 of file NOvASocketInputDriver.h.
Referenced by readNext().
|
inlinestaticprivate |
Definition at line 77 of file NOvASocketInputDriver.h.
References fillBadChanDBTables::result.
void daq2raw::NOvASocketInputDriver::readFile | ( | std::string const & | name, |
art::FileBlock *& | fb | ||
) |
Required function: open the file, "name" and construct and return a new FileBlock object. MUST be successful or throw: art::Exception(art::errors::FileOpenError) or art::Exception(art::errors::FileReadError) are good candidates. In this implementation, the role of the 'file' is played by a socket; we interpret the "name" as the address and port number identifying the socket.
Definition at line 123 of file NOvASocketInputDriver.cxx.
References om::cerr, run_hadd::cmd, DispatcherCMD::DSPCMD_SET_EVENTSTREAM_SINGLE, DispatcherCMD::DSPCMD_SET_TRIGGER_MASK_1, DispatcherCMD::DSPCMD_SET_TRIGGER_MASK_2, DispatcherCMD::DSPCMD_SET_TRIGGER_MASK_3, e, febshutoff_auto::end, fCurrentFilename, art::errors::FileReadError, fIoService, fSocket, fTransmitDelay, MECModelEnuComparisons::i, ip, daq2raw::parseFilename(), port, febshutoff_auto::query, string, trigmask_word1, trigmask_word2, trigmask_word3, DispatcherCMD::write(), and submit_syst::x.
bool daq2raw::NOvASocketInputDriver::readNext | ( | art::RunPrincipal *const & | inR, |
art::SubRunPrincipal *const & | inSR, | ||
art::RunPrincipal *& | outR, | ||
art::SubRunPrincipal *& | outSR, | ||
art::EventPrincipal *& | outE | ||
) |
Required function: read and fill Run, SubRun and/or Event as might be appropriate.
Define data structures, which will be filled by OnlineUnpack::ProcessRawEvent
Put FlatDAQData object
Definition at line 293 of file NOvASocketInputDriver.cxx.
References om::cerr, submit_syst::const, novadaq::timeutils::convertNovaTimeToUnixTime(), DispatcherCMD::DSPCMD_NEXT_EVENT, allTimeWatchdog::endl, fBadReadCount, fConsecutiveBadReadCount, fConsecutiveCorruptEventCount, fCorruptEventCount, fCurrentEventCapacity, fCurrentFilename, fCurrentSubRunID, fDoFillFlatDAQData, fFilterCorruptedNanoslices, daq2raw::OnlineUnpack::fFilterCorruptedNanoslices, art::errors::FileReadError, fMaxEventSizeBytes, fMaxReadAttempts, fSocket, fSocketBuffer, fSourceHelper, rawdata::RawTrigger::fTriggerTimingMarker_TimeStart, daq2raw::NOvAInputDriverBase::getDetectorGDML(), daq2raw::OnlineUnpack::getDetId(), daq2raw::OnlineUnpack::getEventNumber(), daq2raw::OnlineUnpack::getRunNumber(), daq2raw::OnlineUnpack::getSubrunNumber(), gsABORT_ON, gsMAGIC_WORD, gsUNPACK_EXCEPTION, gsUNPACK_RETURN, in_bytes(), art::SourceHelper::makeEventPrincipal(), art::SourceHelper::makeRunPrincipal(), art::SourceHelper::makeSubRunPrincipal(), printf(), daq2raw::OnlineUnpack::ProcessRawEvent(), art::put_product_in_principal(), art::SubRunID::runID(), string, msf_helper::timespec, DispatcherCMD::write(), and submit_syst::x.
|
private |
Counter for the total number of corrupt events encountered.
Definition at line 100 of file NOvASocketInputDriver.h.
Referenced by readNext().
|
private |
Counter for the number of consecutive corrupt events encountered.
Definition at line 101 of file NOvASocketInputDriver.h.
Referenced by readNext().
|
private |
Counter for the number of consecutive corrupt events encountered.
Definition at line 99 of file NOvASocketInputDriver.h.
Referenced by readNext().
|
private |
Counter for the total number of corrupt events encountered.
Definition at line 98 of file NOvASocketInputDriver.h.
Referenced by readNext().
|
private |
Current event capacity in buffer elements (current buffer size is 1 more than this);.
Definition at line 89 of file NOvASocketInputDriver.h.
Referenced by readNext().
|
private |
Hang on to the current filename.
Definition at line 85 of file NOvASocketInputDriver.h.
Referenced by readFile(), and readNext().
|
private |
Keep track of the current subRun details.
Definition at line 86 of file NOvASocketInputDriver.h.
Referenced by readNext().
|
private |
Do we need to fill FlatDAQData object?
Definition at line 94 of file NOvASocketInputDriver.h.
Referenced by NOvASocketInputDriver(), and readNext().
|
private |
Filter the corrupted nanaslices in the unpacking?
Definition at line 93 of file NOvASocketInputDriver.h.
Referenced by readNext().
|
private |
Object representing IO services of the OS.
Definition at line 87 of file NOvASocketInputDriver.h.
Referenced by readFile().
|
private |
Will not try to read an event bigger than this.
Definition at line 90 of file NOvASocketInputDriver.h.
Referenced by readNext().
|
private |
Maximum number of read attempts before we throw.
Definition at line 96 of file NOvASocketInputDriver.h.
Referenced by readNext().
|
private |
Object representing the socket from which we read.
Definition at line 88 of file NOvASocketInputDriver.h.
Referenced by closeCurrentFile(), readFile(), and readNext().
|
private |
Raw data buffer for socket communication.
Definition at line 91 of file NOvASocketInputDriver.h.
Referenced by readNext().
|
private |
Class to help with {Run, SubRun, Event}Principal construction.
Definition at line 84 of file NOvASocketInputDriver.h.
Referenced by readNext().
|
private |
Delay in microseconds to wait between command transmission.
Definition at line 107 of file NOvASocketInputDriver.h.
Referenced by readFile().
|
private |
Lowest word in the trigger mask only the lower 24 bit are used.
Definition at line 103 of file NOvASocketInputDriver.h.
Referenced by readFile().
|
private |
Middle word (bits 31-63) in the trigger mask.
Definition at line 104 of file NOvASocketInputDriver.h.
Referenced by readFile().
|
private |
High word (bits 64-96) in the trigger mask.
Definition at line 105 of file NOvASocketInputDriver.h.
Referenced by readFile().