FairRoot/PandaRoot
Functions
runTrackingPid.C File Reference

Go to the source code of this file.

Functions

int runTrackingPid (TString runfiles, Int_t nEvents=0)
 

Function Documentation

int runTrackingPid ( TString  runfiles,
Int_t  nEvents = 0 
)

Definition at line 1 of file runTrackingPid.C.

References PndSttFindTracks::AddHitCollectionName(), Bool_t, corr, ctime, digiparFile, Double_t, fRun, Geane, PndFileNameCreator::GetCustomFileName(), PndFileNameCreator::GetParFileName(), PndFileNameCreator::GetRecoFileName(), PndFileNameCreator::GetSimFileName(), PndEmcMapper::Init(), iVerbose, kParameterMerged, mvdTrackFinder, namecreator, nEvents, parFile, parInput1, parInput2, recoFile, recoKalman, rtdb, rtime, PndPidCorrelator::SetBarrelTrackBranch(), PndPidCorrelator::SetDebugMode(), PndMvdRiemannTrackFinderTask::SetMaxDist(), PndPidCorrelator::SetPidHyp(), PndRecoKalmanTask::SetTrackInBranchName(), PndRecoKalmanTask::SetTrackOutBranchName(), PndMvdRiemannTrackFinderTask::SetVerbose(), simFile, sttFindTracks, SttMvdTracking, sttTrackFinder, timer, and TString.

2 {
3  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
4  Int_t iVerbose = 0;
5 
6  // ---- Load libraries -------------------------------------------------
7  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
8 
9  // ----- Timer --------------------------------------------------------
10  TStopwatch timer;
11  timer.Start();
12 
13  // Number of events to process
14  // Parameter file
15  PndFileNameCreator namecreator(runfiles.Data());
19  TString tracksFile = namecreator.GetCustomFileName("pidtracks");
20  TString digiparFile = gSystem->Getenv("VMCWORKDIR");
21  digiparFile += "/macro/params/all.par";
22 
23  // ----- Reconstruction run -------------------------------------------
24  FairRunAna *fRun= new FairRunAna();
25  fRun->SetInputFile(simFile);
26  fRun->AddFriend(recoFile);
27  fRun->SetOutputFile(tracksFile);
28 
29  // ----- Parameter database --------------------------------------------
30  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
32  FairParRootFileIo* parInput1 = new FairParRootFileIo(kParameterMerged);
33  parInput1->open(parFile.Data(),"UPDATE");
34  rtdb->setFirstInput(parInput1);
35  rtdb->setOutput(parInput1);
36 
37  FairParAsciiFileIo* parInput2 = new FairParAsciiFileIo();
38  parInput2->open(digiparFile.Data(),"in");
39  rtdb->setSecondInput(parInput2);
40 
41  // ----- Geane -----
42  // ---------------------
43  FairGeane *Geane = new FairGeane();
44  fRun->AddTask(Geane);
45 
47  mvdTrackFinder->SetVerbose(iVerbose);
48  mvdTrackFinder->SetMaxDist(0.05);
49  fRun->AddTask(mvdTrackFinder);
50 
51  // PndSttTrackFinderIdeal* sttTrackFinder = new PndSttTrackFinderIdeal(iVerbose);
53  PndSttFindTracks* sttFindTracks = new PndSttFindTracks("Track Finder", "FairTask", sttTrackFinder, iVerbose);
54  sttFindTracks->AddHitCollectionName("STTHit", "STTPoint");
55  fRun->AddTask(sttFindTracks);
56 
57  PndSttMvdTracking * SttMvdTracking = new PndSttMvdTracking(0);
58  fRun->AddTask(SttMvdTracking);
59 
61  recoKalman->SetTrackInBranchName("SttMvdTrack");
62  recoKalman->SetTrackOutBranchName("SttMvdGenTrack");
63  //recoKalman->SetNumIterations(3);
64  fRun->AddTask(recoKalman);
65 
66  // ----- PID -----
67  // -------------------
68 
69  PndPidCorrelator* corr = new PndPidCorrelator(); //Propagates by default to pca of (0,0,0)
70  //corr->SetVerbose();
71  corr->SetBarrelTrackBranch("SttMvdGenTrack");
72  //corr->SetInputIDBranch("LheTrackID");
73  corr->SetPidHyp(211);
74  corr->SetDebugMode(kFALSE);
75  fRun->AddTask(corr);
76 
78  fRun->AddTask(pidprobs);
79 
80  // PndMCMatchCreatorTask* mcmatcher = new PndMCMatchCreatorTask();
81  // fRun->AddTask(mcmatcher);
82 
83  // ----- Intialise and run --------------------------------------------
85  fRun->Init();
86  fRun->Run(0,nEvents);
87  rtdb->saveOutput();
88 
89  rtdb->print();
90 
91  // ----- Finish -------------------------------------------------------
92  timer.Stop();
93  Double_t rtime = timer.RealTime();
94  Double_t ctime = timer.CpuTime();
95  cout << endl << endl;
96  cout << "Macro finished succesfully." << endl;
97  cout << "Output file is " << recoFile << endl;
98  cout << "Parameter file is " << parFile << endl;
99  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
100  cout << endl;
101 
102  return 0;
103 }
std::string GetParFileName(std::string addon="", bool cut=false)
PndMvdRiemannTrackFinderTask * mvdTrackFinder
Bool_t kParameterMerged
Definition: sim_emc_apd.C:113
PndPidCorrelator * corr
void SetBarrelTrackBranch(TString branch)
void SetPidHyp(Int_t pid)
std::string GetSimFileName(std::string addon="", bool cut=false)
PndSttTrackFinderReal * sttTrackFinder
void SetTrackOutBranchName(const TString &name)
FairGeane * Geane
FairRunAna * fRun
Definition: hit_dirc.C:58
TString simFile
Definition: bump_emc.C:11
std::string GetRecoFileName(std::string addon="", bool cut=false)
void SetDebugMode(Bool_t debug)
A simple class which adds the corresponding file extensions to a given base class.
Double_t
TString parFile
Definition: hit_dirc.C:14
Int_t nEvents
Definition: hit_dirc.C:11
TStopwatch timer
Definition: hit_dirc.C:51
std::string GetCustomFileName(std::string ext, std::string addon="", bool cut=false)
PndSttMvdTracking * SttMvdTracking
PndSttFindTracks * sttFindTracks
static void Init(Int_t MapVersion)
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
FairParAsciiFileIo * parInput2
Definition: conMvdDigi.C:26
PndFileNameCreator namecreator("../data/Lars/MvdDtsSim.root")
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t ctime
Definition: hit_dirc.C:114
std::string recoFile
void SetTrackInBranchName(const TString &name)
Int_t iVerbose
PndRecoKalmanTask * recoKalman
Double_t rtime
Definition: hit_dirc.C:113
TString digiparFile
void AddHitCollectionName(char *hitCollectionName, char *pointCollectionName)