StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
GetTableByType.C
1 // $Id: GetTableByType.C,v 1.2 1999/12/20 15:27:46 fine Exp $
2 //=======================================================================
3 // owner: Valeri Fine (fine@bnl.gov)
4 // what it does: returns the name('s) of objects byt title (type)
5 //=======================================================================
6 
7 St_DataSet *GetTableByType(const Char_t *tableType="dst_point")
8 {
9  // returns the name('s) of St_Dataset objects by title
10  // the St_Table by its type
11  // For example:
12 
13  // root4star [2] .x bfc.C(1)
14  // root4star [4] .x GetTableByType.C("dst_track")
15  // globtrk : bfc/.make/dst/.data/dst/globtrk
16  // globtrk2 : bfc/.make/dst/.data/dst/globtrk2
17  // primtrk : bfc/.make/dst/.data/dst/primtrk
18  // The above means the bfc - bug full chain has 3 different tables
19  // of "dst_track" type. All of them are produced by "dst" maker and
20  // are held by its "dst" dataset.
21  //
22 
23  St_DataSetIter next(chain,0); St_DataSet *t = 0; St_DataSet *lastT = 0;
24  while (t = next())
25  if (!strcmp(t->GetTitle(),tableType)){ lastT = t; cout << t->GetName() << " : " << t->Path() << endl; }
26  return lastT;
27 }
28 // $Log: GetTableByType.C,v $
29 // Revision 1.2 1999/12/20 15:27:46 fine
30 // it prints the full path now
31 //
virtual TString Path() const
return the full path of this data set
Definition: TDataSet.cxx:626