FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fill_parameters.C
Go to the documentation of this file.
1 {
3 
4  Bool_t kParameterMerged = kTRUE;
5  FairParRootFileIo* parOut = new FairParRootFileIo(kParameterMerged);
6  parOut->open("mq_ex_params.root");
7  rtdb->setOutput(parOut);
8  // rtdb->saveOutput();
9  // rtdb->print();
10 
11  FairMQExParamsParOne* par = static_cast<FairMQExParamsParOne*>(rtdb->getContainer("FairMQExParamsParOne"));
12 
13  for (Int_t i = 0; i < 100; i++) {
14  rtdb->addRun(2000 + i);
15 
16  par->SetValue(1983 + i);
17  par->setChanged();
18  rtdb->writeContainers();
19  }
20 
21  rtdb->saveOutput();
22 
23  rtdb->print();
24 }
Bool_t kParameterMerged
list of container factories
Definition: FairRuntimeDb.h:24
static FairRuntimeDb * instance(void)
void setChanged(Bool_t flag=kTRUE)
Definition: FairParSet.h:72
void print(void)
FairParSet * getContainer(const Text_t *)
Bool_t writeContainers(void)
FairParRootFileIo * parOut
FairMQExParamsParOne * par
Bool_t setOutput(FairParIo *)
void SetValue(const Int_t &val)
Bool_t open(const Text_t *fname, Option_t *option="READ", const Text_t *ftitle="", Int_t compress=1)
FairRtdbRun * addRun(Int_t runId, Int_t refId=-1)
void saveOutput(void)