8 #include "TObjectSet.h"
9 #include "StDAQMaker.h"
10 #include "StDAQReader.h"
11 #include "StTPCReader.h"
12 #include "StSCReader.h"
13 #include "StRtsTable.h"
14 #include "StRtsReaderMaker.h"
20 StIOInterFace(name),fEvtHddr(0),fDAQReader(0),fDAQReaderSet(0),fRtsMaker(0)
22 if (inputFile && inputFile[0]) SetFile(inputFile);
26 StDAQMaker::~StDAQMaker()
33 Int_t StDAQMaker::Init()
35 if (fDAQReaderSet)
return 0;
36 fDAQReaderSet =
new TObjectSet(
"StDAQReader",0,kFALSE);
37 AddConst(fDAQReaderSet); SetOutput(fDAQReaderSet);
39 fEvtHddr = GetEvtHddr();
45 Int_t StDAQMaker::Open(
const char*)
47 if (fDAQReader && fDAQReader->isOpened())
return 0;
48 LOG_INFO <<
"Open Input file" << GetFile() << endm;
49 if(!fDAQReader) fDAQReader =
new StDAQReader(0,fRtsMaker);
50 if (GetDebug()>1) fDAQReader->setVerbose(1);
51 fDAQReader->open(GetFile());
52 fDAQReaderSet->
SetObject((TObject*)fDAQReader,kFALSE);
56 void StDAQMaker::Close(Option_t *)
62 Int_t StDAQMaker::Skip(
int nskip){
63 return fDAQReader->skipEvent(nskip);
68 int iret = fDAQReader->Make();
72 if (iret)
return iret;
75 fEvtHddr->SetRunNumber ( fDAQReader->getRunNumber() );
76 fEvtHddr->SetEventNumber ( fDAQReader->getEventNumber() );
77 fEvtHddr->SetInputTriggerMask ( fDAQReader->getTrigInputWord());
78 fEvtHddr->SetTriggerMask ( fDAQReader->getTrigWord() );
79 fEvtHddr->SetGMTime ( fDAQReader->getUnixTime() );
80 fEvtHddr->SetEventSize ( fDAQReader->getEventSize() );
82 fDAQReader->printEventInfo();
86 if ( !( fDAQReader->getUnixTime() || fDAQReader->getEventSize() ) ) {
87 LOG_ERROR <<
" The run: " << fDAQReader->getRunNumber()
88 <<
"/ event: " << fDAQReader->getEventNumber()
89 << ((!fDAQReader->getUnixTime()) ?
" timestamp " :
" size" )
92 fDAQReader->printEventInfo();
101 StSCReader scReader(c,fDAQReader->getUnixTime());
102 AddData(scReader.getSCTable());
104 int adcOnly = IAttr(
"adcOnly");
105 if (GetDebug()<=1 && !adcOnly)
return 0;
108 StTPCReader *myTPCReader = fDAQReader->getTPCReader();
112 for (
int sector =1; sector <=12; sector++)
114 unsigned char* padList;
115 for (
int padRow=1; padRow<=45; padRow++)
117 int npad = myTPCReader->getPadList(sector,padRow,padList);
119 if (npad==0)
continue;
122 LOG_INFO << Form(
"Sector=%2d PadRow=%2d nPads=%3d\n",sector,padRow,npad) << endm;
126 if (nPads==0 && adcOnly)
return kStSKIP;
130 void StDAQMaker::Clear(
const char*)
132 if (fDAQReader) fDAQReader->clear();
virtual void AddData(TDataSet *data, const char *dir=".data")
User methods.
virtual void Clear(Option_t *option="")
User defined functions.
virtual void SetObject(TObject *obj)
The depricated method (left here for the sake of the backward compatibility)
StRtsTable * DaqDta()
Return the current DAQ data block. This member function is provided for convenience.
virtual StRtsTable * GetNextLegacy()
This is an overloaded member function, provided for convenience.