FairRoot/PandaRoot
locT_all.C
Go to the documentation of this file.
1 int locT_all() {
2  // ========================================================================
3  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
4  Int_t iVerbose = 0;
5 
6  // Input file
7  TString inDigiFile = "digi_global.root";
8  TString inSimFile = "points_global.root";
9 
10  // Parameter file
11  TString parFile = "params_global.root";
12 
13  // Output file
14  TString outFile = "locT_global.root";
15 
16  // Number of events to process
17  Int_t nEvents = 0;
18 
19  // ---- Load libraries -------------------------------------------------
20  gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C");
21  rootlogon();
22  TString sysFile = gSystem->Getenv("VMCWORKDIR");
23  // ------------------------------------------------------------------------
24  // In general, the following parts need not be touched
25  // ========================================================================
26 
27  // ----- Timer --------------------------------------------------------
28  TStopwatch timer;
29  timer.Start();
30  // ------------------------------------------------------------------------
31 
32  // ----- Digitization run -------------------------------------------
33  FairRunAna *fRun= new FairRunAna();
34  fRun->SetInputFile(inDigiFile);
35  fRun->AddFriend(inSimFile);
36  fRun->SetOutputFile(outFile);
37  FairGeane *Geane = new FairGeane();
38  fRun->AddTask(Geane);
39  // ------------------------------------------------------------------------
40 
41  // ----- Parameter database --------------------------------------------
42  TString allDigiFile = sysFile+"/macro/params/all.par";
43 
44  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
45  FairParRootFileIo* parInput1 = new FairParRootFileIo();
46  parInput1->open(parFile.Data());
47 
48  FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
49  parIo1->open(allDigiFile.Data(),"in");
50 
51  rtdb->setFirstInput(parInput1);
52  rtdb->setSecondInput(parIo1);
53  // ################################################################## MVD
54  // ----- MVD ideal tracking --------------------------------------------
56  mvdTrackFinder->SetVerbose(iVerbose);
57  fRun->AddTask(mvdTrackFinder);
58  // ################################################################## GEM
59  // trackfinding ....
61  PndSttFindTracks* sttFindTracks = new PndSttFindTracks("Track Finder", "FairTask", sttTrackFinder, iVerbose);
62  sttFindTracks->AddHitCollectionName("STTHit", "STTPoint");
63  fRun->AddTask(sttFindTracks);
64  /* // trackmatching ....
65  PndSttMatchTracks* sttTrackMatcher = new PndSttMatchTracks("Match tracks", "STT", iVerbose);
66  sttTrackMatcher->AddHitCollectionName("STTHit", "STTPoint");
67  fRun->AddTask(sttTrackMatcher);
68  // trackfitting ....
69  PndSttTrackFitter* sttTrackFitter = new PndSttHelixTrackFitter(0);
70  PndSttFitTracks* sttFitTracks = new PndSttFitTracks("STT Track Fitter", "FairTask", sttTrackFitter);
71  sttFitTracks->AddHitCollectionName("STTHit");
72  fRun->AddTask(sttFitTracks);*/
73  // helix hit production ....
74 // PndSttHelixHitProducer* sttHHProducer = new PndSttHelixHitProducer();
75 // fRun->AddTask(sttHHProducer);
76  // ################################################################## GEM
77  // ----- GEM ideal tracking --------------------------------------
78  PndGemFindTracks* gemFinderTask = new PndGemFindTracks("PndGemFindTracks");
79  gemFinderTask->SetUseHitOrDigi("hit"); // hit = (default), digi
80  fRun->AddTask(gemFinderTask);
81  // ------------------------------------------------------------------
82  PndGemTrackFinderIdeal* gemMcTrackFinder = new PndGemTrackFinderIdeal();
83  gemMcTrackFinder->SetVerbose(0); // verbosity level
84  gemMcTrackFinder->SetPrimary(0); // 1 = Only primary tracks are processed, 0 = all (default)
85  gemFinderTask->UseFinder(gemMcTrackFinder);
86  // ------------------------------------------------------------------
87  PndGemTrackFinderQA* gemTrackFinderQA = new PndGemTrackFinderQA();
88  gemTrackFinderQA->SetVerbose(0);
89  fRun->AddTask(gemTrackFinderQA);
90  // ##################################################################
91 
92  // ----- Intialise and run --------------------------------------------
93  fRun->Init();
94  fRun->Run(0, nEvents);
95 
96  rtdb->saveOutput();
97  rtdb->print();
98 
99  // ------------------------------------------------------------------------
100 
101  // ----- Finish -------------------------------------------------------
102 
103  timer.Stop();
104  Double_t rtime = timer.RealTime();
105  Double_t ctime = timer.CpuTime();
106  cout << endl << endl;
107  cout << "Macro finished succesfully." << endl;
108  cout << "Output file is " << outFile << endl;
109  cout << "Parameter file is " << parFile << endl;
110  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
111  cout << endl;
112  // ------------------------------------------------------------------------
113 
114 
115  return 0;
116 }
PndMvdRiemannTrackFinderTask * mvdTrackFinder
int locT_all()
Definition: locT_all.C:1
TString outFile
Definition: hit_dirc.C:17
void SetPrimary(const Int_t &primary)
void UseFinder(PndGemTrackFinder *finder)
TString allDigiFile
Definition: hit_muo.C:36
PndSttTrackFinderReal * sttTrackFinder
FairGeane * Geane
FairRunAna * fRun
Definition: hit_dirc.C:58
void SetVerbose(const Int_t &verbose)
void SetVerbose(const Int_t &verbose)
Ideal track finding algorithm.
TString sysFile
TString inSimFile
Double_t
TString parFile
Definition: hit_dirc.C:14
Int_t nEvents
Definition: hit_dirc.C:11
TStopwatch timer
Definition: hit_dirc.C:51
PndSttFindTracks * sttFindTracks
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
TString inDigiFile
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
track finding quality assesment task
Task class for track finding in the Gem.
Double_t rtime
Definition: hit_dirc.C:113
void AddHitCollectionName(char *hitCollectionName, char *pointCollectionName)
void SetUseHitOrDigi(TString useHitOrDigi="hit")