27 #include "TClonesArray.h"
29 #include "TSystemDirectory.h"
33 #include <arpa/inet.h>
94 Info(
"Dummy SetRootFile",
"%s",name->Data());
104 Info(
"NextEvent",
"*Det %d => %p",ndet,
fEvents[ndet]);
109 Info(
"NextEvent",
"GetEvent %ld",
fNevts);
115 Info(
"NextEvent",
"Det %d => %p",ndet,
fEvents[ndet]);
133 Warning(
"GetEvent",
"Event Header not available");
141 Info(
"GetEvent",
"Det %ld exists, %p",ndet,revt);
150 for( UInt_t ndet = 0; ndet < 2; ndet++ ) {
167 Warning(
"GetEvent",
"Unknown Header %d",ndet);
190 if(
gHarpoDebug>0) Info(
"Init",
"Readout mode %d",mode);
199 if(
gHarpoDebug>0) Info(
"Init",
"Get TTree HarpoTree");
208 Ssiz_t pos = strtmp.Last(
'/');
209 TString dirname = strtmp(0,pos);
210 TString fileprefix = strtmp(pos+1,strtmp.Length());
212 Info(
"Init",
"%s / %s",dirname.Data(), fileprefix.Data());
215 TSystemDirectory dir(
"datadir", dirname.Data());
216 TList *files = dir.GetListOfFiles();
221 while ((file=(TSystemFile*)next())) {
222 fname = file->GetName();
223 if(!fname.BeginsWith(fileprefix.Data()))
225 if(!fname.EndsWith(
".root"))
227 Info(
"Init",
"Include file %s",fname.Data());
230 fInRootFile = TFile::Open(Form(
"%s/%s",dirname.Data(),fname.Data()));
235 Warning(
"Init",
"No file matching the pattern %s",
gHConfig->
GetInFile(0)->Data());
240 Info(
"Init",
"Adding %s (%d files)",Form(
"%s*.root",
gHConfig->
GetInFile(0)->Data()),nFiles);
250 Warning(__FUNCTION__,
"HarpoRunHeader not found\n");
256 if ( gmask != hmask ) {
257 Info(__FUNCTION__,
"Processing mask 0x%lx <> Header mask 0x%lx.\n",gmask,hmask);
259 ULong_t diff_mask = ( gmask ^ hmask );
260 ULong_t skip_mask = ( hmask & diff_mask ) ;
261 ULong_t nodet_mask = ( gmask & diff_mask ) ;
264 Info(__FUNCTION__,
"Processing skiping det 0x%lx.\n",skip_mask);
266 Warning(__FUNCTION__,
"Defectors 0x%lx not in ROOT file!\n",nodet_mask);
278 std::cout <<
"Get Det Header " << ndet << std::endl;
282 if (dynamic_cast<HarpoDccHeader *>(rawhdr) != NULL ) {
285 std::cout <<
"Det " << ndet <<
" is T2K DCC" << std::endl;
286 }
else if (dynamic_cast<HarpoFeminosHeader *>(rawhdr) != NULL ) {
289 std::cout <<
"Det " << ndet <<
" is MINOS DCC" << std::endl;
293 std::cout <<
"Det " << ndet <<
" not a DCC" << std::endl;
297 std::cout <<
"Header Class Name " << rawhdr->ClassName() << std::endl;
304 if(
gHarpoDebug>0) Info(
"Init",
"Initialise event objects");
315 if (trdr[ndet] == 0 ) {
319 else if (trdr[ndet] == 1) {
324 std::cout <<
"UNKNOWN XDCC" << std::endl;
329 if (trdr[ndet] == 0 ) {
333 else if (trdr[ndet] == 1) {
338 std::cout <<
"UNKNOWN YDCC" << std::endl;
355 if(
gHarpoDebug>0) Info(
"Init",
"Event objects initialised");
361 if(
gHarpoDebug>0) Info(
"Init",
"Reco objects initialised");
371 if(
gHarpoDebug>0) Info(
"Loop",
"maxevents = %ld",maxevents);
374 if(nEntries<maxevents) maxevents=nEntries;
386 if(
gHarpoDebug>1) Info(
"Loop",
"Start Analysis %d",i);
404 "Fatal Analysis Error %d aborting prgram.\n",st);
408 if (++cnt >= maxevents)
break;
415 if(
gHarpoDebug>0) Info(
"Find",
"Event %ld",eventNo);
HarpoRunHeader * fRunHeader
HarpoRecoEvent * SetRecoEvent(HarpoRecoEvent *evt)
A virtual class store event data for un detector.
void SetRootFile(TString *name)
const char * GetName() const
HarpoRunHeader * GetRunHeader()
Create RunHeader with links to all raw headers.
Bool_t isExist(ULong_t det)
Detecror date exist //! Number of Real Detectors.
Object containing the reconstruction information for one event (with array of HarpoRecoClusters Harpo...
TString * GetInFile(Int_t idet)
Get Input file name for detector.
HarpoAnalyse * fAnalyse[30]
void SetDetRdrType(HarpoDetType nDet, Long64_t rtype)
Set type of reader impementation for given Harpo Detector.
Base class for all Harpo Detectors.
A class store HARPO row DCC event data and header. End provide access metods to the row data...
A class store HARPO row FEMINOS event data and header. End provide access metods to the row data...
unpacked dcc data The class contains the data map for DCC or Feminos The data is stored as a 2D TMatr...
A base class for all top level HARPO readers.
A class which read HARPO events from root tree.
void SetDetFile(TString *name, Int_t plane)
Data from Keller temperuture and pressure sensors.
void SetHeader(HarpoEventHeader *data)
void SetMask(ULong_t detmask)
Redefine active detector set.
void SetPedestals(HarpoPedestal *obj)
Ste/Get Pedstal object.
Long_t Find(Long_t eventNo)
virtual void ProcessEvent(HarpoEvent *event)
Set pointer to new event for analyse, anlyse event , and delete.
A class store HARPO raw PMM2 event buffer and header. End provide access metods to the row data...
HarpoRecoEvent * fRecoEvent
HarpoEventHeader * GetHeader()
Long64_t GetFromEvent()
Get First Event to process.
A class store HARPO row event data and header. Provide access metods to the row event data...
HarpoEventHeader * fEventHeader
Bool_t fSync
Find raw event by event number.
virtual ~HarpoReaderRoot()
const ULong_t gkNDetectors
void SetDetEvent(HarpoDetEvent *event, ULong_t plane=XDCC)
HarpoDetEvent * fEvents[gkNDetectors]
Bool_t Init(hReadMode mode=hSyncTime)
Init method : Open in/out files and check run header signature.
A class which keeps track of the entire configuration of the analysis.
HarpoDetReader ** fDetReader
R__EXTERN HarpoDetSet * gHDetSet
A class store HARPO EVENT : header and row data. Its provide also the methods for access to this data...