Diana Software
CalibrationParametersHandle.C
Go to the documentation of this file.
1 void StoreOnDB(const char* input, int chan , int dataset) {
2  using namespace Diana;
3  gSystem->Load("libqroot");
4 
6  dm.SetOwner("CalCoefficients");
7 
8  QCalibrationParametersHandle cphandle(chan,dataset);
9  dm.Get("CalCoefficients",&cphandle,input);
10 
11  if(!cphandle.IsValid()) {
12  cout<<cphandle.GetError()<<endl;
13  return;
14  }
15 
16  cphandle.SetStabLabel("FindMultipleTrendsByBruteForce@");
17  cphandle.SetStabVersion("0");
18 
19  const QCalibrationParameters& cp = cphandle.Get();
20  cout<<cp<<endl;
21 
22  QError err = dm.Set(&cphandle,"DB");
23  cout<<err<<endl;
24 }
25 
26 void FillFromDB(int chan, int dataset)
27 {
28  using namespace Diana;
29  gSystem->Load("libqroot");
30 
32  dm.SetOwner("CalCoefficients");
33 
34  QCalibrationParametersHandle cphandle(chan,dataset);
35 
36  QError err = dm.Get("CalCoefficients",&cphandle,"DB");
37  cout << err << endl;
38 
39  if(!cphandle.IsValid()) {
40  cout<<cphandle.GetError()<<endl;
41  return;
42  }
43 
44  const QCalibrationParameters& cp = cphandle.Get();
45  cout<<cp<<endl;
46 }
void FillFromDB(int chan, int dataset)
void StoreOnDB(const char *input, int chan, int dataset)
err
Definition: CheckOF.C:114
QGlobalDataManager dm
global handle for calibration parameters
void SetStabLabel(const std::string &stabl)
void SetStabVersion(const std::string &stabv)
object containing calibration data (function, coefficients, source and residuals) and run numbers of ...
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...