FairRoot/PandaRoot
Functions
softrig/prod_pid.C File Reference

Go to the source code of this file.

Functions

int prod_pid (TString outpre="")
 

Function Documentation

int prod_pid ( TString  outpre = "")

Definition at line 1 of file softrig/prod_pid.C.

References assDisc, assDrc, assEMC, assMC, assMdt, assMvd, assStt, corr, ctime, digiFile, Double_t, emcDigiFile, fRun, Geane, PndEmcMapper::Init(), iVerbose, nEvents, outFile, parFile, parInput1, parIo1, rtdb, rtime, PndPidCorrelator::SetBarrelTrackBranch(), PndPidCorrelator::SetForwardTrackBranch(), timer, and TString.

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 = outpre+"_par.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 = outpre+"_pid.root";
20 
21  // ----- Timer --------------------------------------------------------
22  TStopwatch timer;
23  // ------------------------------------------------------------------------
24 
25  // ----- Reconstruction run -------------------------------------------
26  FairRunAna *fRun= new FairRunAna();
27  fRun->SetInputFile(outpre+"_sim.root");
28  fRun->AddFriend(outpre+"_dig.root");
29  fRun->AddFriend(outpre+"_rec.root");
30  fRun->SetOutputFile(outFile);
31  fRun->SetGenerateRunInfo(kFALSE);
32  FairGeane *Geane = new FairGeane();
33  fRun->AddTask(Geane);
34 
35  // ----- Parameter database --------------------------------------------
36  TString emcDigiFile = gSystem->Getenv("VMCWORKDIR");
37  emcDigiFile += "/macro/params/";
38  emcDigiFile += digiFile;
39 
40  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
41  FairParRootFileIo* parInput1 = new FairParRootFileIo();
42  parInput1->open(parFile.Data());
43 
44  FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
45  parIo1->open(emcDigiFile.Data(),"in");
46 
47  rtdb->setFirstInput(parInput1);
48  rtdb->setSecondInput(parIo1);
49 
50  // ------------------------------------------------------------------------
51 
53  //corr->SetVerbose();
54  corr->SetBarrelTrackBranch("SttMvdGemGenTrack");
55 // corr->SetInputIDBranch("SttMvdGemGenTrackID");
56  corr->SetForwardTrackBranch("FtsIdealGenTrack");
57 // corr->SetInputIDBranch2("FtsIdealGenTrackID");
58  //corr->SetDebugMode(kTRUE);
59  //corr->SetFast(kTRUE);
60  //corr->SetBackPropagate(kFALSE);
61  fRun->AddTask(corr);
62 
63  PndMcCloner *clone = new PndMcCloner();
64  fRun->AddTask(clone);
65 
67  fRun->AddTask(assMC);
68 
70  fRun->AddTask(assMvd);
71 
73  fRun->AddTask(assMdt);
74 
76  fRun->AddTask(assDrc);
77 
79  fRun->AddTask(assDisc);
80 
82  fRun->AddTask(assStt);
83 
85  fRun->AddTask(assEMC);
86 
87  // ----- Intialise and run --------------------------------------------
89  cout << "fRun->Init()" << endl;
90  fRun->Init();
91 
92  timer.Start();
93  fRun->Run(0,nEvents);
94  // ------------------------------------------------------------------------
95 
96 
97  // ----- Finish -------------------------------------------------------
98  timer.Stop();
99  Double_t rtime = timer.RealTime();
100  Double_t ctime = timer.CpuTime();
101  cout << endl << endl;
102  cout << "Macro finished successfully." << endl;
103  cout << "Output file is " << outFile << endl;
104  cout << "Parameter file is " << parFile << endl;
105  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
106  cout << endl;
107  // ------------------------------------------------------------------------
108  cout << " Test passed" << endl;
109  cout << " All ok " << endl;
110  //exit(0);
111  return 0;
112 }
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)
Double_t rtime
Definition: hit_dirc.C:113