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