Diana Software
StabParametersHandle.C
Go to the documentation of this file.
1 void StoreOnDB(const char* input, int chan , int run) {
2  using namespace Diana;
3  gSystem->Load("libqroot");
4 
6  dm.SetOwner("FindMultipleTrendsByBruteForce");
7 
8  QStabParametersHandle sphandle(chan,run);
9  dm.Get("FindMultipleTrendsByBruteForce",&sphandle,input);
10 
11  if(!sphandle.IsValid()) {
12  cout<<sphandle.GetError()<<endl;
13  return;
14  }
15  sphandle.SetDataset(6040);
16  sphandle.SetStabSelector("SelectStabPeak@");
17  sphandle.SetStabSelectorVersion("0");
18 
19  const QStabParameters& sp = sphandle.Get();
20  cout<<sp<<endl;
21 
22  QError err = dm.Set(&sphandle,"DB");
23  cout<<err<<endl;
24 }
25 
26 void FillFromDB(int chan, int run, int dataset)
27 {
28  using namespace Diana;
29  gSystem->Load("libqroot");
30 
32  dm.SetOwner("FindMultipleTrendsByBruteForce");
33 
34  QStabParametersHandle sphandle(chan,run);
35  sphandle.SetDataset(dataset);
36 
37  QError err = dm.Get("FindMultipleTrendsByBruteForce",&sphandle,"DB");
38  cout << err << endl;
39 
40  if(!sphandle.IsValid()) {
41  cout<<sphandle.GetError()<<endl;
42  return;
43  }
44 
45  const QStabParameters& sp = sphandle.Get();
46  cout<<sp<<endl;
47 }
err
Definition: CheckOF.C:114
QGlobalDataManager dm
void StoreOnDB(const char *input, int chan, int run)
void FillFromDB(int chan, int run, int dataset)
error class with error type and description
Definition: QError.hh:115
Object to manage I/O (DB, file, or memory) of diana global quantities.
void SetOwner(const std::string &owner)
set the module that is accessing this object
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.
the Diana namespace is needed because sometimes we use Qt libraries, that use same class names of our...