// -------------------------------------------------------------------------- // // Macro for reconstruction in STS from RAW data // // Task: CbmStsFindHits // // V. Friese 12/09/2006 // // -------------------------------------------------------------------------- { // ======================================================================== // Adjust this part according to your requirements // File name TString name = "data/sts_gsi"; // Input file (MC events) TString inFile = name + ".raw.root"; // Output file TString outFile = name + ".reco.root"; // Parameter file TString parFile = "data/params.root"; // Digitisation file TString digiFile = "sts_standard.gsi.digi.par"; // Number of events to process Int_t nEvents = 10; // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug) Int_t iVerbose = 0; // ---- Load libraries ------------------------------------------------- gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C"); basiclibs(); gSystem->Load("libGeoBase"); gSystem->Load("libParBase"); gSystem->Load("libBase"); gSystem->Load("libMCStack"); gSystem->Load("libField"); gSystem->Load("libPassive"); gSystem->Load("libSts"); // ------------------------------------------------------------------------ // ----- Timer -------------------------------------------------------- TStopwatch timer; timer.Start(); // ------------------------------------------------------------------------ // ----- Reconstruction run ------------------------------------------- CbmRunAna *fRun= new CbmRunAna(); fRun->SetInputFile(inFile); fRun->SetOutputFile(outFile); // ------------------------------------------------------------------------ // ----- Parameter database -------------------------------------------- TString stsDigiFile = gSystem->Getenv("VMCWORKDIR"); stsDigiFile += "/parameters/sts/"; stsDigiFile += digiFile; CbmRuntimeDb* rtdb = fRun->GetRuntimeDb(); CbmParRootFileIo* parIo1 = new CbmParRootFileIo(); CbmParAsciiFileIo* parIo2 = new CbmParAsciiFileIo(); parIo1->open(parFile.Data()); parIo2->open(stsDigiFile.Data(),"in"); rtdb->setFirstInput(parIo1); rtdb->setSecondInput(parIo2); rtdb->setOutput(parIo1); rtdb->saveOutput(); fRun->LoadGeometry(); // ------------------------------------------------------------------------ // --- STS hit finding -------------------------------------------------- CbmStsFindHits* findHits = new CbmStsFindHits("STSFindHits", iVerbose); fRun->AddTask(findHits); // ------------------------------------------------------------------------ // ----- Intialise and run -------------------------------------------- fRun->Init(); fRun->Run(0,nEvents); // ------------------------------------------------------------------------ // ----- 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; // ------------------------------------------------------------------------ }