{ std::cout <<"writing parameters to ora. started.." << std::endl; Hades* myHades = new Hades; HRuntimeDb* rtdb = gHades->getRuntimeDb(); HSpectrometer* spec = gHades->getSetup(); // create the detector and its setup // and add it in the spectrometer HStsDetector* stsdet = new HStsDetector; //Int_t mods[] = {1,1,0,0,0,0,0,0,0}; Int_t stsMods[STS_MAX_LAYERS][STS_MAX_MODULES] = { {1,1}, {1,1}, {1,1}, {1,1} }; //Int_t frpcMods[FRPC_MAX_SECTORS][FRPC_MAX_MODULES] = { {1}, {1}, {1}, {1} }; stsdet->setModules(-1,&stsMods[0][0]); spec->addDetector(stsdet); for (int i = 0; i < STS_MAX_LAYERS; ++i) spec->getDetector("Sts")->setModules(i,&stsMods[i][0]); // for example ASCII file as input HParAsciiFileIo* input = new HParAsciiFileIo; input->open("fwdet_lookup_sts_new.txt"); // use most recent mapping from feb21 beamtime, but change name rtdb->setFirstInput(input); // Oracle as output HParOra2Io* ora = new HParOra2Io; std::cout <<"try to connect to the db..." << std::endl; ora->open("db-hades-test","fwdet_ana2"); rtdb->setOutput(ora); // create parameter container //HRpcHitFPar* pPar=(HRpcHitFPar*)(rtdb->getContainer("RpcHitFPar")); // create the parameter containers HParSet* pPar=rtdb->getContainer("StsTrb3Lookup"); if(pPar==0) { std::cout <<"could not get HParSet" << std::endl; return; } // initialized the parameter container // (for ASCII input any run id can be used ???) //rtdb->initContainers(1); rtdb->initContainers(82841411); // listed in test db (sep10test) //rtdb->initContainers(328991391); // production db, mdc test run in jul18 // set author and comment pPar->setAuthor("Joern Adamczewski-Musch"); pPar->setDescription("Mapping of STS from Feb21 beamtime, second try"); // call write function explicitly (no automatic write into Oracle) pPar->write(ora); delete myHades; }