StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Db_LoadTable.C
1 void Db_LoadTable(char* domainName, char* tableName, char* timestamp){
2 
3 // Use this macro to load the FTPC table "tableName" from your working directory
4 // into the "domainName" database, Calibrations_ftpc or Geometry_ftpc
5 //
6 // Don't forget to
7 //
8 // setenv DB_ACCESS_MODE write
9 //
10 // For example:
11 //
12 // root4star -b -q 'Db_LoadTable.C("Calibrations_ftpc","ftpcGas","2008-05-01 00:00:00")'
13 
14  gSystem->Load("St_base"); // needed for StDbModifier
15  gSystem->Load("StChain");
16 
17  // DB-specific libs
18  gSystem->Load("libStDb_Tables");
19  gSystem->Load("StUtilities");
20  gSystem->Load("StDbLib");
22  StDbModifier* modify=new StDbModifier();
23  modify->SetDbName(domainName);
24  modify->SetDateTime(timestamp);
25  modify->SetFlavor("ofl");
26 
27  TString fname(tableName);
28  fname+=".C";
29 
30  modify->SetTableName(tableName);
31 
32  modify->SetInputFileName(fname.Data());
33  modify->WriteDataToDB();
34 
35  cout<<"Loaded "<<fname.Data()<<" into the "<<domainName<<" database"<<endl;
36 
37 }
38 
static StDbManager * Instance()
strdup(..) is not ANSI
Definition: StDbManager.cc:155