void CreateSttHits() { Int_t nevt = 0; // Input file (real events) TString inFile = "output.root"; // Parameter file TString parFile = "geoparams.root"; // Digitisation file (ascii) TString digiFile = "all.par"; // t0 offset file TString t0File = "toffset.dat"; // calib file TString calibFile = "rt_fitparams.dat"; // Output file TString outFile = "digi_real.root"; // ----- Timer -------------------------------------------------------- TStopwatch timer; // ----- PndSttHitProducer --------------------------------------------- FairRunAna *fRun= new FairRunAna(); fRun->SetInputFile(inFile); fRun->AddFriend("geo.root"); fRun->SetOutputFile(outFile); fRun->SetWriteRunInfoFile(kFALSE); FairRuntimeDb* rtdb = fRun->GetRuntimeDb(); FairParRootFileIo* parInput1 = new FairParRootFileIo(); parInput1->open(parFile.Data(), "UPDATE"); rtdb->setFirstInput(parInput1); Bool_t kParameterMerged=kTRUE; PndSttHitProducerReal* hitpr = new PndSttHitProducerReal(); hitpr->SetVerbose(0); // choose calib: // 1 = Garfield parameters // 2 = parameters from experimental calib Int_t flag = 2; hitpr->SetCalib(flag); if (flag==2) { Bool_t Calib = kFALSE; Calib = hitpr->ReadCalib(calibFile); if (Calib==kFALSE) exit(0); } Bool_t t0 = kFALSE; t0 = hitpr->ReadToffset(t0File); if (t0 == kFALSE) exit(0); fRun->AddTask(hitpr); rtdb->setOutput(parInput1); // ------------------------------------------------------------------------ // -------------------------------------------------------------------------- fRun->Init(); timer.Start(); fRun->Run(0, nevt); // ----------- Save the parameters ----------------- rtdb->saveOutput(); rtdb->print(); // ----- Finish ------------------------------------------------------- timer.Stop(); Double_t rtime = timer.RealTime(); Double_t ctime = timer.CpuTime(); cout << endl << endl; cout << "Macro finished successfully." << endl; cout << "Parameter file is " << parFile << endl; cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl; cout << endl; }