void runDigiFOPI_GiBUU(int runNumber, int nEvents=0,unsigned int seed=0, int jobset=0) { // ======================================================================== // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug) Int_t iVerbose = 0; gRandom->SetSeed(seed); // Number of events to process // Int_t nEvents = 0; gROOT->ProcessLine(".x $VMCWORKDIR/gconfig/rootlogon.C"); TString mcMode = "TGeant3"; // ---- Load libraries ------------------------------------------------- TString sysFile = gSystem->Getenv("VMCWORKDIR"); TString infile; if(jobset!=0){ infile=Form("GiBUU_FopiMC_set%i_run%i.mc.root",jobset,runNumber); }else{ infile=Form("GiBUU_FopiMC_%i.mc.root",runNumber); } cout<SetInputFile(infile); fRun->SetOutputFile(outFile); // ------------------------------------------------------------------------ // ----- Parameter database -------------------------------------------- TString allDigiFile = sysFile; allDigiFile+= Form("/tpc/FOPI/par/tpc.gibuu_sverre.par"); cout<<"DIGIFILE:"<GetRuntimeDb(); FairParRootFileIo* parInput1 = new FairParRootFileIo(); parInput1->open(parFile.Data()); FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo(); parIo1->open(allDigiFile.Data(),"in"); rtdb->setFirstInput(parInput1); rtdb->setSecondInput(parIo1); // ------------------------------------------------------------------------ // ----- TPC digi producers --------------------------------- TpcClusterizerTask* tpcClusterizer = new TpcClusterizerTask(); if(mcMode=="TGeant3") tpcClusterizer->SetMereChargeConversion(); // tpcClusterizer->SetPersistence(); fRun->AddTask(tpcClusterizer); TpcPCAlignmentTask* pcAl = new TpcPCAlignmentTask(); fRun->AddTask(pcAl); TpcDriftTask* tpcDrifter = new TpcDriftTask(); // tpcDrifter->SetPersistence(); tpcDrifter->SetDistort(false); fRun->AddTask(tpcDrifter); TpcGemTask* tpcGem = new TpcGemTask(); // tpcGem->SetPersistence(); fRun->AddTask(tpcGem); TpcPadResponseTask* tpcPadResponse = new TpcPadResponseTask(); // tpcPadResponse->SetPersistence(); fRun->AddTask(tpcPadResponse); TpcElectronicsTask* tpcElec = new TpcElectronicsTask(); tpcElec->SetPersistence(); tpcElec->SetSamplePersistence(); tpcElec->SetShaper("T2K"); fRun->AddTask(tpcElec); // ----- Intialise and run -------------------------------------------- fRun->Init(); // Initialize the Digimapper: TpcDigiPar* tpcpar = FairRun::Instance()->GetRuntimeDb()->getContainer("TpcDigiPar"); TpcDigiMapper::getInstance()->init(tpcpar); //TpcDigiMapper::getInstance()->forceManualDriftVel(forceDriftVel); TpcAlignmentManager::init(tpcpar->getAlignmentFile()); fRun->Run(0,0); // rtdb->saveOutput(); rtdb->print(); // ------------------------------------------------------------------------ // ----- Finish ------------------------------------------------------- timer.Stop(); Double_t rtime = timer.RealTime(); Double_t ctime = timer.CpuTime(); cout << endl << endl; cout << "Macro finished succesfully." << endl; cout << "Output file is " << outFile << endl; cout << "Parameter file is " << parFile << endl; cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl; cout << endl; // ------------------------------------------------------------------------ }