FairRoot/PandaRoot
pid_rich.C
Go to the documentation of this file.
1 int pid_rich()
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 = "pid_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("reco_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->SetDebugMode(kTRUE);
60  //corr->SetFast(kTRUE);
61  //corr->SetBackPropagate(kFALSE);
62  fRun->AddTask(corr);
63 
64  PndPidBremCorrector *bremCorr = new PndPidBremCorrector();
65  fRun->AddTask(bremCorr);
66 
67  PndMcCloner *clone = new PndMcCloner();
68  fRun->AddTask(clone);
69 
71  fRun->AddTask(assMC);
72 
74  fRun->AddTask(assMvd);
75 
77  fRun->AddTask(assMdt);
78 
80  fRun->AddTask(assDrc);
81 
83  fRun->AddTask(assDisc);
84 
86  fRun->AddTask(assStt);
87 
89  fRun->AddTask(assEMC);
90 
92  fRun->AddTask(assRich);
93 
94  // ----- Intialise and run --------------------------------------------
96  cout << "fRun->Init()" << endl;
97  fRun->Init();
98 
99  timer.Start();
100  fRun->Run(0,nEvents);
101  // ------------------------------------------------------------------------
102 
103 
104  // ----- Finish -------------------------------------------------------
105  timer.Stop();
106  Double_t rtime = timer.RealTime();
107  Double_t ctime = timer.CpuTime();
108  cout << endl << endl;
109  cout << "Macro finished successfully." << endl;
110  cout << "Output file is " << outFile << endl;
111  cout << "Parameter file is " << parFile << endl;
112  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
113  cout << endl;
114  // ------------------------------------------------------------------------
115  cout << " Test passed" << endl;
116  cout << " All ok " << endl;
117  return 0;
118 }
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
int pid_rich()
Definition: pid_rich.C:1
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)
Double_t rtime
Definition: hit_dirc.C:113