{ // ----- Timer -------------------------------------------------------- TStopwatch timer; timer.Start(); // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug) Int_t iVerbose = 0; Int_t nEvents = 100; gROOT->Macro("Libs.C"); // Input file (MC events) //TString inFile = "Mvd_DPMfixed_4GeV_10000.root"; //"MvdG4_DPM405_Mag_5000.root"; //TString inFile = "data/mvdparams.root"; TString inFile = "Mvd_Test.root"; // Parameter file TString parFile = "MvdParams.root"; //TString parFile = "data/mvdparams.root"; // Parameter output file TString parOutFile = "Test/testParamsOutput.root"; // In general, the following parts need not be touched // ======================================================================== // Output file PndMvdFileNameCreator creator(inFile.Data()); TString outFile = creator.GetDigiFileName().c_str(); //"MvdG4_DPM405_Mag_5000_digi.root"; std::cout << "DigiFileName: " << outFile.Data() << std::endl; // ----- Reconstruction run ------------------------------------------- CbmRunAna *fRun= new CbmRunAna(); fRun->SetInputFile(inFile.Data()); fRun->SetOutputFile(outFile.Data()); // ----- Parameter database -------------------------------------------- CbmRuntimeDb* rtdb = fRun->GetRuntimeDb(); CbmParRootFileIo* parInput1 = new CbmParRootFileIo(); parInput1->open(parFile.Data()); rtdb->setFirstInput(parInput1); // Bool_t kParameterMerged=kTRUE; // CbmParRootFileIo* output=new CbmParRootFileIo(kParameterMerged); // output->open(parOutFile); // rtdb->setOutput(output); fRun->LoadGeometry(); // ----- Digitization --------------------------------------- // PndMvdDigiTask* mvddigi = new PndMvdDigiTask(); // mvddigi->SetVerbose(iVerbose); // fRun->AddTask(mvddigi); // ========================================================================= // ====== Hit Producers ====== // ========================================================================= // ----- MVD Strip hit producer --------------------------------------- double topPitch=0.004921, botPitch=0.0042969, orient=TMath::Pi()*(0.5), skew=TMath::Pi()*(0.5); TVector2 topAnchor(0.,0.); TVector2 botAnchor(0.,0.); int topFE = 10, botFE = 4, nrFEChannels = 128; double threshold=0., noise=0.; PndMvdStripHitProducer* mvdStripProd = new PndMvdStripHitProducer(topPitch, botPitch, orient, skew, topAnchor,botAnchor, topFE, botFE, nrFEChannels, threshold, noise); // PndMvdStripHitProducer* mvdStripProd = new PndMvdStripHitProducer(); fRun->AddTask(mvdStripProd); // ----- MVD Pixel hit producer --------------------------------------- Double_t lx=0.01, ly=0.01, threshold=000, noise=00; PndMvdHybridHitProducer* mvdPixProd = new PndMvdHybridHitProducer(lx,ly,threshold,noise); mvdPixProd->SetVerbose(iVerbose); fRun->AddTask(mvdPixProd); CbmParRootFileIo* output=new CbmParRootFileIo(kTRUE); output->open(parOutFile.Data()); rtdb->setOutput(output); rtdb->print(); // ===== End of HitProducers ===== // ========================================================================= PndMvdGeoPar* geoPar = (PndMvdGeoPar*)(rtdb->getContainer("PndMvdGeoPar")); // ----- 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; }