FairRoot/PandaRoot
idealcomplete.C
Go to the documentation of this file.
1 int idealcomplete(int level = 2){
2  // ========================================================================
3  // "Ideality" level: 1 = real digi + ideal track finding + real fitting
4  // 2 = ideal digi + ideal track finding + real fitting
5  if(level == 1) cout << "real digi + ideal track finding + real fitting" << endl;
6  else if(level == 2) cout << "ideal digi + ideal track finding + real fitting" << endl;
7  else {
8  cout << "this level is not implemented, choose 1 or 2:" << endl;
9  cin >> level;
10  }
11 
12  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
13  Int_t iVerbose = 1;
14 
15  // Input file (MC events)
16  TString inFile = "testrun.root";
17 
18  // Number of events to process
19  Int_t nEvents = 0;
20 
21  // Parameter file
22  TString parFile = "testparams.root";
23 
24  // Output file
25  TString outFile = "testideal.root";
26 
27  // // ---- Load libraries ------------------------------------------------
28  // gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C");
29  // rootlogon();
30 
31  // ----- Timer --------------------------------------------------------
32  TStopwatch timer;
33  timer.Start();
34  // ------------------------------------------------------------------------
35 
36 
37  // ----- Reconstruction run -------------------------------------------
38  FairRunAna *fRun= new FairRunAna();
39  fRun->SetInputFile(inFile);
40  fRun->SetOutputFile(outFile);
41  // ------------------------------------------------------------------------
42  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
43  FairParRootFileIo* parInput1 = new FairParRootFileIo();
44  parInput1->open(parFile.Data());
45  rtdb->setFirstInput(parInput1);
46 
47 
48  // ------------------------------------------------------------------------
49  // ideal digitization .... the drift radius is the real distance particle
50  // trajectory - wire
52  else if(level == 2) PndSttHitProducerIdeal* sttHitProducer = new PndSttHitProducerIdeal();
53  else cout << "this level is not implemented, choose 1 or 2" << endl;
54  fRun->AddTask(sttHitProducer);
55  // ------------------------------------------------------------------------
56 
57  // ------------------------------------------------------------------------
58  // ideal trackfinding ....
60  PndSttFindTracks* sttFindTracks = new PndSttFindTracks("Track Finder", "FairTask", sttTrackFinder, iVerbose);
61  sttFindTracks->AddHitCollectionName("STTHit", "STTPoint");
62  fRun->AddTask(sttFindTracks);
63 
64  // ideal trackmatching ....
65  PndSttMatchTracks* sttTrackMatcher = new PndSttMatchTracks("Match tracks", "STT", iVerbose);
66  sttTrackMatcher->AddHitCollectionName("STTHit", "STTPoint");
67  fRun->AddTask(sttTrackMatcher);
68 
69  // real trackfitting .... but on ideal radii -> the smearing
70  // in the momentum distribution is only due to the algorithm
72  PndSttFitTracks* sttFitTracks = new PndSttFitTracks("STT Track Fitter", "FairTask", sttTrackFitter);
73  sttFitTracks->AddHitCollectionName("STTHit");
74  fRun->AddTask(sttFitTracks);
75 
76  // real helix hit production ....
78  fRun->AddTask(sttHHProducer);
79 
80 
81  // ----- Intialise and run --------------------------------------------
82  fRun->Init();
83  fRun->Run(0, nEvents);
84  // fRun->Run(15, 20);
85  // ------------------------------------------------------------------------
86 
87  // sttHHProducer->WriteHistograms();
88 
89  // ----- Finish -------------------------------------------------------
90  timer.Stop();
91  Double_t rtime = timer.RealTime();
92  Double_t ctime = timer.CpuTime();
93  cout << endl << endl;
94  cout << "Macro finished succesfully." << endl;
95  cout << "Output file is " << outFile << endl;
96  cout << "Parameter file is " << parFile << endl;
97  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
98  cout << endl;
99  // ------------------------------------------------------------------------
100  return 0;
101 }
PndSttMatchTracks * sttTrackMatcher
int idealcomplete(int level=2)
Definition: idealcomplete.C:1
PndSttHelixHitProducer * sttHHProducer
TString outFile
Definition: hit_dirc.C:17
PndSttTrackFitter * sttTrackFitter
void AddHitCollectionName(char *hitCollectionName, char *pointCollectionName)
PndSttHitProducerRealFast * sttHitProducer
PndSttTrackFinderReal * sttTrackFinder
FairRunAna * fRun
Definition: hit_dirc.C:58
TString inFile
Definition: hit_dirc.C:8
Double_t
TString parFile
Definition: hit_dirc.C:14
Int_t nEvents
Definition: hit_dirc.C:11
TStopwatch timer
Definition: hit_dirc.C:51
void AddHitCollectionName(char *hitCollectionName)
PndSttFindTracks * sttFindTracks
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t ctime
Definition: hit_dirc.C:114
Int_t iVerbose
Double_t rtime
Definition: hit_dirc.C:113
PndSttFitTracks * sttFitTracks
void AddHitCollectionName(char *hitCollectionName, char *pointCollectionName)