00001 void Db_ReadDriftMaps(char* dirname, char* timestamp, char* flavor){ 00002 00003 // Use this macro to read the FTPC drift map tables (ftpcDeflection,ftpcVDrift,ftpcdDeflectiondP,ftpcdVDriftdP) 00004 // from the Calibrations_ftpc database and to write them out into the directory dirname 00005 // 00006 // The FTPC drift map tables are "flavored" tables 00007 // Before running this macro, create a sub-directory in your working directory for each of the 5 flavors: 00008 // flavor sub-directory 00009 // ------ ------------- 00010 // ffp10kv FullFieldPositive 00011 // hfp10kv HalfFieldPositive 00012 // zf10kv ZeroField 00013 // hfn10kv HalfFieldNegative 00014 // ffn10kv FullFieldNegative 00015 // 00016 // Don't forget to 00017 // 00018 // setenv DB_ACCESS_MODE read 00019 // 00020 // To dump the complete set of drift maps for a specific timestamp run the following 5 jobs. 00021 // The timestamp in this example is for the 50% Ar,50% CO2 drift maps 00022 // The timestamp for the 50.3% Ar, 49.7% CO2 drift maps is "2005-11-01 00:00:00": 00023 // 00024 // root4star -b -q 'Db_ReadDriftMaps.C("FullFieldPositive","2001-11-04 00:00:00","ffp10kv")' 00025 // root4star -b -q 'Db_ReadDriftMaps.C("HalfFieldPositive","2001-11-04 00:00:00","hfp10kv")' 00026 // root4star -b -q 'Db_ReadDriftMaps.C("ZeroFieldPositive","2001-11-04 00:00:00","zf10kv")' 00027 // root4star -b -q 'Db_ReadDriftMaps.C("HalfFieldNegative","2001-11-04 00:00:00","hfn10kv")' 00028 // root4star -b -q 'Db_ReadDriftMaps.C("FullFieldNegative","2001-11-04 00:00:00","ffn10kv")' 00029 00030 00031 gSystem->Load("St_base"); // needed for StDbModifier 00032 gSystem->Load("StChain"); 00033 00034 // DB-specific libs 00035 gSystem->Load("libStDb_Tables"); 00036 gSystem->Load("StUtilities"); // probably don't need this 00037 gSystem->Load("StDbLib"); 00038 StDbManager* dbManager=StDbManager::Instance(); 00039 StDbModifier* modify=new StDbModifier(); 00040 modify->SetDbName("Calibrations_ftpc"); 00041 modify->SetDateTime(timestamp); 00042 modify->SetFlavor(flavor); 00043 00044 char* tableNames[4]= { "ftpcdVDriftdP","ftpcDeflection","ftpcVDrift","ftpcdDeflectiondP" }; 00045 00046 for(int i=0; i<4; i++){ 00047 TString fname(dirname); 00048 fname+="/"; 00049 fname+=tableNames[i]; 00050 fname+=".C"; 00051 00052 modify->SetTableName(tableNames[i]); 00053 00054 modify->SetOutputFileName(fname.Data()); 00055 // mod->WriteDataToDB(); 00056 modify->ReadDataFromDB(); 00057 00058 cout<<"Wrote out Calibrations_ftpc database table "<<fname.Data()<<endl; 00059 } 00060 00061 } 00062
1.5.9