void runVertexingReco_batch(TString digifile) { // ======================================================================== // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug) Int_t iVerbose = 0; if(! (digifile.Contains("raw.root")) ) exit(0); // Input file TString inDigiFile = digifile; TString inSimFile = inDigiFile; inSimFile.ReplaceAll("raw.root", "mc.root"); // Parameter file TString parFile = inDigiFile; parFile.ReplaceAll("raw.root", "param.root"); // Output file TString outFile = inDigiFile; outFile.ReplaceAll("raw.root", "vertexing.root"); // Number of events to process Int_t nEvents = 0; // ---- Load libraries ------------------------------------------------- TString sysFile = gSystem->Getenv("VMCWORKDIR"); // ------------------------------------------------------------------------ // In general, the following parts need not be touched // ======================================================================== // ----- Timer -------------------------------------------------------- TStopwatch timer; timer.Start(); // ------------------------------------------------------------------------ // ----- Digitization run ------------------------------------------- FairRunAna *fRun= new FairRunAna(); fRun->SetInputFile(inDigiFile); cout<<"Set Input File: "<AddFriend(inSimFile); cout<<"Set Friend MC File: "<SetOutputFile(outFile); cout<<"Set Output File: "<AddTask(Geane); // ------------------------------------------------------------------------ // ----- Parameter database -------------------------------------------- TString allDigiFile = sysFile+"/tpc/parfiles/tpc.par"; FairRuntimeDb* rtdb = fRun->GetRuntimeDb(); FairParRootFileIo* parInput1 = new FairParRootFileIo(); parInput1->open(parFile.Data()); FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo(); parIo1->open(allDigiFile.Data(),"in"); rtdb->setFirstInput(parInput1); rtdb->setSecondInput(parIo1); PndGeoHandling* geoH = PndGeoHandling::Instance(); bool SimpleClustering=true; // ------- RECO procedure ------------------------------------------------ TpcClusterFinderTask* tpcCF = new TpcClusterFinderTask(); //tpcCF->SetDigiPersistence(); // keep reference to digis in clusters tpcCF->SetPersistence(); // keep Clusters tpcCF->timeslice(9); //in samples tpcCF->SetThreshold(1); tpcCF->SetSingleDigiClusterAmpCut(0.); tpcCF->SetClusterAmpCut(0.); // cut on mean digi amplitude tpcCF->SetErrorPars(600.,400.); tpcCF->SetSimpleClustering(); // use TpcClusterFinderSimple tpcCF->SetClusterBranchName("TpcClusterAligned"); fRun->AddTask(tpcCF); //find TpcRiemannTracks in the TPC alone TpcRiemannTrackingTask* tpcSPR = new TpcRiemannTrackingTask(); //tpcSPR->SetPersistence(); //tpcSPR->SetVerbose(1); fRun->AddTask(tpcSPR); //build GFTracks from TpcRiemannTracks TpcTrackInitTask* trackInit= new TpcTrackInitTask(); trackInit->SetPersistence(); //trackInit->SetVerbose(1); trackInit->SetMCPid(); // use ideal particle identification //trackInit->SetPDG(211); //trackInit->useGeane(); // uses RKTrackrep and GeaneTrackrep trackInit->SetSmoothing(true); fRun->AddTask(trackInit); KalmanTask* kalman = new KalmanTask(); kalman->SetPersistence(); //kalman->SetVerbose(1); kalman->SetNumIterations(3); // number of fitting iterations (back and forth) fRun->AddTask(kalman); TpcVertexingTask* vertexer = new TpcVertexingTask(); vertexer->SetPersistence(); vertexer->SetTrackBranchName("TrackPostFit"); vertexer->SetVerbose(1); //vertexer->SetUseVacuumPropagator(); // use the rave::Vacuum propagator instead of GFRavePropagator vertexer->SetMethod("kalman-smoothing:1"); //vertexer->setBeamspot(TVector3(0,0,0),1); fRun->AddTask(vertexer); // ----- Intialise and run -------------------------------------------- fRun->Init(); std::cout<<"post init"<Run(0, nEvents); rtdb->saveOutput(); rtdb->print(); // ------------------------------------------------------------------------ // ----- 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; // ------------------------------------------------------------------------ }