JAPAn
Just Another Parity Analyzer
Loading...
Searching...
No Matches
Coda3EventDecoder Class Reference

CODA version 3 event decoder implementation. More...

#include <Coda3EventDecoder.h>

+ Inheritance diagram for Coda3EventDecoder:
+ Collaboration diagram for Coda3EventDecoder:

Data Structures

class  coda_format_error
 
class  TBOBJ
 

Public Types

enum  { HED_OK = 0 , HED_WARN = -63 , HED_ERR = -127 , HED_FATAL = -255 }
 

Public Member Functions

 Coda3EventDecoder ()
 
 ~Coda3EventDecoder () override
 
std::vector< UInt_t > EncodePHYSEventHeader (std::vector< ROCID_t > &ROCList) override
 
void EncodePrestartEventHeader (int *buffer, int runnumber, int runtype, int localtime) override
 
void EncodeGoEventHeader (int *buffer, int eventcount, int localtime) override
 
void EncodePauseEventHeader (int *buffer, int eventcount, int localtime) override
 
void EncodeEndEventHeader (int *buffer, int eventcount, int localtime) override
 
Int_t DecodeEventIDBank (UInt_t *buffer) override
 
- Public Member Functions inherited from VEventDecoder
 VEventDecoder ()
 
virtual ~VEventDecoder ()
 
virtual Bool_t DecodeSubbankHeader (UInt_t *buffer)
 Decode the subbank header for the current event/bank context.
 
virtual Bool_t IsPhysicsEvent ()
 
virtual Bool_t IsROCConfigurationEvent ()
 
virtual Bool_t IsEPICSEvent ()
 
UInt_t GetWordsSoFar () const
 
UInt_t GetEvtNumber () const
 
UInt_t GetEvtLength () const
 
UInt_t GetFragLength () const
 
UInt_t GetEvtType () const
 
UInt_t GetBankDataType () const
 
UInt_t GetSubbankTag () const
 
UInt_t GetSubbankType () const
 
ROCID_t GetROC () const
 
void SetWordsSoFar (UInt_t val)
 
void AddWordsSoFarAndFragLength ()
 
void SetFragLength (UInt_t val)
 
void SetAllowLowSubbankIDs (Bool_t val=kFALSE)
 
- Public Member Functions inherited from MQwCodaControlEvent
 MQwCodaControlEvent ()
 
 ~MQwCodaControlEvent ()
 
void ResetControlParameters ()
 
void ProcessControlEvent (UInt_t evtype, UInt_t *buffer)
 
void ReportRunSummary ()
 
UInt_t GetStartTime ()
 
UInt_t GetPrestartTime ()
 
UInt_t GetPrestartRunNumber ()
 
UInt_t GetRunType ()
 
UInt_t GetGoTime (int index=0)
 
UInt_t GetGoEventCount (int index=0)
 
UInt_t GetPauseTime (int index=0)
 
UInt_t GetPauseEventCount (int index=0)
 
UInt_t GetEndTime ()
 
UInt_t GetEndEventCount ()
 
TString GetStartSQLTime ()
 
TString GetEndSQLTime ()
 
time_t GetStartUnixTime ()
 
time_t GetEndUnixTime ()
 

Static Public Attributes

static const UInt_t MAX_PHYS_EVTYPE = 14
 
static const UInt_t TS_PRESCALE_EVTYPE = 120
 
static const UInt_t PRESCALE_EVTYPE = 133
 
static const UInt_t DETMAP_FILE = 135
 
static const UInt_t DAQCONFIG_FILE1 = 137
 
static const UInt_t DAQCONFIG_FILE2 = 138
 
static const UInt_t TRIGGER_FILE = 136
 
static const UInt_t SCALER_EVTYPE = 140
 
static const UInt_t SBSSCALER_EVTYPE = 141
 
static const UInt_t HV_DATA_EVTYPE = 150
 

Protected Member Functions

UInt_t InterpretBankTag (UInt_t tag)
 
Int_t trigBankDecode (UInt_t *buffer)
 
void trigBankErrorHandler (Int_t flag)
 
ULong64_t GetEvTime () const
 
void SetEvTime (ULong64_t evtime)
 
Int_t LoadTrigBankInfo (UInt_t index_buffer)
 
- Protected Member Functions inherited from MQwCodaControlEvent
void ProcessSync (UInt_t local_time, UInt_t statuscode)
 
void ProcessPrestart (UInt_t local_time, UInt_t local_runnumber, UInt_t local_runtype)
 
void ProcessGo (UInt_t local_time, UInt_t evt_count)
 
void ProcessPause (UInt_t local_time, UInt_t evt_count)
 
void ProcessEnd (UInt_t local_time, UInt_t evt_count)
 

Protected Attributes

UInt_t tsEvType
 
UInt_t block_size
 
ULong64_t evt_time
 
UInt_t trigger_bits
 
TBOBJ tbank
 
uint32_t TSROCNumber
 
- Protected Attributes inherited from VEventDecoder
UInt_t fWordsSoFar
 
UInt_t fEvtLength
 
UInt_t fEvtNumber
 CODA event number; only defined for physics events.
 
UInt_t fFragLength
 
UInt_t fEvtType
 
UInt_t fEvtTag
 
UInt_t fBankDataType
 
BankID_t fSubbankTag
 
UInt_t fSubbankType
 
UInt_t fSubbankNum
 
ROCID_t fROC
 
Bool_t fPhysicsEventFlag
 
Bool_t fControlEventFlag
 
Bool_t fAllowLowSubbankIDs
 
- Protected Attributes inherited from MQwCodaControlEvent
Bool_t fFoundControlEvents
 
UInt_t fPrestartTime
 
UInt_t fPrestartRunNumber
 
UInt_t fRunType
 
UInt_t fEndTime
 
UInt_t fEndEventCount
 
UInt_t fNumberPause
 
std::vector< UInt_t > fPauseEventCount
 
std::vector< UInt_t > fPauseTime
 
UInt_t fNumberGo
 
std::vector< UInt_t > fGoEventCount
 
std::vector< UInt_t > fGoTime
 
UInt_t fStartTime
 
TDatime fPrestartDatime
 
TDatime fStartDatime
 
TDatime fEndDatime
 

Private Member Functions

void printUserEvent (const UInt_t *buffer)
 
void PrintDecoderInfo (QwLog &out) override
 

Additional Inherited Members

- Protected Types inherited from VEventDecoder
enum  KEYWORDS { EPICS_EVTYPE = 131 }
 
- Protected Types inherited from MQwCodaControlEvent
enum  EventTypes {
  kSYNC_EVENT = 16 , kPRESTART_EVENT = 17 , kGO_EVENT = 18 , kPAUSE_EVENT = 19 ,
  kEND_EVENT = 20
}
 

Detailed Description

CODA version 3 event decoder implementation.

Concrete decoder for CODA 3.x format event streams, handling the specific data structures, bank formats, and trigger information used in CODA 3. Provides encoding and decoding capabilities for both real and mock data.

Definition at line 22 of file Coda3EventDecoder.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
HED_OK 
HED_WARN 
HED_ERR 
HED_FATAL 

Definition at line 94 of file Coda3EventDecoder.h.

Constructor & Destructor Documentation

◆ Coda3EventDecoder()

Coda3EventDecoder::Coda3EventDecoder ( )
inline

Definition at line 25 of file Coda3EventDecoder.h.

References block_size, evt_time, trigger_bits, tsEvType, and TSROCNumber.

◆ ~Coda3EventDecoder()

Coda3EventDecoder::~Coda3EventDecoder ( )
inlineoverride

Definition at line 31 of file Coda3EventDecoder.h.

31{ }

Member Function Documentation

◆ DecodeEventIDBank()

Int_t Coda3EventDecoder::DecodeEventIDBank ( UInt_t * buffer)
overridevirtual

Determine if a buffer contains a PHYS, control, or other event.

Parameters
bufferEvent buffer to decode.
Returns
CODA_OK on success.

Implements VEventDecoder.

Definition at line 95 of file Coda3EventDecoder.cc.

96{
97 fPhysicsEventFlag = kFALSE;
98 fControlEventFlag = kFALSE;
99 Int_t ret = HED_OK;
100
101 // Main engine for decoding, called by public LoadEvent() methods
102 // this assert checks to see if buffer points to NULL
103 assert(buffer);
104
105 // General Event information
106 fEvtLength = buffer[0]+1; // in longwords (4 bytes)
107 fEvtType = 0;
108 fEvtTag = 0;
109 fBankDataType = 0;
110
111 // Prep TBOBJ variables
112 tbank.Clear();
113 tsEvType = 0;
114 evt_time = 0;
115 trigger_bits = 0;
116 block_size = 0;
117
118 // Start Filling Data
119 fEvtTag = (buffer[1] & 0xffff0000) >> 16;
120 fBankDataType = (buffer[1] & 0xff00) >> 8;
121 block_size = (buffer[1] & 0xff);
122
123 if(block_size > 1) {
124 QwWarning << "MultiBlock is not properly supported! block_size = "
126 }
127
128 // Determine the event type by the evt tag
130 fWordsSoFar = (2);
131 if(fEvtTag < 0xff00) {
132 // User Event
133 printUserEvent(buffer);
134 }
135 else if(fControlEventFlag) {
137 }
138 else if(fPhysicsEventFlag) {
139 ret = trigBankDecode( buffer );
140 if(ret != HED_OK) { trigBankErrorHandler( ret ); }
141 else {
142 fEvtNumber = tbank.evtNum;
143 fWordsSoFar = 2 + tbank.len;
144 }
145 }
146 else {
147 // Not a control event, user event, nor physics event. Not sure what it is
148 // Arbitrarily set the event type to "fEvtTag".
149 // The first two words have been examined.
150 QwWarning << "Undetermined Event Type" << QwLog::endl;
151 for(size_t index = 0; fEvtLength; index++){
152 QwVerbose << "\t" << buffer[index];
153 if(index % 4 == 0){ QwVerbose << QwLog::endl; }
154 }
156 }
157
159 QwDebug << Form("buffer[0-1] 0x%x 0x%x ; ", buffer[0], buffer[1]);
161 PrintDecoderInfo(gQwLog(QwLog::kDebug,__PRETTY_FUNCTION__));
162 }
163
164 return CODA_OK;
165}
#define QwVerbose
Predefined log drain for verbose messages.
Definition QwLog.h:54
QwLog gQwLog
Definition QwLog.cc:20
#define QwWarning
Predefined log drain for warnings.
Definition QwLog.h:44
#define QwDebug
Predefined log drain for debugging output.
Definition QwLog.h:59
Int_t trigBankDecode(UInt_t *buffer)
void trigBankErrorHandler(Int_t flag)
void printUserEvent(const UInt_t *buffer)
void PrintDecoderInfo(QwLog &out) override
UInt_t InterpretBankTag(UInt_t tag)
void ProcessControlEvent(UInt_t evtype, UInt_t *buffer)
@ kDebug
Definition QwLog.h:94
static std::ostream & endl(std::ostream &)
End of the line.
Definition QwLog.cc:297
QwLogLevel GetLogLevel() const
Get highest log level.
Definition QwLog.h:131
Bool_t fPhysicsEventFlag
UInt_t fEvtNumber
CODA event number; only defined for physics events.
Bool_t fControlEventFlag

References block_size, QwLog::endl(), evt_time, VEventDecoder::fBankDataType, VEventDecoder::fControlEventFlag, VEventDecoder::fEvtLength, VEventDecoder::fEvtNumber, VEventDecoder::fEvtTag, VEventDecoder::fEvtType, VEventDecoder::fFragLength, VEventDecoder::fPhysicsEventFlag, VEventDecoder::fWordsSoFar, gQwLog, HED_OK, InterpretBankTag(), QwLog::kDebug, PrintDecoderInfo(), printUserEvent(), MQwCodaControlEvent::ProcessControlEvent(), QwDebug, QwVerbose, QwWarning, tbank, trigBankDecode(), trigBankErrorHandler(), trigger_bits, and tsEvType.

+ Here is the call graph for this function:

◆ EncodeEndEventHeader()

void Coda3EventDecoder::EncodeEndEventHeader ( int * buffer,
int eventcount,
int localtime )
overridevirtual

Create an END event EVIO header.

Parameters
bufferOutput buffer (>= 5 words).
eventcountNumber of events.
localtimeEvent time.

Implements VEventDecoder.

Definition at line 84 of file Coda3EventDecoder.cc.

85{
86 buffer[0] = 4; // End event length
87 buffer[1] = ((0xffd4 << 16) | (0x01 << 8) );
88 buffer[2] = localtime;
89 buffer[3] = 0; // unused
90 buffer[4] = eventcount;
91 ProcessEnd(localtime, eventcount);
92}
void ProcessEnd(UInt_t local_time, UInt_t evt_count)

References MQwCodaControlEvent::ProcessEnd().

+ Here is the call graph for this function:

◆ EncodeGoEventHeader()

void Coda3EventDecoder::EncodeGoEventHeader ( int * buffer,
int eventcount,
int localtime )
overridevirtual

Create a GO event EVIO header.

Parameters
bufferOutput buffer (>= 5 words).
eventcountNumber of events.
localtimeEvent time.

Implements VEventDecoder.

Definition at line 62 of file Coda3EventDecoder.cc.

63{
64 buffer[0] = 4; // Go event length
65 buffer[1] = ((0xffd2 << 16) | (0x01 << 8) );
66 buffer[2] = localtime;
67 buffer[3] = 0; // unused
68 buffer[4] = eventcount;
69 ProcessGo(localtime, eventcount);
70}
void ProcessGo(UInt_t local_time, UInt_t evt_count)

References MQwCodaControlEvent::ProcessGo().

+ Here is the call graph for this function:

◆ EncodePauseEventHeader()

void Coda3EventDecoder::EncodePauseEventHeader ( int * buffer,
int eventcount,
int localtime )
overridevirtual

Create a PAUSE event EVIO header.

Parameters
bufferOutput buffer (>= 5 words).
eventcountNumber of events.
localtimeEvent time.

Implements VEventDecoder.

Definition at line 73 of file Coda3EventDecoder.cc.

74{
75 buffer[0] = 4; // Pause event length
76 buffer[1] = ((0xffd3 << 16) | (0x01 << 8) );
77 buffer[2] = localtime;
78 buffer[3] = 0; // unused
79 buffer[4] = eventcount;
80 ProcessPause(localtime, eventcount);
81}
void ProcessPause(UInt_t local_time, UInt_t evt_count)

References MQwCodaControlEvent::ProcessPause().

+ Here is the call graph for this function:

◆ EncodePHYSEventHeader()

std::vector< UInt_t > Coda3EventDecoder::EncodePHYSEventHeader ( std::vector< ROCID_t > & ROCList)
overridevirtual

Create a PHYS event EVIO header.

Parameters
ROCListList of ROC IDs.
Returns
Vector of 32-bit words containing the header.

Implements VEventDecoder.

Definition at line 17 of file Coda3EventDecoder.cc.

18{
19 int localtime = (int) time(0);
20 int ROCCount = ROCList.size();
21 int wordcount = (8 + ROCCount*3);
22 std::vector<UInt_t> header;
23 header.push_back(0xFF501001);
24 header.push_back(wordcount); // word count for Trigger Bank
25 header.push_back(0xFF212000 | ROCCount); // # of ROCs
26
27 header.push_back(0x010a0004);
28 // evtnum is held by a 64 bit ... for now we set the upper 32 bits to 0
29 header.push_back(++fEvtNumber );
30 header.push_back(0x0);
31
32 // evttime is held by a 64 bit (bits 0-48 is the time) ... for now we set the upper 32 bits to 0
33 header.push_back(localtime);
34 header.push_back(0x0);
35
36 header.push_back(0x1850001);
37 header.push_back(0xc0da); // TS# Trigger
38 for(auto it = ROCList.begin(); it != ROCList.end(); it++){
39 int base = 0x010002;
40 int roc = (*it << 24);
41 header.push_back(roc | base);
42 header.push_back(0x4D6F636B); // ASCII for 'MOCK'
43 header.push_back(0x4D6F636B); // ASCII for 'MOCK'
44 }
45
46 return header;
47}

References VEventDecoder::fEvtNumber.

◆ EncodePrestartEventHeader()

void Coda3EventDecoder::EncodePrestartEventHeader ( int * buffer,
int runnumber,
int runtype,
int localtime )
overridevirtual

Create a PRESTART event EVIO header.

Parameters
bufferOutput buffer (>= 5 words).
runnumberRun number.
runtypeRun type.
localtimeEvent time.

Implements VEventDecoder.

Definition at line 51 of file Coda3EventDecoder.cc.

52{
53 buffer[0] = 4; // Prestart event length
54 buffer[1] = ((0xffd1 << 16) | (0x01 << 8));
55 buffer[2] = localtime;
56 buffer[3] = runnumber;
57 buffer[4] = runtype;
58 ProcessPrestart(localtime, runnumber, runtype);
59}
void ProcessPrestart(UInt_t local_time, UInt_t local_runnumber, UInt_t local_runtype)

References MQwCodaControlEvent::ProcessPrestart().

+ Here is the call graph for this function:

◆ GetEvTime()

ULong64_t Coda3EventDecoder::GetEvTime ( ) const
inlineprotected

Definition at line 87 of file Coda3EventDecoder.h.

87{ return evt_time; }

References evt_time.

◆ InterpretBankTag()

UInt_t Coda3EventDecoder::InterpretBankTag ( UInt_t tag)
protected

Determine event type and set control/physics flags based on bank tag.

Definition at line 168 of file Coda3EventDecoder.cc.

169{
170 UInt_t evtyp{};
171 if( tag >= 0xff00 ) { // CODA Reserved bank type
172 switch( tag ) {
173 case 0xffd1:
174 evtyp = kPRESTART_EVENT;
175 fControlEventFlag = kTRUE;
176 break;
177 case 0xffd2:
178 evtyp = kGO_EVENT;
179 fControlEventFlag = kTRUE;
180 break;
181 case 0xffd4:
182 evtyp = kEND_EVENT;
183 fControlEventFlag = kTRUE;
184 break;
185 case 0xff50:
186 case 0xff58: // Physics event with sync bit
187 case 0xFF78:
188 case 0xff70:
189 evtyp = 1; // for CODA 3.* physics events are type 1.
190 fPhysicsEventFlag=kTRUE;
191 break;
192 default: // Undefined CODA 3 event type
193 QwWarning << "CodaDecoder:: WARNING: Undefined CODA 3 event type, tag = "
194 << "0x" << std::hex << tag << std::dec << QwLog::endl;
195 evtyp = 0;
196 //FIXME evtyp = 0 could also be a user event type ...
197 // maybe throw an exception here?
198 }
199 } else { // User event type
200 evtyp = tag; // EPICS, ROC CONFIG, ET-insertions, etc.
201 }
202 return evtyp;
203}

References QwLog::endl(), VEventDecoder::fControlEventFlag, VEventDecoder::fPhysicsEventFlag, MQwCodaControlEvent::kEND_EVENT, MQwCodaControlEvent::kGO_EVENT, MQwCodaControlEvent::kPRESTART_EVENT, and QwWarning.

Referenced by DecodeEventIDBank().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LoadTrigBankInfo()

Int_t Coda3EventDecoder::LoadTrigBankInfo ( UInt_t index_buffer)
protected

Load TI trigger bank info for the i-th event in block.

Definition at line 374 of file Coda3EventDecoder.cc.

375{
376 // CODA3: Load tsEvType, evt_time, and trigger_bits for i-th event
377 // in event block buffer. index_buffer must be < block size.
378
379 assert(i < tbank.blksize);
380 if( i >= tbank.blksize )
381 return -1;
382 tsEvType = tbank.evType[i]; // event type (configuration-dependent)
383 if( tbank.evTS ) {
384 // Use memcpy to safely read potentially unaligned 64-bit timestamp
385 uint64_t timestamp;
386 memcpy(&timestamp, &tbank.evTS[i], sizeof(timestamp));
387 evt_time = timestamp; // event time (4ns clock, I think)
388 }
389 else if( tbank.TSROC ) {
390 UInt_t struct_size = tbank.withTriggerBits() ? 3 : 2;
391 // Use memcpy to safely read potentially unaligned 64-bit value
392 uint64_t timestamp;
393 memcpy(&timestamp, tbank.TSROC + struct_size * i, sizeof(timestamp));
394 evt_time = timestamp;
395 // Only the lower 48 bits seem to contain the time
396 evt_time &= 0x0000FFFFFFFFFFFF;
397 }
398 if( tbank.withTriggerBits() ){
399 // Trigger bits. Only the lower 6 bits seem to contain the actual bits
400 uint32_t trigger_word;
401 memcpy(&trigger_word, &tbank.TSROC[2 + 3 * i], sizeof(trigger_word));
402 trigger_bits = trigger_word & 0x3F;
403 }
404 return 0;
405}

References evt_time, tbank, trigger_bits, and tsEvType.

Referenced by trigBankDecode().

+ Here is the caller graph for this function:

◆ PrintDecoderInfo()

void Coda3EventDecoder::PrintDecoderInfo ( QwLog & out)
overrideprivatevirtual

Print internal decoder state for diagnostics.

Reimplemented from VEventDecoder.

Definition at line 262 of file Coda3EventDecoder.cc.

263{
264
265 out << Form("Event Number: %d; Length: %d; Tag: 0x%x; Bank data type: 0x%x ",
267 << Form("Evt type: 0x%x; Evt number %d; fWordsSoFar %d",
269 << QwLog::endl;
270}

References QwLog::endl(), VEventDecoder::fBankDataType, VEventDecoder::fEvtLength, VEventDecoder::fEvtNumber, VEventDecoder::fEvtTag, VEventDecoder::fEvtType, and VEventDecoder::fWordsSoFar.

Referenced by DecodeEventIDBank().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ printUserEvent()

void Coda3EventDecoder::printUserEvent ( const UInt_t * buffer)
private

Print non-PHYS, non-control "user" events.

Definition at line 207 of file Coda3EventDecoder.cc.

208{
209 // checks of ET-inserted data
210 Int_t print_it=0;
211
212 switch( fEvtType ) {
213
214 case EPICS_EVTYPE:
215 // QwMessage << "EPICS data "<<QwLog::endl;
216 // print_it=1;
217 break;
218 // Do we need this event?
219 case PRESCALE_EVTYPE:
220 QwMessage << "Prescale data "<<QwLog::endl;
221 print_it=1;
222 break;
223 // Do we need this event?
224 case DAQCONFIG_FILE1:
225 QwMessage << "DAQ config file 1 "<<QwLog::endl;
226 print_it=1;
227 break;
228 // Do we need this event?
229 case DAQCONFIG_FILE2:
230 QwMessage << "DAQ config file 2 "<<QwLog::endl;
231 print_it=1;
232 break;
233 // Do we need this event?
234 case SCALER_EVTYPE:
235 QwMessage << "LHRS scaler event "<<QwLog::endl;
236 print_it=1;
237 break;
238 // Do we need this event?
239 case SBSSCALER_EVTYPE:
240 QwMessage << "SBS scaler event "<<QwLog::endl;
241 print_it=1;
242 break;
243 // Do we need this event?
244 case HV_DATA_EVTYPE:
245 QwMessage << "High voltage data event "<<QwLog::endl;
246 print_it=1;
247 break;
248 default:
249 // something else ?
250 QwWarning << "\n--- Special event type: " << fEvtTag << " ---\n" << QwLog::endl;
251 }
252 if(print_it) {
253 char *cbuf = (char *)buffer; // These are character data
254 size_t elen = sizeof(int)*(buffer[0]+1);
255 QwMessage << "Dump of event buffer . Len = "<<elen<<QwLog::endl;
256 // This dump will look exactly like the text file that was inserted.
257 for (size_t ii=0; ii<elen; ii++) QwMessage << cbuf[ii];
258 }
259}
#define QwMessage
Predefined log drain for regular messages.
Definition QwLog.h:49
static const UInt_t SCALER_EVTYPE
static const UInt_t SBSSCALER_EVTYPE
static const UInt_t HV_DATA_EVTYPE
static const UInt_t DAQCONFIG_FILE2
static const UInt_t DAQCONFIG_FILE1
static const UInt_t PRESCALE_EVTYPE

References DAQCONFIG_FILE1, DAQCONFIG_FILE2, QwLog::endl(), VEventDecoder::EPICS_EVTYPE, VEventDecoder::fEvtTag, VEventDecoder::fEvtType, HV_DATA_EVTYPE, PRESCALE_EVTYPE, QwMessage, QwWarning, SBSSCALER_EVTYPE, and SCALER_EVTYPE.

Referenced by DecodeEventIDBank().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetEvTime()

void Coda3EventDecoder::SetEvTime ( ULong64_t evtime)
inlineprotected

Definition at line 88 of file Coda3EventDecoder.h.

88{ evt_time = evtime; }

References evt_time.

◆ trigBankDecode()

Int_t Coda3EventDecoder::trigBankDecode ( UInt_t * buffer)
protected

Decode the TI trigger bank for PHYS events.

Definition at line 273 of file Coda3EventDecoder.cc.

274{
275 const char* const HERE = "Coda3EventDecoder::trigBankDecode";
276 if(block_size == 0) {
277 QwError << HERE << ": CODA 3 Format Error: Physics event #" << fEvtNumber
278 << " with block size 0" << QwLog::endl;
279 return HED_ERR;
280 }
281 // Set up exception handling for the PHYS Bank
282 try {
283 tbank.Fill(&buffer[fWordsSoFar], block_size, TSROCNumber);
284 }
285 catch( const coda_format_error& e ) {
286 Error(HERE, "CODA 3 format error: %s", e.what() );
287 return HED_ERR;
288 }
289 // Copy pertinent data to member variables for faster retrieval
290 LoadTrigBankInfo(0); // Load data for first event in block
291 return HED_OK;
292}
#define QwError
Predefined log drain for errors.
Definition QwLog.h:39
Int_t LoadTrigBankInfo(UInt_t index_buffer)

References block_size, QwLog::endl(), VEventDecoder::fEvtNumber, VEventDecoder::fWordsSoFar, HED_ERR, HED_OK, LoadTrigBankInfo(), QwError, tbank, and TSROCNumber.

Referenced by DecodeEventIDBank().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ trigBankErrorHandler()

void Coda3EventDecoder::trigBankErrorHandler ( Int_t flag)
protected

Display a warning and reset state for a given TI error flag.

Definition at line 409 of file Coda3EventDecoder.cc.

410{
411 switch(flag){
412 case HED_OK:
413 QwWarning << "TrigBankDecode() returned HED_OK... why are we here?" << QwLog::endl;
414 break;
415 case HED_WARN:
416 QwError << "TrigBankDecode() returned HED_WARN" << QwLog::endl;
417 break;
418 case HED_ERR:
419 QwError << "TrigBankDecode() returned HED_ERR" << QwLog::endl;
420 break;
421 case HED_FATAL:
422 QwError << "TrigBankDecoder() returned HED_FATAL" << QwLog::endl;
423 break;
424 default:
425 QwError << "TrigBankDecoder() returned an Unknown Error" << QwLog::endl;
426 break;
427 }
428 // Act as if we are at the end of the event and set everything to false (0)
429 QwWarning << "Skipping to the end of the event and setting everything to false (0)!" << QwLog::endl;
430 fPhysicsEventFlag = kFALSE;
431 fControlEventFlag = kFALSE;
432
433 fEvtType = 0;
434 fEvtTag = 0;
435 fBankDataType = 0;
436 tbank.Clear();
437 tsEvType = 0;
438 evt_time = 0;
439 trigger_bits = 0;
440 block_size = 0;
441
443}

References block_size, QwLog::endl(), evt_time, VEventDecoder::fBankDataType, VEventDecoder::fControlEventFlag, VEventDecoder::fEvtLength, VEventDecoder::fEvtTag, VEventDecoder::fEvtType, VEventDecoder::fPhysicsEventFlag, VEventDecoder::fWordsSoFar, HED_ERR, HED_FATAL, HED_OK, HED_WARN, QwError, QwWarning, tbank, trigger_bits, and tsEvType.

Referenced by DecodeEventIDBank().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ block_size

UInt_t Coda3EventDecoder::block_size
protected

◆ DAQCONFIG_FILE1

const UInt_t Coda3EventDecoder::DAQCONFIG_FILE1 = 137
static

Definition at line 140 of file Coda3EventDecoder.h.

Referenced by printUserEvent().

◆ DAQCONFIG_FILE2

const UInt_t Coda3EventDecoder::DAQCONFIG_FILE2 = 138
static

Definition at line 141 of file Coda3EventDecoder.h.

Referenced by printUserEvent().

◆ DETMAP_FILE

const UInt_t Coda3EventDecoder::DETMAP_FILE = 135
static

Definition at line 139 of file Coda3EventDecoder.h.

◆ evt_time

ULong64_t Coda3EventDecoder::evt_time
protected

◆ HV_DATA_EVTYPE

const UInt_t Coda3EventDecoder::HV_DATA_EVTYPE = 150
static

Definition at line 145 of file Coda3EventDecoder.h.

Referenced by printUserEvent().

◆ MAX_PHYS_EVTYPE

const UInt_t Coda3EventDecoder::MAX_PHYS_EVTYPE = 14
static

Definition at line 134 of file Coda3EventDecoder.h.

◆ PRESCALE_EVTYPE

const UInt_t Coda3EventDecoder::PRESCALE_EVTYPE = 133
static

Definition at line 138 of file Coda3EventDecoder.h.

Referenced by printUserEvent().

◆ SBSSCALER_EVTYPE

const UInt_t Coda3EventDecoder::SBSSCALER_EVTYPE = 141
static

Definition at line 144 of file Coda3EventDecoder.h.

Referenced by printUserEvent().

◆ SCALER_EVTYPE

const UInt_t Coda3EventDecoder::SCALER_EVTYPE = 140
static

Definition at line 143 of file Coda3EventDecoder.h.

Referenced by printUserEvent().

◆ tbank

TBOBJ Coda3EventDecoder::tbank
protected

◆ trigger_bits

UInt_t Coda3EventDecoder::trigger_bits
protected

◆ TRIGGER_FILE

const UInt_t Coda3EventDecoder::TRIGGER_FILE = 136
static

Definition at line 142 of file Coda3EventDecoder.h.

◆ TS_PRESCALE_EVTYPE

const UInt_t Coda3EventDecoder::TS_PRESCALE_EVTYPE = 120
static

Definition at line 135 of file Coda3EventDecoder.h.

◆ tsEvType

UInt_t Coda3EventDecoder::tsEvType
protected

◆ TSROCNumber

uint32_t Coda3EventDecoder::TSROCNumber
protected

Definition at line 151 of file Coda3EventDecoder.h.

Referenced by Coda3EventDecoder(), and trigBankDecode().


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