7 if (gClassTable->GetID(
"StDbManager") < 0) {
8 gROOT->LoadMacro(
"bfc.C");
10 bfc(-2,
"tpcDb,detDb,mysql,nodefault,CorrX");
16 dbMk =
new St_db_Maker(
"db",
"MySQL:StarDb",
"$STAR/StarDb",
"$PWD/StarDb");
35 void Db(
const Char_t *tabNam =
36 "Geometry/tpc/tpcPadPlanes",
37 Int_t date = -1, Int_t time = 0,
39 const Char_t *flavor=
"sim+ofl+laserDV"
41 if (dbMk == 0) Load();
42 dbMk->SetDebug(debugL);
49 cout <<
"Set Date " << D <<
" Time " << T << endl;
51 dbMk->SetDateTime(D,T);
52 TString TabNam(tabNam);
53 if (TabNam.BeginsWith(
"StarDb/")) TabNam.ReplaceAll(
"StarDb/",
"");
54 TString name(gSystem->BaseName(tabNam));
55 TString Flavor(flavor);
56 if (flavor !=
"") dbMk->SetFlavor(flavor,name);
58 table = (
TTable *) dbMk->GetDataBase(TabNam);
61 dbMk->GetValidity(table,t);
62 cout <<
"==============================================" << endl;
64 cout <<
"Found table " << table->GetName() <<
" with NRows = " << Nrows <<
" in db" << endl;
65 cout <<
"Validity:" << t[0].GetDate() <<
"/" << t[0].GetTime()
66 <<
" ----- " << t[1].GetDate() <<
"/" << t[1].GetTime() << endl;
67 if (name ==
"tpcPadrowT0") {
68 Double_t t0Inner = 0, t0Outer = 0;
69 Int_t Inner = 0, Outer = 0;
70 tpcPadrowT0_st *row = ((St_tpcPadrowT0 *) table)->GetTable();
71 for (Int_t sec = 0; sec < 24; sec++, row++) {
72 for (Int_t r = 0; r < 45; r++) {
74 if (r < 13) {t0Inner += row->T0[r]; Inner++;}
75 else {t0Outer += row->T0[r]; Outer++;}
79 if (Inner > 0) t0Inner /= Inner;
80 if (Outer > 0) t0Outer /= Outer;
81 cout << name.Data() <<
"\tInner <T0> = " << t0Inner <<
"\tOuter <T0> = " << t0Outer << endl;
83 if (Nrows > 10) Nrows = 10;
85 cout <<
"==============================================" << endl;
87 name += Form(
".%06i.%06i.root",t[0].GetDate(),t[0].GetTime());
88 TFile *f =
new TFile(name.Data(),
"RECREATE");
92 name += Form(
".%06i.%06i.C",t[0].GetDate(),t[0].GetTime());
94 out.open(name, ios::out);
98 else cout <<
"Table:" << tabNam <<
" has not been found" << endl;
101 void Db(
const Char_t *tabNam =
"StarDb/AgiGeometry/Geometry",
103 if (dbMk == 0) Load();
104 cout <<
"Db(" << tabNam <<
"," << tag <<
")" << endl;
105 Int_t date = StMaker::AliasDate(tag);
106 Int_t time = StMaker::AliasTime(tag);
107 Db(tabNam,date,time);
virtual Long_t GetRowSize() const
Returns the size (in bytes) of one table row.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
virtual Long_t GetNRows() const
Returns the number of the used rows for the wrapped table.
virtual Char_t * Print(Char_t *buf, Int_t n) const
Create IDL table defintion (to be used for XDF I/O)