FairRoot/PandaRoot
reco_mvd.C
Go to the documentation of this file.
1 int reco_mvd()
2 {
3  // Macro created 20/09/2006 by S.Spataro
4  // It loads a simulation file and digitize hits for EMC
5 
6  gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C");
7  rootlogon();
8 
9  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
10  Int_t iVerbose = 0; // just forget about it, for the moment
11 
12  // Number of events to process
13  Int_t nEvents = 0; // if 0 all the vents will be processed
14 
15  // Parameter file
16  TString parFile = "simparams.root"; // at the moment you do not need it
17 
18  // Digitisation file (ascii)
19  TString digiFile = "all.par";
20 
21  // Output file
22  TString outFile = "reco_mvd.root";
23 
24  // ----- Timer --------------------------------------------------------
25  TStopwatch timer;
26  // ------------------------------------------------------------------------
27 
28  // ----- Reconstruction run -------------------------------------------
29  FairRunAna *fRun= new FairRunAna();
30  fRun->SetInputFile("sim_mvd.root");
31  fRun->AddFriend("digi_mvd.root");
32  fRun->SetOutputFile(outFile);
33 
34  // ----- Parameter database --------------------------------------------
35  TString emcDigiFile = gSystem->Getenv("VMCWORKDIR");
36  emcDigiFile += "/macro/params/";
37  emcDigiFile += digiFile;
38 
39  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
40  FairParRootFileIo* parInput1 = new FairParRootFileIo();
41  parInput1->open(parFile.Data());
42 
43  FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
44  parIo1->open(emcDigiFile.Data(),"in");
45 
46  rtdb->setFirstInput(parInput1);
47  rtdb->setSecondInput(parIo1);
48 
49 
50  // ----- EMC hit producers ---------------------------------
51  // The file name should be the same of the geometry file which was used for the simulation
52 
53 // PndEmcMakeCluster* emcMakeCluster= new PndEmcMakeCluster(iVerbose);
54 // emcMakeCluster->SetStorageOfData(kFALSE);
55 // fRun->AddTask(emcMakeCluster);
56 // PndEmcHdrFiller* emcHdrFiller = new PndEmcHdrFiller();
57 // fRun->AddTask(emcHdrFiller); // ECM header
58 // PndEmcMakeBump* emcMakeBump= new PndEmcMakeBump();
59 // fRun->AddTask(emcMakeBump);
60 // PndEmcMakeRecoHit* emcMakeRecoHit= new PndEmcMakeRecoHit();
61 // fRun->AddTask(emcMakeRecoHit);
62 
63 // // trackfinding ....
64 // PndSttTrackFinderIdeal* sttTrackFinder = new PndSttTrackFinderIdeal(iVerbose);
65 // PndSttFindTracks* sttFindTracks = new PndSttFindTracks("Track Finder", "FairTask", sttTrackFinder, iVerbose);
66 // sttFindTracks->AddHitCollectionName("STTHit", "STTPoint");
67 // fRun->AddTask(sttFindTracks);
68 // // trackmatching ....
69 // PndSttMatchTracks* sttTrackMatcher = new PndSttMatchTracks("Match tracks", "STT", iVerbose);
70 // sttTrackMatcher->AddHitCollectionName("STTHit", "STTPoint");
71 // fRun->AddTask(sttTrackMatcher);
72 // // trackfitting ....
73 // PndSttTrackFitter* sttTrackFitter = new PndSttHelixTrackFitter(0);
74 // PndSttFitTracks* sttFitTracks = new PndSttFitTracks("STT Track Fitter", "FairTask", sttTrackFitter);
75 // sttFitTracks->AddHitCollectionName("STTHit");
76 // fRun->AddTask(sttFitTracks);
77 // // helix hit production ....
78 // PndSttHelixHitProducer* sttHHProducer = new PndSttHelixHitProducer();
79 // fRun->AddTask(sttHHProducer);
80 
81 
82 // //------ Ideal DCH track finder --------------------
83 // PndDchFindTracks* finderTask = new PndDchFindTracks("dchFindTracks");
84 // finderTask->SetUseHitOrDigi("chit");
85 // fRun->AddTask(finderTask);
86 // // -------------------------------------------------
87 // PndDchTrackFinderIdealCylHit* mcTrackFinder = new PndDchTrackFinderIdealCylHit();
88 // mcTrackFinder->SetPrimary(1); // 1 = Only primary tracks are processed, 0 = all (default)
89 // finderTask->UseFinder(mcTrackFinder);
90 // //--------------------------------------------------
91 // PndDchMatchTracks *matchTask = new PndDchMatchTracks();//match PndDchTracks and MCTracks
92 // matchTask->SetUseHitOrDigi("chit");
93 // fRun->AddTask(matchTask);
94 
95  //----- Mvd Hit Reco -----
97  fRun->AddTask(mvdmccls);
98 
100  mvdTrackFinder->SetVerbose(iVerbose);
101  fRun->AddTask(mvdTrackFinder);
102 
103 
104 
105 
106 
107 
108 // //------ GEM Realistic Track finder --------------------
109 // //Create and add finder task
110 // PndGemFindTracks* gemFinderTask = new
111 // PndGemFindTracks("PndGemFindTracks");
112 // gemFinderTask->SetUseHitOrDigi("hit"); // hit = (default), digi
113 // fRun->AddTask(gemFinderTask);
114 //
115 // PndGemTrackFinderOnHits* gemTrackFinder = new PndGemTrackFinderOnHits();
116 // gemTrackFinder->SetVerbose(0); // verbosity level
117 // gemTrackFinder->SetPrimary(0); // 1 = Only primary tracks are processed, 0 = all (default)
118 // gemFinderTask->UseFinder(gemTrackFinder);
119 //
120 // PndGemTrackFinderQA* gemTrackFinderQA = new PndGemTrackFinderQA();
121 // gemTrackFinderQA->SetVerbose(0);
122 // fRun->AddTask(gemTrackFinderQA);
123 //
124 // KalmanTask* kalman =new KalmanTask();
125 // kalman->SetPersistence();
126 // kalman->SetNumIterations(3); // number of fitting iterations (back and forth)
127 // fRun->AddTask(kalman);
128 
129 
130  // ----- Intialise and run --------------------------------------------
131  cout << "fRun->Init()" << endl;
132  fRun->Init();
133 
134  timer.Start();
135  fRun->Run(0,nEvents);
136  // ------------------------------------------------------------------------
137 
138 
139  // ----- Finish -------------------------------------------------------
140  timer.Stop();
141  Double_t rtime = timer.RealTime();
142  Double_t ctime = timer.CpuTime();
143  cout << endl << endl;
144  cout << "Macro finished successfully." << endl;
145  cout << "Output file is " << outFile << endl;
146  cout << "Parameter file is " << parFile << endl;
147  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
148  cout << endl;
149  // ------------------------------------------------------------------------
150  cout << " Test passed" << endl;
151  cout << " All ok " << endl;
152  return 0;
153 }
PndMvdRiemannTrackFinderTask * mvdTrackFinder
TString outFile
Definition: hit_dirc.C:17
TString digiFile
Definition: bump_emc.C:20
TString emcDigiFile
Definition: bump_emc.C:45
PndMvdStripClusterTask * mvdmccls
Definition: runclust.C:45
FairRunAna * fRun
Definition: hit_dirc.C:58
int reco_mvd()
Definition: reco_mvd.C:1
Double_t
TString parFile
Definition: hit_dirc.C:14
Int_t nEvents
Definition: hit_dirc.C:11
TStopwatch timer
Definition: hit_dirc.C:51
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
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
Double_t rtime
Definition: hit_dirc.C:113