| 1 |
mocchiut |
1.1 |
// |
| 2 |
|
|
// C/C++ headers |
| 3 |
|
|
// |
| 4 |
|
|
#include <iostream> |
| 5 |
|
|
#include <sstream> |
| 6 |
|
|
// |
| 7 |
|
|
// ROOT headers |
| 8 |
|
|
// |
| 9 |
|
|
#include <TString.h> |
| 10 |
|
|
#include <TSQLServer.h> |
| 11 |
|
|
#include <TFile.h> |
| 12 |
|
|
#include <TSystem.h> |
| 13 |
|
|
// |
| 14 |
|
|
#include <RunInfo.h> |
| 15 |
|
|
using namespace std; |
| 16 |
|
|
// |
| 17 |
|
|
int RunInfoCore(ULong64_t run, TFile *processFile, TSQLServer *dbc, Int_t runargc, char *runargv[]){ |
| 18 |
|
|
Int_t i = 0; |
| 19 |
|
|
Int_t sgnl = 0; |
| 20 |
|
|
// |
| 21 |
|
|
TString processFolder = "runinfoFolder"; |
| 22 |
|
|
if ( runargc > 0 ){ |
| 23 |
|
|
i = 0; |
| 24 |
|
|
while ( i < runargc ){ |
| 25 |
|
|
if ( !strcmp(runargv[i],"-processFolder") ) { |
| 26 |
|
|
if ( runargc < i+1 ){ |
| 27 |
|
|
throw -3; |
| 28 |
|
|
}; |
| 29 |
|
|
processFolder = (TString)runargv[i+1]; |
| 30 |
|
|
i++; |
| 31 |
|
|
}; |
| 32 |
|
|
i++; |
| 33 |
|
|
}; |
| 34 |
|
|
}; |
| 35 |
|
|
ItoRunInfo *runinfo = 0; |
| 36 |
|
|
stringstream temprname; |
| 37 |
|
|
const char* routdir = gSystem->DirName(gSystem->DirName(processFile->GetPath())); |
| 38 |
|
|
temprname.str(""); |
| 39 |
|
|
temprname << routdir; |
| 40 |
|
|
temprname << "/" << processFolder.Data(); |
| 41 |
|
|
// |
| 42 |
|
|
runinfo = new ItoRunInfo(dbc,processFile,processFolder); |
| 43 |
|
|
sgnl = runinfo->Update(run,"NONE",""); |
| 44 |
|
|
gSystem->Unlink(temprname.str().c_str()); |
| 45 |
|
|
// |
| 46 |
|
|
runinfo->Close(); |
| 47 |
|
|
processFile->cd(); |
| 48 |
|
|
if ( processFile ) processFile->Write("Run"); |
| 49 |
|
|
runinfo->Clear(); |
| 50 |
|
|
if ( sgnl < 0 ) throw sgnl; |
| 51 |
|
|
return(sgnl); |
| 52 |
|
|
} |