FairRoot/PandaRoot
examples/llbar/pidideal_complete.C
Go to the documentation of this file.
2 {
3  // Macro created 02/10/2012 by S.Spataro
4  // It loads a reconstruction file and compute PID informations
5 
6  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
7  Int_t iVerbose = 0; // just forget about it, for the moment
8 
9  // Number of events to process
10  Int_t nEvents = 0; // if 0 all the vents will be processed
11 
12  // Parameter file
13  TString parFile = "simparams.root"; // at the moment you do not need it
14 
15  // Digitisation file (ascii)
16  TString digiFile = "all.par";
17 
18  // Output file
19  TString outFile = "pidideal_complete.root";
20 
21  // ----- Timer --------------------------------------------------------
22  TStopwatch timer;
23  // ------------------------------------------------------------------------
24 
25  // ----- Reconstruction run -------------------------------------------
26  FairRunAna *fRun= new FairRunAna();
27  fRun->SetInputFile("sim_complete.root");
28  fRun->AddFriend("digi_complete.root");
29  fRun->AddFriend("recoideal_complete.root");
30  fRun->SetOutputFile(outFile);
31  fRun->SetGenerateRunInfo(kFALSE);
32  fRun->SetUseFairLinks(kTRUE);
33  FairGeane *Geane = new FairGeane();
34  fRun->AddTask(Geane);
35 
36  // ----- Parameter database --------------------------------------------
37  TString emcDigiFile = gSystem->Getenv("VMCWORKDIR");
38  emcDigiFile += "/macro/params/";
39  emcDigiFile += digiFile;
40 
41  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
42  FairParRootFileIo* parInput1 = new FairParRootFileIo();
43  parInput1->open(parFile.Data());
44 
45  FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
46  parIo1->open(emcDigiFile.Data(),"in");
47 
48  rtdb->setFirstInput(parInput1);
49  rtdb->setSecondInput(parIo1);
50 
51  // ------------------------------------------------------------------------
52 
54  //corr->SetVerbose();
55  corr->SetBarrelTrackBranch("SttMvdGemGenTrack");
56 // corr->SetInputIDBranch("SttMvdGemGenTrackID");
57  corr->SetForwardTrackBranch("FtsIdealGenTrack");
58 // corr->SetInputIDBranch2("FtsIdealGenTrackID");
59  corr->SetIdeal(kTRUE);
60  corr->SetIdealHyp(kTRUE);
61  //corr->SetDebugMode(kTRUE);
62  //corr->SetFast(kTRUE);
63  //corr->SetBackPropagate(kFALSE);
64  fRun->AddTask(corr);
65 
66  PndMcCloner *clone = new PndMcCloner();
67  fRun->AddTask(clone);
68 
70  fRun->AddTask(assMC);
71 
73  fRun->AddTask(assMvd);
74 
76  fRun->AddTask(assMdt);
77 
79  fRun->AddTask(assDrc);
80 
82  fRun->AddTask(assDisc);
83 
85  fRun->AddTask(assStt);
86 
88  fRun->AddTask(assEMC);
89 
90  // ----- Intialise and run --------------------------------------------
92  cout << "fRun->Init()" << endl;
93  fRun->Init();
94 
95  timer.Start();
96  fRun->Run(0,nEvents);
97  // ------------------------------------------------------------------------
98 
99 
100  // ----- Finish -------------------------------------------------------
101  timer.Stop();
102  Double_t rtime = timer.RealTime();
103  Double_t ctime = timer.CpuTime();
104  cout << endl << endl;
105  cout << "Macro finished successfully." << endl;
106  cout << "Output file is " << outFile << endl;
107  cout << "Parameter file is " << parFile << endl;
108  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
109  cout << endl;
110  // ------------------------------------------------------------------------
111  cout << " Test passed" << endl;
112  cout << " All ok " << endl;
113  return 0;
114 }
void SetIdeal(Bool_t id)
PndPidCorrelator * corr
TString outFile
Definition: hit_dirc.C:17
void SetBarrelTrackBranch(TString branch)
PndPidIdealAssociatorTask * assMC
PndPidMdtHCAssociatorTask * assMdt
TString digiFile
Definition: bump_emc.C:20
PndPidDiscAssociatorTask * assDisc
PndPidMvdAssociatorTask * assMvd
TString emcDigiFile
Definition: bump_emc.C:45
PndPidEmcBayesAssociatorTask * assEMC
FairGeane * Geane
FairRunAna * fRun
Definition: hit_dirc.C:58
Double_t
TString parFile
Definition: hit_dirc.C:14
PndPidSttAssociatorTask * assStt
Int_t nEvents
Definition: hit_dirc.C:11
TStopwatch timer
Definition: hit_dirc.C:51
static void Init(Int_t MapVersion)
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
PndPidDrcAssociatorTask * assDrc
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t ctime
Definition: hit_dirc.C:114
FairParAsciiFileIo * parIo1
Definition: bump_emc.C:53
Int_t iVerbose
void SetForwardTrackBranch(TString branch)
void SetIdealHyp(Bool_t opt=kTRUE)
Double_t rtime
Definition: hit_dirc.C:113