FairRoot/PandaRoot
Functions
outdated/data/pid.C File Reference

Go to the source code of this file.

Functions

int pid ()
 

Function Documentation

int pid ( )

Definition at line 1 of file outdated/data/pid.C.

References assDisc, assDrc, assEMC, assMC, assMdt, assMvd, assStt, corr, creator, ctime, digiFile, Double_t, emcDigiFile, fRun, Geane, PndEmcMapper::Init(), iVerbose, nEvents, outFile, parFile, parInput1, parIo1, recoFile, rtdb, rtime, PndPidCorrelator::SetBarrelTrackBranch(), PndPidCorrelator::SetForwardTrackBranch(), simFile, 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  TString simFile = "sim.root";
13  PndFileNameCreator creator(simFile.Data());
14  TString digiFile = creator.GetDigiFileName();
15  TString recoFile = creator.GetRecoFileName();
16  TString pidFile = creator.GetPidFileName();
17  TString parFile = creator.GetParFileName();
18 
19  // Digitisation file (ascii)
20  TString digiParFile = "all.par";
21 
22 
23  // ----- Timer --------------------------------------------------------
24  TStopwatch timer;
25  // ------------------------------------------------------------------------
26 
27  // ----- Reconstruction run -------------------------------------------
28  FairRunAna *fRun= new FairRunAna();
29  fRun->SetInputFile(simFile);
30  fRun->AddFriend(digiFile);
31  fRun->AddFriend(recoFile);
32  fRun->SetOutputFile(pidFile);
33  fRun->SetGenerateRunInfo(kFALSE);
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 += digiParFile;
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->SetFast(kTRUE);
61  //corr->SetBackPropagate(kFALSE);
62  fRun->AddTask(corr);
63  /*
64  PndMcCloner *clone = new PndMcCloner();
65  clone->SetCleanMc(kTRUE);
66  fRun->AddTask(clone);
67  */
69  fRun->AddTask(assMC);
70 
72  fRun->AddTask(assMvd);
73 
75  fRun->AddTask(assMdt);
76 
78  fRun->AddTask(assDrc);
79 
81  fRun->AddTask(assDisc);
82 
84  fRun->AddTask(assStt);
85 
87  fRun->AddTask(assEMC);
88 
89  // ----- Intialise and run --------------------------------------------
91  cout << "fRun->Init()" << endl;
92  fRun->Init();
93 
94  timer.Start();
95  fRun->Run(0,nEvents);
96  // ------------------------------------------------------------------------
97 
98 
99  // ----- Finish -------------------------------------------------------
100  timer.Stop();
101  Double_t rtime = timer.RealTime();
102  Double_t ctime = timer.CpuTime();
103  cout << endl << endl;
104  cout << "Macro finished successfully." << endl;
105  cout << "Output file is " << outFile << endl;
106  cout << "Parameter file is " << parFile << endl;
107  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
108  cout << endl;
109  // ------------------------------------------------------------------------
110  cout << " Test passed" << endl;
111  cout << " All ok " << endl;
112  return 0;
113 }
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
TString simFile
Definition: bump_emc.C:11
A simple class which adds the corresponding file extensions to a given base class.
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
PndMvdCreateDefaultApvMap * creator
std::string recoFile
Int_t iVerbose
void SetForwardTrackBranch(TString branch)
Double_t rtime
Definition: hit_dirc.C:113