// -------------------------------------------------------------------------- // // Macro for reconstruction of simulated events // in the CBM muon setup: // // MUCH digitization // MUCH hit production // // M.Ryzhinskiy 22.11.2007 // // -------------------------------------------------------------------------- { // ======================================================================== // Adjust this part according to your requirements // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug) Int_t iVerbose = 1; // Input file (MC events) TString inFile ="data/mc.root"; // Number of events to process Int_t nEvents = 10; // Output file TString outFile = "data/hits.root"; // Digitization parameters file TString digiFile = "data/much_test.digi.par"; // ---- 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("libMvd"); gSystem->Load("libSts"); gSystem->Load("libRich"); gSystem->Load("libTrd"); gSystem->Load("libTof"); gSystem->Load("libEcal"); gSystem->Load("libGlobal"); gSystem->Load("libKF"); gSystem->Load("libL1"); gSystem->Load("libMuch"); // ------------------------------------------------------------------------ // ----- Reconstruction run ------------------------------------------- CbmRunAna *fRun= new CbmRunAna(); fRun->SetInputFile(inFile); fRun->SetOutputFile(outFile); // ------------------------------------------------------------------------ // ----- Parameter database -------------------------------------------- CbmRuntimeDb* rtdb = fRun->GetRuntimeDb(); CbmParRootFileIo* parIo1 = new CbmParRootFileIo(); CbmParAsciiFileIo* parIo2 = new CbmParAsciiFileIo(); parIo1->open(gFile); parIo2->open(digiFile.Data(),"in"); rtdb->setFirstInput(parIo1); rtdb->setSecondInput(parIo2); rtdb->setOutput(parIo1); rtdb->saveOutput(); fRun->LoadGeometry(); // ------------------------------------------------------------------------ // --- MuCh digitizer ---------------------------------------------------- CbmMuchDigitize* muchDigitize = new CbmMuchDigitize("MuchDigitize", iVerbose); muchDigitize->SetUseAvalanche(1); // Account for avalanches fRun->AddTask(muchDigitize); // ------------------------------------------------------------------------ // --- MuCh hit finder --------------------------------------------------- CbmMuchFindHits* muchFindHits = new CbmMuchFindHits("MuchFindHits", iVerbose); muchFindHits->SetUseClustering(1); // Use clustering algorithm fRun->AddTask(muchFindHits); // ------------------------------------------------------------------------ // ----- Intialise and run -------------------------------------------- fRun->Init(); fRun->Run(0,nEvents); // ------------------------------------------------------------------------ }