STAR Computing | |
Tutorial on 5/26/99: How to read DST produced from bfc.C | |
  | Maintained by K. Turner |
==> Location of the DSTs:
ls -al /disk00000/star/test/dev/tfs_Linux/Mon/year_2a/ -rw-r--r-- 1 didenko rhstar 15181962 May 26 15:15 psc0208_01_40evts.dst.root -rw-r--r-- 1 didenko rhstar 13841827 May 26 15:15 psc0208_01_40evts.event.root -rw-r--r-- 1 didenko rhstar 32272 May 26 15:15 psc0208_01_40evts.hist.root -rw-r--r-- 1 didenko rhstar 875725 May 26 15:15 psc0208_01_40evts.log -rw-r--r-- 1 didenko rhstar 22990640 May 26 15:15 psc0208_01_40evts_dst.xdf
grep Inp /disk00000/star/test/dev/tfs_Linux/Mon/year_2a/*.log Input file name = /disk0/star/test/venus412/b0_3/year_2a/psc0208_01_40evts.fzd with No. of Events to process = 3
Table Name Table Type Comments *** StTreeMaker::Make() == 0 *** 0 - bfc/.make/treeRead/.data/bfcTree/dstBranch/dst St_DataSet 1 - bfc/.make/treeRead/.data/bfcTree/dstBranch/dst/event_header dst_event_header event_type messed up 1 - bfc/.make/treeRead/.data/bfcTree/dstBranch/dst/event_summary dst_event_summary OK 1 - bfc/.make/treeRead/.data/bfcTree/dstBranch/dst/globtrk dst_track OK 1 - bfc/.make/treeRead/.data/bfcTree/dstBranch/dst/globtrk_aux dst_track_aux empty 1 - bfc/.make/treeRead/.data/bfcTree/dstBranch/dst/vertex dst_vertex has z = NaN 1 - bfc/.make/treeRead/.data/bfcTree/dstBranch/dst/globtrk2 dst_track OK 1 - bfc/.make/treeRead/.data/bfcTree/dstBranch/dst/primtrk dst_track OK 1 - bfc/.make/treeRead/.data/bfcTree/dstBranch/dst/primtrk_aux dst_track_aux empty 1 - bfc/.make/treeRead/.data/bfcTree/dstBranch/dst/dst_v0_vertex dst_v0_vertex has dcav0 = NaN 1 - bfc/.make/treeRead/.data/bfcTree/dstBranch/dst/dst_xi_vertex dst_xi_vertex OK 1 - bfc/.make/treeRead/.data/bfcTree/dstBranch/dst/dst_dedx dst_dedx OK 1 - bfc/.make/treeRead/.data/bfcTree/dstBranch/dst/point dst_point OK 1 - bfc/.make/treeRead/.data/bfcTree/dstBranch/dst/monitor_soft dst_monitor_soft OK
Use bfcread.C to read in root file (any *.root file) produced when running bfc.C and look at the data.
==> set up your area
to run bfcread (from dev) and read
The default reads in the "dst" branch of the root file (i.e. the input file is .dst.root) If you want to read in a different branch, you must change: - the input file name, e.g. *.bname.root - treeMk->SetBranch("bnameBranch",0,"r"); - chain->GetDataSet("bname")
// get dataset for globtrk St_DataSet *ds=chain->GetDataSet("dst/globtrk"); // create iterator for the dataset St_DataSetIter globtrkiter(ds); globtrkiter.Du(); globtrkiter.Pwd(); // find the table St_dst_track *glob = (St_dst_track *) globtrkiter.Find("globtrk"); // print out info about it glob.ls(); glob->Print(9,1); glob->Print(8,1); glob->Print(8,2); glob->Print(1,1); glob->Print(0,5); // get the table header data table_head_st *tdt_h = glob->GetHeader(); tdt_h->name tdt_h->type tdt_h->maxlen tdt_h->nok // get the table and print out info about it (it's printing row 0) dst_track_st *sth = glob->GetTable(); sth->ndegf sth->x0 sth->impact sth->invpt sth->y0
==> what we want to do
We will add to bfcread.C macro so that it reads in the dst produced
from bfc.C and now executes code from another Maker. Eventually
this will probably be implemented in bfc.C, but for now ones adds
this functionality in bfcread.C
==> cp bfcread.C to a new macro DrawDstHistNew.C
==> edit DrawDstHistNew.C
Add to macro input list const Char_t *psFile="QA_hist.ps") --- output ps file name Add at beg. gSystem->Load("St_QA_Maker"); --- load St_QA_Maker library Add after setting up chain // add other makers to chain: St_QA_Maker *QA = new St_QA_Maker; Add after chain->Init // method to print out list of histograms (this is just for QA Maker) Int_t NoHist=0; NoHist = QA->ListHists(); cout << " DrawDstHistNew.C, No. of Hist we have == " << NoHist << endl; Remove code that lists contents of directory and pops Browser which was after event loop Add after event loop (this is just stuff for setting up QA Maker to write out file with hist) // the following methods are already set to default values in St_QA_Maker::Init - now write over them QA->SetDraw(kTRUE); QA->SetPostScriptFile(psFile); QA->SetZones(); QA->SetPaperSize() Int_t numLog = 0; numLog = QA->ExamineLogYList(); cout <<" DrawDstHistNew.C, Number hist to plot with log scale = " << numLog << endl; Add at end // Finish method in St_QA_Maker is where the actual DrawHist is done chain->Finish(); cout << "DrawDstHistNew.C, passed chain->Finish" << endl ;
==> run DrawDstHistNew.C