FairRoot/PandaRoot
run_TrackFinding.C
Go to the documentation of this file.
1 {
2  // ========================================================================
3  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
4  Int_t iVerbose = 0;
5 
6  // Input file
7 
8  TString MCFile = "sim_complete.root";
9 
10  // Number of events to process
11  Int_t nEvents = 0;
12 
13  // ---- Load libraries -------------------------------------------------
14 // gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C");
15 // rootlogon();
16 
17  PndFileNameCreator creator(MCFile.Data());
18  TString inFile = "2014-10-27-00-06-02_50_MHz_Filtered_PosCorrected_Event.root";
19  TString outFile = "2014-10-27-00-06-02_50_MHz_Filtered_PosCorrected_TrackCorr.root";
20  TString parFile = "simparams.root";
21 
22  std::cout << "MCFile : " << MCFile.Data()<< std::endl;
23  std::cout << "InFile: " << inFile.Data()<< std::endl;
24  std::cout << "OutFile: " << outFile.Data()<< std::endl;
25  std::cout << "ParFile: " << parFile.Data()<< std::endl;
26 
27  TString sysFile = gSystem->Getenv("VMCWORKDIR");
28  // ------------------------------------------------------------------------
29  // In general, the following parts need not be touched
30  // ========================================================================
31 
32  // ----- Timer --------------------------------------------------------
33  TStopwatch timer;
34  timer.Start();
35  // ------------------------------------------------------------------------
36 
37  // ----- Digitization run -------------------------------------------
38  FairRunAna *fRun= new FairRunAna();
39  fRun->SetInputFile(inFile);
40  // fRun->AddFriend(MCFile);
41  fRun->SetOutputFile(outFile);
42 // fRun->RunWithTimeStamps();
43  fRun->SetUseFairLinks(kTRUE);
44  FairGeane *Geane = new FairGeane();
45 // fRun->AddTask(Geane);
46  // ------------------------------------------------------------------------
47 
48  // ----- Parameter database --------------------------------------------
49  TString allDigiFile = sysFile+"/macro/params/all.par";
50 
51  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
52  FairParRootFileIo* parInput1 = new FairParRootFileIo();
53  parInput1->open(parFile.Data());
54 
55  FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
56  parIo1->open(allDigiFile.Data(),"in");
57 
58  rtdb->setFirstInput(parInput1);
59  rtdb->setSecondInput(parIo1);
60  // ------------------------------------------------------------------------
61 
62  PndStraightLineTrackFinderTask* finder = new PndStraightLineTrackFinderTask(0, "MVDHitsPixelPosCorrected","","");
63  finder->SetVerbose(0);
64  fRun->AddTask(finder);
65 
66  PndLmdLinFitTask* lmdfit = new PndLmdLinFitTask("MVDTestBeamTrackCand","MVDHitsPixelPosCorrected", "MvdTrack", "Mvd");
67  lmdfit->SetVerbose(0);
68  fRun->AddTask(lmdfit);
69 
70 
71  // ----- Intialise and run --------------------------------------------
73  fRun->Init();
74  fRun->Run(0, nEvents);
75 
76  rtdb->saveOutput();
77  rtdb->print();
78 
79  // ------------------------------------------------------------------------
80 
81  // ----- Finish -------------------------------------------------------
82 
83  timer.Stop();
84  Double_t rtime = timer.RealTime();
85  Double_t ctime = timer.CpuTime();
86  cout << endl << endl;
87  cout << "Macro finished succesfully." << endl;
88  cout << "Output file is " << outFile << endl;
89  cout << "Parameter file is " << parFile << endl;
90  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
91  cout << endl;
92  // ------------------------------------------------------------------------
93 
94 
95 }
TStopwatch timer
FairRunAna * fRun
Int_t nEvents
TString inFile
Double_t rtime
PndStraightLineTrackFinderTask * finder
TString allDigiFile
Double_t ctime
TString sysFile
A simple class which adds the corresponding file extensions to a given base class.
Double_t
TString MCFile
static void Init(Int_t MapVersion)
TString parFile
FairParRootFileIo * parInput1
FairRuntimeDb * rtdb
PndFileNameCreator creator(MCFile.Data())
TString outFile
FairParAsciiFileIo * parIo1
Int_t iVerbose
PndLmdLinFitTask * lmdfit
FairGeane * Geane