// -------------------------------------------------------------------------- // // Macro for translate the data from MC into string // // Tasks: CbmMvdStringFinder // // // Created 28.06.2011 by Q. Li, M. Deveaux // // -------------------------------------------------------------------------- { // ======================================================================== // Adjust this part according to your requirements cout << "everything is beginning from here!"<Getenv("VMCWORKDIR"); TString outDir="./data/"; // Input file (StringFinder result) TString inFile_string = outDir+ "mvd.strings.root"; TString inFile_reco = outDir+ "mvd.reco.root"; // Parameter file name TString parFile =outDir+ "params.root"; // Output file TString outFile =outDir+ "mvd.checker.root"; // Number of events to process Int_t nEvents = 5; // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug) Int_t iVerbose = 0; // In general, the following parts need not be touched // ======================================================================== // ---- Debug option ------------------------------------------------- gDebug = 0; // ------------------------------------------------------------------------ // ----- Timer -------------------------------------------------------- TStopwatch timer; timer.Start(); // ------------------------------------------------------------------------ // ---- Load libraries ------------------------------------------------- //gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C"); gROOT->LoadMacro("/u/qiyan/cbmroot/gconfig/basiclibs.C"); basiclibs(); gSystem->Load("libCLHEP"); gSystem->Load("libGeoBase"); gSystem->Load("libParBase"); gSystem->Load("libBase"); gSystem->Load("libCbmBase"); gSystem->Load("libCbmData"); 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("libGlobal"); gSystem->Load("libEcal"); gSystem->Load("libKF"); gSystem->Load("libL1"); // ------------------------------------------------------------------------ // ----- Reconstruction run ------------------------------------------- FairRunAna *fRun= new FairRunAna(); // fRun->SetInputFile(inFile_string); fRun->SetInputFile(inFile_reco); fRun->AddFriend(inFile_string); fRun->SetOutputFile(outFile); // ------------------------------------------------------------------------ // ------- MVD string Finder all my works maybe here and next ---------------------------------------------- CbmMvdMimoDataCheck* DataCheck = new CbmMvdMimoDataCheck("StateChecker", iVerbose); cout << "Adding Task(DataChecking): DataCheck... " << endl; fRun->AddTask(DataCheck);//add a task to full project //---------------------------------------------------------------------------- // ----- Parameter database ----------------------------------------------- FairRuntimeDb* rtdb = fRun->GetRuntimeDb(); FairParRootFileIo* parIo1 = new FairParRootFileIo(); parIo1->open(parFile.Data()); rtdb->setFirstInput(parIo1); rtdb->setOutput(parIo1); rtdb->saveOutput(); rtdb->print(); // --------------------------------------------------------------------------- // ----- Run initialisation ---------------------------------------------- fRun->Init(); // ----- Start run ------------------------------------------------------- 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; // --------------------------------------------------------------------------- cout << " Test passed" << endl; cout << " All ok " << endl; }