{ // create a Hades object and get the // pointers to the runtime database and // the spectrometer Hades* myHades = new Hades; HSpectrometer* spec = gHades->getSetup(); HRuntimeDb* rtdb = gHades->getRuntimeDb(); // create the detector and its setup // and add it in the spectrometer HStsDetector* fwdet = new HStsDetector; Int_t stsMods[STS_MAX_LAYERS][STS_MAX_MODULES] = { {1,1}, {1,1}, {1,1}, {1,1} }; spec->addDetector(fwdet); for (int i = 0; i < STS_MAX_LAYERS; ++i) spec->getDetector("Sts")->setModules(i,stsMods[i]); // define the input HParOra2Io* ora = new HParOra2Io; //ora->open(); ora->open("db-hades-test","fwdet_ana2"); //ora->open("cbmdbp-new","fwdet_ana2"); ora->setHistoryDate("now"); rtdb->setFirstInput(ora); // define the output // HParRootFileIo* output = new HParRootFileIo; // output->open("Rich700Params.root","RECREATE"); // rtdb->setOutput(output); HParAsciiFileIo* output = new HParAsciiFileIo; output->open("StsGeantGeometry.txt","out"); rtdb->setOutput(output); // create the parameter containers HParSet* mypar=rtdb->getContainer("StsGeantGeomPar"); if(mypar) { std::cout <<"found StsGeantGeomPar parameter:" << std::endl; mypar->Print(); } else { std::cout <<"NOT found StsGeantGeomPar parameter:" << std::endl; delete myHades; return; } //rtdb->initContainers(275840519);// recorded cosmics to testdb in november 2017 //rtdb->initContainers(82841411); // listed in test db (sep10test) rtdb->initContainers(1); // the latest default? // save the output // (writes the data to the file) rtdb->saveOutput(); // print content of the runtime // database on the screen rtdb->print(); // delete the Hades object delete myHades; }