FairRoot/PandaRoot
detectors/stt/runreco.C
Go to the documentation of this file.
1 {
2  // ========================================================================
3  // Adjust this part according to your requirements
4 
5  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug, 4=visualization on)
6  Int_t iVerbose = 1;
7 
8  // Input file (MC events)
9  TString inFile = "testrun.root";
10  TString inFile2 = "testdigi.root";
11 
12  // Number of events to process
13  Int_t nEvents = 0;
14 
15  // Parameter file
16  TString parFile = "testparams.root";
17 
18  // Output file
19  TString outFile = "testreco.root";
20 
21  // // ---- Load libraries ------------------------------------------------
22  // gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C");
23  // rootlogon();
24 
25  // ----- Timer --------------------------------------------------------
26  TStopwatch timer;
27  timer.Start();
28  // ------------------------------------------------------------------------
29 
30 
31  // ----- Reconstruction run -------------------------------------------
32  FairRunAna *fRun= new FairRunAna();
33  fRun->SetInputFile(inFile);
34  fRun->AddFriend(inFile2);
35  fRun->SetOutputFile(outFile);
36  // ------------------------------------------------------------------------
37  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
38  FairParRootFileIo* parInput1 = new FairParRootFileIo();
39  parInput1->open(parFile.Data());
40  rtdb->setFirstInput(parInput1);
41 
42  cout << "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" << endl;
43  cout << "@@@@@@@@@@@@@@@@@@@@@@@ WARNING: @@@@@@@@@@@@@@@@@@@@@@@@@" << endl;
44  cout << "@@ @@" << endl;
45  cout << "@@ this is an old version of the reconstruction code. @@" << endl;
46  cout << "@@ You should not use this! @@" << endl;
47  cout << "@@ @@" << endl;
48  cout << "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" << endl;
49  cout << "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" << endl;
50 
51 
52 
53  // TRACK FINDING =============================================================================
54  // trackfinding ....
55  PndTrkTracking2* tracking = new PndTrkTracking2(0,false,false,false);
56  // tracking->SetInputBranchName("STTHit","MVDHitsPixel","MVDHitsStrip");
57  tracking->NoMvdAloneTracking();
58  fRun->AddTask(tracking);
59 
60  PndMCTrackAssociator* trackMC = new PndMCTrackAssociator();
61  trackMC->SetTrackInBranchName("SttMvdTrack");
62  trackMC->SetTrackOutBranchName("SttMvdTrackID");
63  fRun->AddTask(trackMC);
64 
65 
66 
67  // ----- Intialise and run --------------------------------------------
68  fRun->Init();
69  fRun->Run(0, nEvents);
70  // fRun->Run(15, 20);
71  // ------------------------------------------------------------------------
72 
73  // ----- Finish -------------------------------------------------------
74  timer.Stop();
75  Double_t rtime = timer.RealTime();
76  Double_t ctime = timer.CpuTime();
77  cout << endl << endl;
78  cout << "Macro finished succesfully." << endl;
79  cout << "Output file is " << outFile << endl;
80  cout << "Parameter file is " << parFile << endl;
81  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
82  cout << endl;
83  // ------------------------------------------------------------------------
84 }
TString outFile
Definition: hit_dirc.C:17
FairRunAna * fRun
Definition: hit_dirc.C:58
TString inFile
Definition: hit_dirc.C:8
Double_t
TString parFile
Definition: hit_dirc.C:14
TString inFile2
Definition: rungenfit.C:14
Int_t nEvents
Definition: hit_dirc.C:11
TStopwatch timer
Definition: hit_dirc.C:51
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
PndTrkTracking * tracking
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
PndMCTrackAssociator * trackMC
Double_t ctime
Definition: hit_dirc.C:114
void NoMvdAloneTracking()
Int_t iVerbose
Double_t rtime
Definition: hit_dirc.C:113