00001 // $Id: bfcread_hist_list.C,v 1.22 2006/08/15 21:42:39 jeromel Exp $ 00002 // $Log: bfcread_hist_list.C,v $ 00003 // Revision 1.22 2006/08/15 21:42:39 jeromel 00004 // Fix rhic -> rhic.bnl.gov 00005 // 00006 // Revision 1.21 2002/01/29 20:03:08 genevb 00007 // Switched default dir from QA to EventQA 00008 // 00009 // Revision 1.20 2000/06/13 18:41:59 kathy 00010 // had to move order of library loading for some unknown reason... 00011 // 00012 // Revision 1.19 2000/06/13 00:58:59 lansdell 00013 // added libglobal_Tables to resolve crashes 00014 // 00015 // Revision 1.18 2000/04/12 15:06:52 kathy 00016 // changed all macros that read DSTs to load Tables from libraries: gen,sim,global,dst instead of ALL Tables (previously loaded St_Tables); currently, if you are using DEV to read a DST in NEW,PRO, you must comment out the loading of libtpc_Tables because of a mismatch with tpt_track table 00017 // 00018 // Revision 1.17 2000/03/20 17:32:55 kathy 00019 // setbranches in all macros so that they will work with softlinks - for StIOMaker 00020 // 00021 // Revision 1.16 2000/02/14 20:30:40 kathy 00022 // removing unneeded macros; updating documentation in bfcread macros 00023 // 00024 // Revision 1.15 2000/01/19 16:29:51 kathy 00025 // update macros to use default input files in /afs/rhic.bnl.gov/star/data/samples 00026 // 00027 // Revision 1.14 2000/01/18 16:38:05 kathy 00028 // add loading of StUtilities and StAnalysisUtilities so that StHistUtil class can now be picked up from StAnalysisUtilities library 00029 // 00030 // Revision 1.13 2000/01/13 17:18:04 kathy 00031 // updated bfcread_hist* macros so that they can now use the new *PrintList methods from StHistUtil to only print a subset (given a list of names) of histograms from the given Maker Directory; also updated documentation 00032 // 00033 // Revision 1.12 2000/01/05 22:12:03 kathy 00034 // changed input file to current one 00035 // 00036 // Revision 1.11 1999/12/01 21:30:11 kathy 00037 // added input TopDirTree to bfcread_hist* macros in order to tell which top level directory hist file has since sometimes its not bfcTree; cleaned up print statements in bfcread_dst*hist.C macros; two new macros bfcread_dst_*QA_outhistfile.C added which read dst file and book and fill histograms and write out a new *.hist.root file, instead of just sending hist to postscript - this new *.hist.root file can then be read into bfcread_hist*.C to look at it --- note that topdirtree is different! 00038 // 00039 // Revision 1.10 1999/11/30 19:23:05 kathy 00040 // changed bfcread_dst*.C so that MakerHist is hardwired in instead of being input; wrote better documentation in bfcread_hist*.C so that it explains where top level directory is set 00041 // 00042 // Revision 1.9 1999/11/23 20:40:48 genevb 00043 // Re-arranged load order 00044 // 00045 // Revision 1.8 1999/11/19 20:13:21 kathy 00046 // cleaned up macros to remove uneccessary lines; also added info about new tables to QA* macros 00047 // 00048 // Revision 1.7 1999/11/05 16:30:16 kathy 00049 // minor changes to documentation in macro 00050 // 00051 // Revision 1.6 1999/11/03 21:35:35 kathy 00052 // small fixes for use of StIOMaker - had it wrong before 00053 // 00054 // Revision 1.5 1999/11/03 19:02:54 kathy 00055 // changes to default input files and output file names - needed by perl script for testing 00056 // 00057 // Revision 1.4 1999/11/03 17:13:00 kathy 00058 // fixed macros so they use StIOMaker instead of StTreeMaker 00059 // 00060 // Revision 1.3 1999/09/21 15:07:02 kathy 00061 // change to have notes on input values at top of each macro, also clean up notes on usage and remove the usage of method St_QA_Maker::SetPntrToHistUtil which is not going to be used now that I made St_QA_Maker totally independent of the histogram printing 00062 // 00063 // Revision 1.2 1999/09/20 20:09:01 kathy 00064 // bfcread_hist_list_all now lists all histograms in hist.root file; bfcread_hist_list now only lists those that are in the Maker that is input; bfcread_hist_to_ps prints and draws the hist that are in the input Maker, bfcread_dst_QAhist.C reads .dst.root file - runs QA_Maker and prints and draws the QA histograms 00065 // 00066 // 00067 //====================================================================== 00068 // owner: Kathy Turner 00069 // what it does: see below 00070 //======================================================================= 00071 // bfcread_hist_list.C 00072 // 00073 // what it does: reads the *.hist.root file produced from a chain 00074 // (such as bfc) and 00075 // then prints list of histograms from given input Maker 00076 // 00077 // inputs: MainFile - *.hist.root file from bfc output 00078 // MakerHistDir - directory name of Maker that you want histograms 00079 // from (this will be first input when you did constructor) 00080 // -- see standard Maker names note below! 00081 // TopDirTree - top level directory tree in your input hist file 00082 // (this is 3rd argument of constructor for StTreeMaker that 00083 // you probably used to write the *.hist.root file) 00084 // NOTE: if you ran bfc, then the TopDirTree = bfcTree !! 00085 // 00086 // standard Maker names in bfc 00087 // (but if you run your own Maker here, then use whatever name you give it) 00088 // are listed at 00089 // http://www.star.bnl.gov/STAR/html/comp_l/train/tut/bfc_maker_names.html 00090 // 00091 // 00092 // Documentation on StHistUtil class is at: 00093 // http://duvall.star.bnl.gov/STARAFS/comp/pkg/dev/StRoot/StAnalysisUtilities/doc/ 00094 // 00095 //====================================================================== 00096 00097 00098 class StChain; 00099 StChain *chain; 00100 00101 class StIOMaker; 00102 StIOMaker *IOMk=0; 00103 00104 //------------------------------------------------------------------------ 00105 00106 void bfcread_hist_list( 00107 const Char_t *MainFile= 00108 "/afs/rhic.bnl.gov/star/data/samples/gstar.hist.root", 00109 const Char_t *MakerHistDir="EventQA", 00110 const Char_t *TopDirTree="bfcTree") 00111 { 00112 00113 cout << "bfcread_hist_list.C, input hist file = " 00114 << MainFile << endl; 00115 cout << "bfcread_hist_list.C, directory name for hist = " 00116 << MakerHistDir << endl; 00117 cout << "bfcread_hist_list.C, top level directory in hist file = " 00118 << TopDirTree << endl; 00119 00120 // 00121 gSystem->Load("St_base"); 00122 gSystem->Load("StChain"); 00123 gSystem->Load("StIOMaker"); 00124 gSystem->Load("StarClassLibrary"); 00125 gSystem->Load("StUtilities"); 00126 gSystem->Load("StAnalysisUtilities"); 00127 gSystem->Load("libglobal_Tables"); 00128 00129 // setup chain with IOMaker - can read in .dst.root, .dst.xdf files 00130 StIOMaker *IOMk = new StIOMaker("IO","r",MainFile,TopDirTree); 00131 IOMk->SetDebug(); 00132 IOMk->SetIOMode("r"); 00133 IOMk->SetBranch("*",0,"0"); //deactivate all branches 00134 IOMk->SetBranch("histBranch",0,"r"); //activate dst Branch 00135 00136 00137 // constructor for other maker (not used in chain) 00138 StHistUtil *HU = new StHistUtil; 00139 00140 // now must set pointer to StMaker so HistUtil can find histograms 00141 // with StHistUtil methods 00142 // -- input any maker pointer but must cast as type StMaker 00143 HU->SetPntrToMaker((StMaker *)IOMk); 00144 00145 // ONLY use StIOMaker in chain 00146 // --- now execute chain member functions - 1 event (histograms) only 00147 IOMk->Init(); 00148 IOMk->Clear(); 00149 IOMk->Make(); 00150 00151 // method to print out list of histograms 00152 // - can do this anytime after they're booked 00153 // - default is to print out QA hist branch 00154 Int_t NoHist=0; 00155 NoHist = HU->ListHists(MakerHistDir); 00156 cout << " in bfcread_hist_list: Num of Hist = " << NoHist << endl; 00157 00158 } 00159 00160 00161 00162 00163 00164 00165
1.5.9