runDigi(Int_t nEvents=10000, Float_t mom = 15., Int_t mode =1, UInt_t seed=0) { // ======================================================================== // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug) Int_t iVerbose = 0; // Input file (MC events) TString inFile = Form("points_sttcombi_%d.root",seed); // Parameter file TString parFile = Form("params_sttcombi_%d.root",seed); // Output file TString outFile = Form("digi_sttcombi_%d.root",seed); // Number of events to process Int_t nEvents = 0; TDatime *time = new TDatime(); gRandom->SetSeed(seed+time->GetTime()); // ---- Load libraries ------------------------------------------------- // gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C"); // rootlogon(); TString sysFile = gSystem->Getenv("VMCWORKDIR"); // ------------------------------------------------------------------------ // --- Now choose concrete engines for the different tasks ------------- // ------------------------------------------------------------------------ // In general, the following parts need not be touched // ======================================================================== // ----- Timer -------------------------------------------------------- TStopwatch timer; timer.Start(); // ------------------------------------------------------------------------ // ----- Digitization run ------------------------------------------- FairRunAna *fRun= new FairRunAna(); fRun->SetInputFile(inFile); fRun->SetOutputFile(outFile); // ------------------------------------------------------------------------ // ----- Parameter database -------------------------------------------- TString allDigiFile = sysFile+"/macro/params/all.par"; FairRuntimeDb* rtdb = fRun->GetRuntimeDb(); FairParRootFileIo* parInput1 = new FairParRootFileIo(); parInput1->open(parFile.Data()); FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo(); parIo1->open(allDigiFile.Data(),"in"); // rtdb->setFirstInput(parInput1); // rtdb->setSecondInput(parIo1); rtdb->setFirstInput(parIo1); rtdb->setSecondInput(parInput1); // ------------------------------------------------------------------------ // ----- MDV digi producers --------------------------------- //PndMvdDigiTask* mvddigi = new PndMvdDigiTask(); PndMvdStripHitProducer* mvddigi = new PndMvdStripHitProducer(); mvddigi->SetVerbose(iVerbose); fRun->AddTask(mvddigi); // ----- Intialise and run -------------------------------------------- fRun->Init(); fRun->Run(0, nEvents); 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; // ------------------------------------------------------------------------ }