FairRoot/PandaRoot
Functions
anaMvdTimeData.C File Reference

Go to the source code of this file.

Functions

 anaMvdTimeData (Int_t nEvents=1000)
 

Function Documentation

anaMvdTimeData ( Int_t  nEvents = 1000)

Definition at line 4 of file anaMvdTimeData.C.

References creator, ctime, DigiFile, Double_t, fRun, iVerbose, MCFile, nEvents, outFile, parFile, parInput1, RecoFile, rtdb, rtime, timer, and TString.

5 {
6  // ========================================================================
7  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
8  Int_t iVerbose = 0;
9  TString MCFile = "Mvd_Sim.root";
10  // ---- Load libraries -------------------------------------------------
11  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
12  gSystem->Load("libMCMatchExamples");
13  // ------------------------------------------------------------------------
14  // Output file
15  PndFileNameCreator creator(MCFile.Data());
16  TString DigiFile = creator.GetDigiFileName();
17  TString RecoFile = creator.GetRecoFileName();
18  TString TrackFFile = creator.GetTrackFindingFileName();
19  TString parFile = creator.GetParFileName();
20  TString outFile = "Test.root";
21 
22  std::cout << "MCFile : " << MCFile.Data()<< std::endl;
23  std::cout << "DigiFile: " << DigiFile.Data()<< std::endl;
24  std::cout << "RecoFile: " << RecoFile.Data()<< std::endl;
25  std::cout << "TrackFindingFile: " << TrackFFile.Data()<< std::endl;
26 
27  // ----- Timer --------------------------------------------------------
28  TStopwatch timer;
29  timer.Start();
30  // ------------------------------------------------------------------------
31 
32  // ----- Reconstruction run -------------------------------------------
33  FairRunAna *fRun= new FairRunAna();
34  fRun->SetInputFile(DigiFile);
35  fRun->AddFriend(MCFile);
36  fRun->AddFriend(RecoFile);
37  // fRun->AddFriend(TrackFFile);
38  fRun->SetOutputFile(outFile);
39  //fRun->RunWithTimeStamps();
40  // ------------------------------------------------------------------------
41 
42 
43 
44  // ----- Parameter database --------------------------------------------
45  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
46  FairParRootFileIo* parInput1 = new FairParRootFileIo(kTRUE);
47  parInput1->open(parFile.Data(),"UPDATE");
48  rtdb->setFirstInput(parInput1);
49 
50  // ----- Default MVD hit producer --------------------------------------------
51 
52  PndMCTestDataCrawler* crawler = new PndMCTestDataCrawler();
53  crawler->SetStartBranch("MVDHitsPixel");
54  crawler->SetStopBranch("EventHeader.");
55  crawler->SetVerbose(2);
56  crawler->SetHistoRange(-20, 40, 601);
57  fRun->AddTask(crawler);
58 
59  // ----- OR separate tasks ---------------------------------------------------
60  //Double_t chargecut = 1.e5;
61  //PndMvdStripClusterTask* mvdmccls = new PndMvdStripClusterTask();
62  //mvdmccls->SetVerbose(iVerbose);
63  //fRun->AddTask(mvdmccls);
64 // PndMvdPixelClusterTask* mvdClusterizer = new PndMvdPixelClusterTask();
65 // mvdClusterizer->SetVerbose(iVerbose);
66 // fRun->AddTask(mvdClusterizer);
67 
68  rtdb->setOutput(parInput1);
69  rtdb->print();
70  // ===== End of HitProducers =====
71  // =========================================================================
72 // PndMvdGeoPar* geoPar = (PndMvdGeoPar*)(rtdb->getContainer("PndMvdGeoPar"));
73 
74  // ----- Intialise and run --------------------------------------------
75  fRun->Init();
76 
77  fRun->Run(0,nEvents);
78  // ------------------------------------------------------------------------
79 
80  rtdb->saveOutput();
81  rtdb->print();
82  // ----- Finish -------------------------------------------------------
83  timer.Stop();
84  Double_t rtime = timer.RealTime();
85  Double_t ctime = timer.CpuTime();
86  cout << endl << endl;
87  cout << "Macro finished succesfully." << endl;
88  cout << "Output file is " << outFile << endl;
89  cout << "Parameter file is " << parFile << endl;
90  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
91  cout << endl;
92  // ------------------------------------------------------------------------
93 
94 
95 }
TString RecoFile
TString outFile
Definition: hit_dirc.C:17
FairRunAna * fRun
Definition: hit_dirc.C:58
TString DigiFile
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
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t ctime
Definition: hit_dirc.C:114
PndMvdCreateDefaultApvMap * creator
Int_t iVerbose
TString MCFile
Double_t rtime
Definition: hit_dirc.C:113