Hall C ROOT/C++ Analyzer (hcana)
Loading...
Searching...
No Matches
TIBlobModule.h
Go to the documentation of this file.
1#ifndef TIBlobModule_
2#define TIBlobModule_
3
4
6//
7// TIBlobModule
8// TI Trigger information
9// This version just pulls out
10// Trigger type
11// Event number (just bottom 32 bits)
12// 4ns clock
13//
15
16#include "PipeliningModule.h"
17#include <string>
18
19namespace Decoder {
20
22
23public:
24
26 TIBlobModule(UInt_t crate, UInt_t slot);
27 virtual ~TIBlobModule();
28
29 using Module::GetData;
30
31 virtual UInt_t GetData(UInt_t chan) const;
32 virtual void Init();
33 virtual void Init( const char* configstr );
34 virtual void Clear(const Option_t *opt="");
35 virtual Int_t Decode(const UInt_t*) { return 0; }
36 virtual UInt_t LoadSlot( THaSlotData *sldat, const UInt_t *evbuffer, const UInt_t *pstop );
37 virtual UInt_t LoadSlot( THaSlotData *sldat, const UInt_t* evbuffer, UInt_t pos, UInt_t len);
38 virtual UInt_t LoadBank( THaSlotData* sldat, const UInt_t* evbuffer, UInt_t pos, UInt_t len );
39
40 // Index into fData[]. Usage: GetData(Decoder::TIBlobModule::kTimestamp)
41 enum EInfoType {
43 kNTICHAN /* indicates number of channels */
44 };
45
46 bool HasTriggerType() const { return TESTBIT(fDataAvail, kTriggerType); }
47 bool HasTriggerNum() const { return TESTBIT(fDataAvail, kTriggerNum); }
48 bool HasTimestamp() const { return TESTBIT(fDataAvail, kTimestamp); }
49 bool HasCounterBits() const { return TESTBIT(fDataAvail, kCounterBits); }
50 bool HasTriggerBits() const { return TESTBIT(fDataAvail, kTriggerBits); }
51
52 // Set type of 4th data word (3rd word if there is no timestamp).
53 // This only applies if the TI is configured to generate either the counter
54 // bits or the trigger bit pattern word, but not both. This case cannot
55 // be unambiguously decoded automatically.
56 // Values can be 0 = automatic, kCounterBits, or kTriggerBits.
57 // If this data word represents counter bits, this flag should be set via
58 // a configuration string (see Init()).
59 void SetWord4Type( UInt_t type );
60
61protected:
62 virtual UInt_t LoadNextEvBuffer( THaSlotData *sldat );
63
64private:
65 const UInt_t* fEvBuf; // Pointer to current event buffer (for multi-block)
66 UInt_t fNfill; // Number of filler words at end of current bank
67 UInt_t fDataAvail; // Bitfield of data read (see EInfoType)
68 UInt_t fWord4Type; // Which data contained in event data word4
69 Bool_t fHasTimestamp; // Event data contain timestamp (default)
70
71 std::string Here( const char* function );
72 void CheckWarnTrigBits( UInt_t word, UInt_t nopt, const char* here );
73
75 ClassDef(TIBlobModule,0) // Trigger Interface module
76};
77
78}
79
80#endif
int Int_t
unsigned int UInt_t
bool Bool_t
const char Option_t
#define ClassDef(name, id)
#define TESTBIT(n, i)
string::size_type pos
TypeSet_t::iterator TypeIter_t
virtual UInt_t LoadNextEvBuffer(THaSlotData *sldat)
virtual Int_t Decode(const UInt_t *)
virtual UInt_t LoadSlot(THaSlotData *sldat, const UInt_t *evbuffer, const UInt_t *pstop)
const UInt_t * fEvBuf
bool HasCounterBits() const
bool HasTriggerNum() const
std::string Here(const char *function)
virtual void Clear(const Option_t *opt="")
virtual UInt_t GetData(UInt_t chan) const
void SetWord4Type(UInt_t type)
bool HasTriggerBits() const
void CheckWarnTrigBits(UInt_t word, UInt_t nopt, const char *here)
bool HasTriggerType() const
static TypeIter_t fgThisType
bool HasTimestamp() const
virtual UInt_t LoadBank(THaSlotData *sldat, const UInt_t *evbuffer, UInt_t pos, UInt_t len)