00001 #include "StIOInterFace.h"
00002
00003 ClassImp(StIOInterFace)
00004
00005
00006 StIOInterFace::StIOInterFace(const char *name,const char *iomode)
00007 :StRTSBaseMaker("sc",name)
00008 {
00009 if (iomode) SetIOMode(iomode);
00010 fNIO = 0;
00011 }
00012
00013 void StIOInterFace::SetBranch(const Char_t *brName,const Char_t *file,const Char_t *mode,Option_t *opt)
00014 {
00015 TString ts("SetBranch:");
00016
00017 if (file) { ts += " file="; ts += file;}
00018 if (mode) { ts += " mode="; ts += mode;}
00019 if (opt ) { ts += " opt="; ts += opt ;}
00020 IntoBranch(brName,ts);
00021 }
00022
00023 void StIOInterFace::IntoBranch(const Char_t *brName,const Char_t *logNames)
00024 {
00025 TString bN(brName); if (bN.Index("Branch")<0) bN+="Branch";
00026 TDataSet *was = GetData(bN,".branches");
00027 if (was) delete was;
00028 AddAlias(bN,logNames,".branches");
00029 }
00030
00031
00032
00033 Int_t StIOInterFace::Skip(int nskip)
00034 {
00035 for (; nskip; nskip--)
00036 {
00037 Clear(); int ret = MakeRead();
00038 if (ret) break;
00039 }
00040
00041 return nskip;
00042 }
00043
00044 Int_t StIOInterFace::Finish()
00045 {
00046 printf("<%s::Finish> %s: %d I/O's\n",ClassName(),GetName(),fNIO);
00047 return StMaker::Finish();
00048 }