FairRoot/PandaRoot
run_TimeSorting.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_TimeCorrected.root";
19  TString outFile = "2014-10-27-00-06-02_50_MHz_Filtered_TimeCorrectedSorted.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 
62  PndMapSorterTask* timeSort = new PndMapSorterTask("MVDHitsPixelCorrected","MVDHitsPixelCorrectedSorted","Mvd");
63  timeSort->SetTimeOffset(1000000000);
64  fRun->AddTask(timeSort);
65 
66 
67  // ----- Intialise and run --------------------------------------------
69  fRun->Init();
70  fRun->Run(0, nEvents);
71 
72  rtdb->saveOutput();
73  rtdb->print();
74 
75  // ------------------------------------------------------------------------
76 
77  // ----- Finish -------------------------------------------------------
78 
79  timer.Stop();
80  Double_t rtime = timer.RealTime();
81  Double_t ctime = timer.CpuTime();
82  cout << endl << endl;
83  cout << "Macro finished succesfully." << endl;
84  cout << "Output file is " << outFile << endl;
85  cout << "Parameter file is " << parFile << endl;
86  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
87  cout << endl;
88  // ------------------------------------------------------------------------
89 
90 
91 }
TString allDigiFile
FairRunAna * fRun
TString parFile
Double_t rtime
PndFileNameCreator creator(MCFile.Data())
FairRuntimeDb * rtdb
TString sysFile
A simple class which adds the corresponding file extensions to a given base class.
Double_t
Double_t ctime
TString MCFile
FairParRootFileIo * parInput1
static void Init(Int_t MapVersion)
FairGeane * Geane
TString outFile
FairParAsciiFileIo * parIo1
TStopwatch timer
Int_t iVerbose
void SetTimeOffset(Double_t val)
TString inFile
PndMapSorterTask * timeSort
Int_t nEvents