Diana Software
RunData2Txt.cxx
Go to the documentation of this file.
1 
7 #include "QGlobalDataManager.hh"
8 #include "QGlobalRWFactory.hh"
9 #include "QRunDataHandle.hh"
10 #include <iostream>
11 
12 using namespace Diana;
13 using std::cout;
14 using std::endl;
15 
16 void help(const char* me)
17 {
18  cout<<"Usage:"
19  <<me<<" runNumber inSource outSource"<<endl
20  <<endl
21  <<" runNumber : number of the run"<<endl
22  <<" inSource : input source (DB or file.root)"<<endl
23  <<" outSource : output filename (file.txt)"<<endl;
24 }
25 
26 int main(int argc, const char* argv[])
27 {
28  if(argc != 4) {
29  help(argv[0]);
30  return 1;
31  }
32  const int run = atoi(argv[1]);
33  const char* inSource = argv[2];
34  const char* outSource = argv[3];
35 
36  QGlobalRWFactory::GetInstance().LoadPlugin("LRootGlobalReader");
37  QGlobalRWFactory::GetInstance().LoadPlugin("LASCIIGlobalWriter");
38 
40 
42  dm.Get("DAQ",&rHandle,inSource);
43  dm.Set(&rHandle,outSource);
44 
45  return 0;
46 }
QRunDataHandle rHandle(753)
QGlobalDataManager dm
void help(const char *me)
Definition: RunData2Txt.cxx:16
int main(int argc, const char *argv[])
Definition: RunData2Txt.cxx:26
Object to manage I/O (DB, file, or memory) of diana global quantities.
QError Set(GlobalHandle< Q > *gh, const std::string &outSource, bool printError=true) const
Set a QObject using a GlobalHandle.
QError Get(const std::string &owner, GlobalHandle< Q > *gh, const std::string &inSource, bool printError=true) const
Get an object using a global handle.
static QGlobalRWFactory & GetInstance()
void LoadPlugin(const std::string &name)
global handle for QRunData
the Diana namespace is needed because sometimes we use Qt libraries, that use same class names of our...