Hall A ROOT/C++ Analyzer (podd)
Loading...
Searching...
No Matches
VmeModule.cxx
Go to the documentation of this file.
1
2//
3// VmeModule
4// Abstract interface to VME modules
5//
7
8#include "VmeModule.h"
9#include "THaSlotData.h"
10#include <iostream>
11
12using namespace std;
13
14namespace Decoder {
15
16VmeModule::VmeModule(UInt_t crate, UInt_t slot) : Module(crate,slot) {
17}
18
20 // Simplest version of IsSlot relies on a unique header.
21 if ((rdata & fHeaderMask)==fHeader) {
23 return true;
24 }
25 return false;
26}
27
29 const UInt_t *pstop)
30{
31 // This is a simple, default method for loading a slot
32 const UInt_t *p = evbuffer;
33 if (fDebugFile) {
34 *fDebugFile << "Module:: Loadslot "<<endl;
35 *fDebugFile << "header 0x"<<hex<<fHeader<<dec<<endl;
36 *fDebugFile << "masks "<<hex<<fHeaderMask<<endl;
37 }
38 if (!fHeader) cerr << "Module::LoadSlot::ERROR : no header ?"<<endl;
39 fWordsSeen=0;
40 while (IsSlot( *p )) {
41 if (fDebugFile) *fDebugFile << "IsSlot ... data = "<<*p<<endl;
42 p++;
43 if (p > pstop) break;
44 Decode(p);
45 for( UInt_t ichan = 0, nchan = GetNumChan(); ichan < nchan; ichan++ ) {
46 fWordsSeen++;
47 p++;
48 if (p > pstop) break;
49 UInt_t rdata = *p;
50 UInt_t mdata = rdata;
51 sldat->loadData(ichan, mdata, rdata);
52 if (ichan < fData.size()) fData[ichan]=rdata;
53 }
54 }
55 return fWordsSeen;
56}
57
58}
59
unsigned int UInt_t
bool Bool_t
winID h TVirtualViewer3D TVirtualGLPainter p
virtual UInt_t GetNumChan() const
Definition Module.h:73
std::ofstream * fDebugFile
Definition Module.h:156
UInt_t fWdcntMask
Definition Module.h:146
UInt_t fWdcntShift
Definition Module.h:146
UInt_t fWordsExpect
Definition Module.h:145
UInt_t fHeader
Definition Module.h:143
virtual Int_t Decode(const UInt_t *p)=0
UInt_t fHeaderMask
Definition Module.h:143
UInt_t fWordsSeen
Definition Module.h:145
std::vector< UInt_t > fData
Definition Module.h:140
Int_t loadData(const char *type, UInt_t chan, UInt_t dat, UInt_t raw)
virtual UInt_t LoadSlot(THaSlotData *sldat, const UInt_t *evbuffer, const UInt_t *pstop)
Definition VmeModule.cxx:28
virtual Bool_t IsSlot(UInt_t rdata)
Definition VmeModule.cxx:19
STL namespace.
ClassImp(TPyArg)