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