// -------------------------------------------------------------------------- // // Macro for STS local digitisation and reconstruction // // Tasks: // CbmStsDigitize // CbmStsFindHits // CbmStsFindTracks (with L1 track finder) // CbmStsFitTracks (with KF track fitter) // // Input: MC file with CbmStsPoints // Output: RECO file with CbmStsHits and CbmStsTracks // // Command line arguments: // inFile Input file from transport simulation (MC) // parFile Parameter file (ASCII) for STS digitisation // outFile Output file // nEvents Number of events to process // iVerbose Verbosity level (0=batch, 1=event, 2=track, >2=debug) // // Note that you have to specify the proper parameter file in case you did // not use the standard STS geometry in the transport. // // Parameters will be stored in the output file. // // V. Friese 30/04/2008 // -------------------------------------------------------------------------- void sts_reco(const char* inFile, const char* outFile, const char* parFile = "sts_standard.digi.par", Int_t nEvents = 1, Int_t iVerbose = 0) { // ---- Debug option ------------------------------------------------- gDebug = 0; // ------------------------------------------------------------------------ // ----- Timer -------------------------------------------------------- TStopwatch timer; timer.Start(); // ------------------------------------------------------------------------ // ---- Load libraries ------------------------------------------------- gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C"); basiclibs(); gSystem->Load("libGeoBase"); gSystem->Load("libParBase"); gSystem->Load("libBase"); gSystem->Load("libCbmBase"); gSystem->Load("libField"); gSystem->Load("libGen"); gSystem->Load("libPassive"); gSystem->Load("libSts"); gSystem->Load("libRich"); gSystem->Load("libMuch"); gSystem->Load("libTrd"); gSystem->Load("libTof"); gSystem->Load("libEcal"); gSystem->Load("libGlobal"); gSystem->Load("libKF"); gSystem->Load("libL1"); // ------------------------------------------------------------------------ // ----- Reconstruction run ------------------------------------------- CbmRunAna *run= new CbmRunAna(); run->SetInputFile(inFile); run->SetOutputFile(outFile); // ------------------------------------------------------------------------ // ----- STS digitizer ------------------------------------------------ CbmTask* stsDigitize = new CbmStsDigitize(iVerbose); run->AddTask(stsDigitize); // ------------------------------------------------------------------------ // ----- STS hit finding ------------------------------------------------ CbmTask* stsFindHits = new CbmStsFindHits(iVerbose); run->AddTask(stsFindHits); // ------------------------------------------------------------------------- // --- STS track finding ------------------------------------------------ CbmKF* kalman = new CbmKF(); run->AddTask(kalman); CbmL1* l1 = new CbmL1(); run->AddTask(l1); CbmStsTrackFinder* stsTrackFinder = new CbmL1StsTrackFinder(); CbmTask* stsFindTracks = new CbmStsFindTracks(iVerbose, stsTrackFinder); run->AddTask(stsFindTracks); // ------------------------------------------------------------------------- // --- STS track fitting ----------------------------------------------- CbmStsTrackFitter* stsTrackFitter = new CbmStsKFTrackFitter(); CbmTask* stsFitTracks = new CbmStsFitTracks(stsTrackFitter, iVerbose); run->AddTask(stsFitTracks); // ------------------------------------------------------------------------- // ----- Parameter database -------------------------------------------- CbmRuntimeDb* rtdb = run->GetRuntimeDb(); CbmParRootFileIo* parInput1 = new CbmParRootFileIo(); parInput1->open(inFile); CbmParAsciiFileIo* parInput2 = new CbmParAsciiFileIo(); TString stsDigiFile = gSystem->Getenv("VMCWORKDIR"); stsDigiFile += "/parameters/sts/"; stsDigiFile += parFile; parInput2->open(stsDigiFile.Data(),"in"); rtdb->setFirstInput(parInput1); rtdb->setSecondInput(parInput2); rtdb->saveOutput(); // ------------------------------------------------------------------------ // ----- Intialise and run -------------------------------------------- run->LoadGeometry(); run->Init(); cout << "Starting run" << endl; run->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 << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl; cout << endl; // ------------------------------------------------------------------------ }