59 void bfcread_hist_extract(
60 const Char_t *MainFile=
61 "/afs/rhic.bnl.gov/star/data/samples/gstar.hist.root",
62 const Char_t *MakerHistDir=
"EventQA",
63 const Char_t *TopDirTree=
"bfcTree",
65 const Char_t *PrintList=
"")
68 cout <<
"bfcread_hist_extract.C, input hist file = "
70 cout <<
"bfcread_hist_extract.C, directory name for hist = "
71 << MakerHistDir << endl;
72 cout <<
"bfcread_hist_extract.C, top level directory in hist file = "
73 << TopDirTree << endl;
76 gSystem->Load(
"St_base");
77 gSystem->Load(
"StChain");
78 gSystem->Load(
"StIOMaker");
79 gSystem->Load(
"StarClassLibrary");
80 gSystem->Load(
"StUtilities");
81 gSystem->Load(
"StAnalysisUtilities");
82 gSystem->Load(
"libglobal_Tables");
88 IOMk->SetBranch(
"*",0,
"0");
89 IOMk->SetBranch(
"histBranch",0,
"r");
98 HU->SetPntrToMaker((
StMaker *)IOMk);
111 TList* dList = HU->FindHists(MakerHistDir);
112 if (PrintList) HU->SetDefaultPrintList(MakerHistDir,PrintList);
113 NoHist = HU->CopyHists(dList);
114 TH1** nh = HU->getNewHist();
116 TString name = MainFile;
118 name.Remove(0,name.Last(
'/')+1);
119 TString name2 = MakerHistDir;
120 name2.Remove(0,name2.Last(
'/')+1);
121 name.Insert(name.First(
'.'),
"_");
122 name.Insert(name.First(
'.'),name2);
123 OutFile = name.Data();
125 cout <<
"Output hist file: " << OutFile << endl;
126 TFile* ofile =
new TFile(OutFile,
"RECREATE");
127 for (
int i=0; i<NoHist; i++) {
128 printf(
"Extracting: %d. %s : %s\n",
129 i+1,nh[i]->
GetName(),nh[i]->GetTitle());
virtual void Clear(Option_t *opt)
User defined functions.
virtual void SetIOMode(Option_t *iomode="w")
number of transactions
virtual const char * GetName() const
special overload