/[PAMELA software]/DarthVader/RunInfo/src/RunInfoCore.cpp
ViewVC logotype

Annotation of /DarthVader/RunInfo/src/RunInfoCore.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (hide annotations) (download)
Tue Apr 17 11:58:34 2007 UTC (17 years, 7 months ago) by mocchiut
Branch: MAIN
Changes since 1.5: +1 -1 lines
XXXFolder bug fixed

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 mocchiut 1.3 int RunInfoCore(UInt_t run, TFile *processFile, TSQLServer *dbc, TString DVV, Int_t runargc, char *runargv[]){
18 mocchiut 1.1 Int_t i = 0;
19     Int_t sgnl = 0;
20     //
21 mocchiut 1.6 TString processFolder = "runinfoFolder_"+run;
22 mocchiut 1.1 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 mocchiut 1.4 if ( !dbc->IsConnected() ) throw -807;
43 mocchiut 1.1 runinfo = new ItoRunInfo(dbc,processFile,processFolder);
44     sgnl = runinfo->Update(run,"NONE","");
45     gSystem->Unlink(temprname.str().c_str());
46     //
47     runinfo->Close();
48     processFile->cd();
49     if ( processFile ) processFile->Write("Run");
50     runinfo->Clear();
51 mocchiut 1.3 //
52 mocchiut 1.5 if ( sgnl < 0 ) throw sgnl;
53     //
54 mocchiut 1.3 delete runinfo;
55     //
56     runinfo = new ItoRunInfo(processFile);
57     sgnl = runinfo->Update(run,"DV",DVV);
58     gSystem->Unlink(temprname.str().c_str());
59     runinfo->Close();
60     processFile->cd();
61     if ( processFile ) processFile->Write("Run");
62 mocchiut 1.5 //
63     if ( sgnl < 0 ) throw sgnl;
64     //
65 mocchiut 1.3 runinfo->Clear();
66     delete runinfo;
67     //
68 mocchiut 1.1 return(sgnl);
69     }

  ViewVC Help
Powered by ViewVC 1.1.23