17 #include <arpa/inet.h>
23 #define EXPECTED_NB_DCC_FRAGMENTS 18
24 #define NB_FEM_FRAGMENTS 72
25 #define MAX_FEM_DATA_BUFFER 2097152
35 if(
gHarpoDebug>0) Info(
"HarpoDccReader",
"Create DCC Reader");
88 if ( FileName != (TString *) NULL )
136 if (
fDone)
return false;
164 if (std::fread(&
lData,dataLen, 1,
fIn) != 1)
222 const char * fn =
fInFile->Data();
224 if (
fInFile->BeginsWith(
"/" )) {
225 if ( gSystem->AccessPathName(fn,kReadPermission) ) {
226 perror(
"Dcc File access");
230 if ( gSystem->AccessPathName(fn,kReadPermission) )
235 TString DataDir(gSystem->Getenv(
"HARPO_DATA_DIR"));
237 if ( ! DataDir.EndsWith(
"/") ) DataDir.Append(
"/");
240 if ( gSystem->AccessPathName(fn,kReadPermission) ) {
241 perror(
"Dcc File access");
249 fIn = std::fopen(fn,
"r");
258 perror(
"Dcc File open");
279 if (++cnt >= maxevents)
break;
290 return Loop(maxevents);
314 if ( evt != NULL )
delete evt ;
void SetRootFile(TString *name)
A class which read HARPO dcc file from one DCC and creant Dcc Events and Dcc Headers for DCC Events o...
UShort_t lData[EVENT_BUFFER_SIZE]
Long_t Loop()
Read errors.
void PushBack()
Skeeping not "intersting" event.
TString * GetOutFile()
Get Output root file name.
Bool_t Init()
Init method : Open in/out files and check run header signature.
HarpoDccEvent * fSaveEvent
void SetRunHeader(HarpoDetHeader *rh)
Return pointer to decoded pmm2 data vector.
HarpoDccHeader * GetDetHeader()
virtual void Save(char *mode=NULL)
void SetHeader(UShort_t *data)
Base class for all Harpo Detectors.
ULong_t GetTimeStamp(Int_t after=0)
A virtual base class for all HARPO detectors readers.
void SetAnalyseFunction(HarpoDccAnalyse *func)
HarpoDetHeader * fRunHeader
virtual ~HarpoDccReader()
A virtual class which define intrafece between HARPO Reader and Event Analysis code.
HarpoDccEvent * GetEvent()
virtual void ProcessEvent(HarpoDccEvent *event)
virtual const EventHeader_t * GetHeader() const
const char * GetDescription() const
void SetDccFile(TString *name)
HarpoDccAnalyse * fDccAnalyse
void SetPedestals(HarpoPedestal *p)
void SetData(UShort_t *data, size_t dlen=EVENT_BUFFER_SIZE)
A class which keeps track of the entire configuration of the analysis.
void SkipEvent()
Read next event from raw file.
A class store HARPO EVENT : header and row data. Its provide also the methods for access to this data...