FairRoot/PandaRoot
run_EventBuilding.C
Go to the documentation of this file.
1 {
2  // ========================================================================
3  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
4  Int_t iVerbose = 0;
5 
6  // Input file
7 
8  TString MCFile = "sim_complete.root";
9 
10  // Number of events to process
11  Int_t nEvents = 0;
12 
13  // ---- Load libraries -------------------------------------------------
14 // gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C");
15 // rootlogon();
16 
17  PndFileNameCreator creator(MCFile.Data());
18  TString inFile = "2014-10-27-00-06-02_50_MHz_Filtered_TimeCorrectedSorted.root";
19  TString outFile = "2014-10-27-00-06-02_50_MHz_Filtered_TimeCorrectedSorted_Event2.root";
20  TString parFile = "simparams.root";
21 
22  std::cout << "MCFile : " << MCFile.Data()<< std::endl;
23  std::cout << "InFile: " << inFile.Data()<< std::endl;
24  std::cout << "OutFile: " << outFile.Data()<< std::endl;
25  std::cout << "ParFile: " << parFile.Data()<< std::endl;
26 
27  TString sysFile = gSystem->Getenv("VMCWORKDIR");
28  // ------------------------------------------------------------------------
29  // In general, the following parts need not be touched
30  // ========================================================================
31 
32  // ----- Timer --------------------------------------------------------
33  TStopwatch timer;
34  timer.Start();
35  // ------------------------------------------------------------------------
36 
37  // ----- Digitization run -------------------------------------------
38  FairRunAna *fRun= new FairRunAna();
39  fRun->SetInputFile(inFile);
40  // fRun->AddFriend(MCFile);
41  fRun->SetOutputFile(outFile);
42  fRun->RunWithTimeStamps();
43  fRun->SetUseFairLinks(kTRUE);
44  FairGeane *Geane = new FairGeane();
45 // fRun->AddTask(Geane);
46  // ------------------------------------------------------------------------
47 
48  // ----- Parameter database --------------------------------------------
49  TString allDigiFile = sysFile+"/macro/params/all.par";
50 
51  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
52  FairParRootFileIo* parInput1 = new FairParRootFileIo();
53  parInput1->open(parFile.Data());
54 
55  FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
56  parIo1->open(allDigiFile.Data(),"in");
57 
58  rtdb->setFirstInput(parInput1);
59  rtdb->setSecondInput(parIo1);
60  // ------------------------------------------------------------------------
61 
63  builder->SetBranchName("MVDHitsPixelCorrectedSorted");
64  builder->SetTimeGap(50);
65  //timeSort->SetTimeOffset(1000000000);
66  fRun->AddTask(builder);
67 
68 
69  // ----- Intialise and run --------------------------------------------
71  fRun->Init();
72  fRun->Run(0, nEvents);
73 
74  rtdb->saveOutput();
75  rtdb->print();
76 
77  // ------------------------------------------------------------------------
78 
79  // ----- Finish -------------------------------------------------------
80 
81  timer.Stop();
82  Double_t rtime = timer.RealTime();
83  Double_t ctime = timer.CpuTime();
84  cout << endl << endl;
85  cout << "Macro finished succesfully." << endl;
86  cout << "Output file is " << outFile << endl;
87  cout << "Parameter file is " << parFile << endl;
88  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
89  cout << endl;
90  // ------------------------------------------------------------------------
91 
92 
93 }
TString outFile
Definition: hit_dirc.C:17
TString allDigiFile
Definition: hit_muo.C:36
FairGeane * Geane
FairRunAna * fRun
Definition: hit_dirc.C:58
TString inFile
Definition: hit_dirc.C:8
void SetBranchName(TString name)
TString sysFile
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
PndGapEventBuilderTask * builder
static void Init(Int_t MapVersion)
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
PndMvdCreateDefaultApvMap * creator
Int_t iVerbose
TString MCFile
Double_t rtime
Definition: hit_dirc.C:113