15#include "TStopwatch.h"
17#include "THaCodaData.h"
22#include <unordered_map>
120 Int_t
OpenDataFile(UInt_t current_run,
const TString rw =
"R");
121 Int_t
OpenDataFile(
const TString filename,
const TString rw =
"R");
124 Int_t
OpenETStream(TString computer, TString session,
int mode,
const TString stationname=
"");
128 return (
decoder->IsPhysicsEvent() );
147 return (
decoder->IsROCConfigurationEvent() );
151 return (
decoder->IsEPICSEvent() );
238 const TString&
DataFile(
const UInt_t run,
const Short_t seg);
269 std::unordered_map<RocBankLabel_t, std::vector<UInt_t> >
fMarkerList;
270 std::unordered_map<RocBankLabel_t, std::vector<UInt_t> >
fOffsetList;
274 UInt_t
FindMarkerWord(UInt_t markerID, UInt_t* buffer, UInt_t num_words);
299 Bool_t okay = kFALSE;
300 UInt_t *localbuff = (UInt_t*)(
fEvStream->getEvBuffer());
303 decoder->AddWordsSoFarAndFragLength();
304 }
else if (
object.CanUseThisEventType(
decoder->GetEvtType())){
306 object.ClearEventData(
decoder->GetEvtType());
308 if (
decoder->GetBankDataType() == 0x10){
310 while ((okay =
decoder->DecodeSubbankHeader(&localbuff[
decoder->GetWordsSoFar()]))){
312 if (
decoder->GetSubbankType() == 0x10)
continue;
316 decoder->AddWordsSoFarAndFragLength();
320 &localbuff[
decoder->GetWordsSoFar()],
322 decoder->AddWordsSoFarAndFragLength();
326 object.ProcessBuffer(
decoder->GetEvtType(), 0,
decoder->GetBankDataType(),
327 &localbuff[
decoder->GetWordsSoFar()],
CODA control event data structure and management.
Parameter file parsing and management.
Virtual base class for event decoders to encode and decode CODA data.
CODA version 3 event decoder implementation.
CODA version 2 event decoder implementation.
unsigned long long ULong64_t
EPICS slow controls data management.
TString GetRunLabel() const
Returns a string like <run#> or <run#>.<file#>
static void SetDefaultDataFileExtension(const std::string &extension)
Int_t EncodeSubsystemData(QwSubsystemArray &subsystems)
static const Int_t kRunNotSegmented
time_t GetStartUnixTime()
ULong64_t RocBankLabel_t
Methods and data members needed to find marker words.
const TString & GetDataDirectory() const
UInt_t fStartingPhysicsEvent
std::pair< UInt_t, UInt_t > GetEventRange() const
static std::string fDefaultDataDirectory
std::unordered_map< RocBankLabel_t, std::vector< UInt_t > > fMarkerList
enum QwEventBuffer::CodaStreamMode fEvStreamMode
Int_t CloseStream()
Closes a currently open event stream.
Int_t OpenETStream(TString computer, TString session, int mode, const TString stationname="")
Bool_t GetNextRunRange()
Read the next requested run range, return true if success.
Int_t EncodePrestartEvent(int runnumber, int runtype=0)
QwEventBuffer()
Default constructor.
void VerifyCodaVersion(const UInt_t *buffer)
Int_t WriteFileEvent(int *buffer)
Int_t OpenNextStream()
Opens the event stream (file or ET) based on the internal flags.
static const Int_t kFileHandleNotConfigured
std::vector< Int_t >::iterator fRunSegmentIterator
static void SetDefaultDataDirectory(const std::string &dir)
void ProcessOptions(QwOptions &options)
Sets internal flags based on the QwOptions.
Bool_t FillSubsystemData(QwSubsystemArray &subsystems)
TStopwatch fStopwatch
Timer used for internal timing.
Int_t WriteEvent(int *buffer)
Int_t GetSegmentNumber() const
Return CODA file segment number.
std::unique_ptr< QwParameterFile > fEventListFile
void ResetControlParameters()
const TString & DataFile(const UInt_t run, const Short_t seg)
TString GetStartSQLTime()
void SetDataDirectory(const TString datadir)
static void DefineOptions(QwOptions &options)
std::unordered_map< RocBankLabel_t, std::vector< UInt_t > > fOffsetList
const TString & GetDataFile() const
static void SetDefaultDataFileStem(const std::string &stem)
Double_t fCleanParameter[3]
Scan data/clean data from the green monster.
UInt_t FindMarkerWord(UInt_t markerID, UInt_t *buffer, UInt_t num_words)
TString fDataFileExtension
Int_t GetRunNumber() const
Return CODA file run number.
std::vector< Int_t > fRunRangeMinList
std::vector< Int_t > fRunRangeMaxList
static const UInt_t kNullDataWord
static const Int_t kNoNextDataFile
Bool_t IsROCConfigurationEvent()
RocBankLabel_t fThisRocBankLabel
Int_t GetPhysicsEventNumber()
Bool_t GetNextEventRange()
Read the next requested event range, return true if success.
Bool_t DataFileIsSegmented()
std::pair< Int_t, Int_t > fRunRange
std::pair< UInt_t, UInt_t > fEventRange
Int_t OpenDataFile(UInt_t current_run, Short_t seg)
static std::string fDefaultDataFileExtension
void ClearEventData(std::vector< VQwSubsystem * > &subsystems)
std::string fRunListFileName
Bool_t FillObjectWithEventData(T &t)
Bool_t FillSubsystemData(std::vector< VQwSubsystem * > &subsystems)
TStopwatch fRunTimer
Timer used for runlet processing loop.
static std::string fDefaultDataFileStem
Bool_t GetNextRunNumber()
Get the next run in the active run range, proceed to next range if needed.
Bool_t FillEPICSData(QwEPICSEvent &epics)
Bool_t FillSubsystemConfigurationData(std::vector< VQwSubsystem * > &subsystems)
Bool_t AreRunletsSplit() const
Return true if file segments are being separated for.
std::pair< Int_t, Int_t > fSegmentRange
std::unique_ptr< QwParameterFile > fRunListFile
std::vector< UInt_t > fEventList
std::string fEventListFileName
std::size_t CheckForMarkerWords(QwSubsystemArray &subsystems)
std::vector< Int_t > fRunSegments
Bool_t FillSubsystemConfigurationData(QwSubsystemArray &subsystems)
UInt_t GetMarkerWord(UInt_t markerID)
Command-line and configuration file options processor.
Container for managing multiple subsystems with common operations.
Abstract base for CODA event encoding and decoding.
Base class for subsystems implementing container-delegation pattern.