// -------------------------------------------------------------------------- // // Macro for reconstruction of raw data from LMD files (test beam AUG 09) // // Uses the task CbmTbReceiver // // V. Friese 30.06.2009 // Version 30.06.2009 (V. Friese) // // Before using, execute roclogin in your DABC installation // // -------------------------------------------------------------------------- #include "source/cbmbase/CbmDetectorList.h" void run_lmd(Int_t nEvents = 10) { // ======================================================================== // Adjust this part according to your requirements // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug) Int_t iVerbose = 3; // Input file (LMD) // Specify fiel separately frpom path such that the run number can be // deduced automatically //TString inFile = "sep04_run021c_0000.lmd"; //TString inPath = "/d/cbm06/cbmdata/AUG09/lmd_cal"; //TString input = "file://test.lmd"; TString input = "file://test.lmd"; // Output file TString outFile = "test.raw.root"; // In general, the following parts need not be touched // ======================================================================== // ----- Check input file and get run number -------------------------- /* if ( inFile[12] != 'c' ) { cout << endl; cout << "=== Please use calibrated lmd file for analysis!" << endl; cout << endl; exit(9); } Int_t iRun = atoi(inFile(9,3).Data()); cout << endl << "=== Run number is " << iRun << endl << endl; */ // ------------------------------------------------------------------------ // ---- Debug option ------------------------------------------------- gDebug = 0; // ------------------------------------------------------------------------ // ----- Timer -------------------------------------------------------- TStopwatch timer; timer.Start(); // ------------------------------------------------------------------------ // ---- Load libraries ------------------------------------------------- gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C"); basiclibs(); gSystem->Load("libDabcBase"); gSystem->Load("libDabcMbs"); gSystem->Load("libDabcRoc"); gSystem->Load("libGeoBase"); gSystem->Load("libParBase"); gSystem->Load("libBase"); gSystem->Load("libCbmBase"); gSystem->Load("libCbmData"); gSystem->Load("libCbmData"); // ------------------------------------------------------------------------ // ----- Reconstruction run ------------------------------------------- FairRunAna *run= new FairRunAna(); run->SetOutputFile(outFile); // ------------------------------------------------------------------------ // ----- Data receiver ------------------------------------------------ Int_t iRun = 21; CbmTbReceiver* receiver = new CbmTbReceiver(input, 2000., iVerbose); receiver->SetRun(iRun); receiver->AddRoc(0, kSTS); receiver->AddRoc(1, kSTS); receiver->AddRoc(3, kSTS); receiver->AddRoc(4, kMUCH); receiver->AddRoc(5, kMUCH); receiver->AddRoc(6, kRICH); receiver->SetBeam(6, 2); receiver->SetPersistence(kTRUE); run->AddTask(receiver); // ------------------------------------------------------------------------ // ----- Intialise and run -------------------------------------------- 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; // ------------------------------------------------------------------------ cout << " Test passed" << endl; cout << " All ok " << endl; exit(0); }