void emc_inspect(const char* clusFile, const char* digiFile, const char* simFile, const char* outFile="dummy.root", Int_t events=0, const char* parFile="simparams_hc7g5kG4.root") { // Loads files with hits and digitised hits and performs reconstruction for EMC // Set runClusOnline to kFALSE to use default clustering algorithms (will use online version if set to kTRUE) // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug) Int_t iVerbose = 1; // Input file (MC events) // // Number of events to process Int_t nEvents=events; // if 0 all the events will be processed if (nEvents !=0) std::cout << "will process " << nEvents << " events" << std::endl; else std::cout << "all events will be processed" << std::endl; // Digitisation file (ascii) TString parFile_Ascii = "emc.par"; // Loading libraries // If the macro gives error messages in loading libraries, please check the path of the libs and put it by hands // gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C"); // gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C"); //rootlogon(); //basiclibs(); // ----- Timer ----------------------------------------- TStopwatch timer; timer.Start(); // --------------------------------------------------------- // ----- Reconstruction run ---------------------------- FairRunAna *fRun= new FairRunAna(); fRun->SetInputFile(clusFile); fRun->AddFriend(simFile); fRun->AddFriend(digiFile); fRun->SetOutputFile(outFile); fRun->SetUseFairLinks(kTRUE); // ----- Parameter database ----------------------------- FairRuntimeDb* rtdb = fRun->GetRuntimeDb(); FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo(); parIo1->open(parFile_Ascii.Data(),"in"); rtdb->setFirstInput(parIo1); FairParRootFileIo* parInput1 = new FairParRootFileIo(); parInput1->open(parFile); rtdb->setSecondInput(parInput1); // --------------------------------------------------------- //fRun->RunWithTimeStamps(); // obsolete for this macro? PndEmcInspectClusters* inspectorTask = new PndEmcInspectClusters(iVerbose); fRun->AddTask(inspectorTask); // ----- Intialise and run ----------------------------- gRandom->SetSeed(); cout << "fRun->Init()" << endl; fRun->Init(); cout << "fRun->Run()" << endl; fRun->Run(0,nEvents); // --------------------------------------------------------- // ----- Finish ---------------------------------------- timer.Stop(); Double_t rtime = timer.RealTime(); Double_t ctime = timer.CpuTime(); cout << endl << endl; cout << "Macro finished successfully." << endl; cout << "Output file is " << outFile << " (can be safely removed)" << endl; cout << "Parameter file is " << parFile << endl; cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl; cout << endl; // --------------------------------------------------------- }