FairRoot/PandaRoot
Functions
timeordered/PrintLinks_complete.C File Reference

Go to the source code of this file.

Functions

int PrintLinks_complete (Int_t nEvents=0)
 

Function Documentation

int PrintLinks_complete ( Int_t  nEvents = 0)

Definition at line 1 of file timeordered/PrintLinks_complete.C.

References creator, ctime, digiFile, Double_t, emcDigiFile, fRun, Geane, iVerbose, MCFile, nEvents, parFile, parInput1, parIo1, rtdb, rtime, sysFile, timer, and TString.

2 {
3  // Macro created 20/09/2006 by S.Spataro
4  // It loads a digi file and performs tracking
5 
6  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
7  Int_t iVerbose = 0; // just forget about it, for the moment
8 
9  // Number of events to process
10 // Int_t nEvents = 0; // if 0 all the vents will be processed
11 
12  TString MCFile = "sim_complete.root";
13  PndFileNameCreator creator(MCFile.Data());
14  TString digiInputFile = creator.GetDigiFileName("timebased");
15  TString recoInput = creator.GetRecoFileName("timebased");
16  // TString pidInput = "pid_complete.root";
17 
18 
19  TString sysFile = gSystem->Getenv("VMCWORKDIR");
20  TString parFile = creator.GetParFileName(); // at the moment you do not need it
21 
22  // Digitisation file (ascii)
23  TString digiFile = "all.par";
24 
25  // ----- Timer --------------------------------------------------------
26  TStopwatch timer;
27  // ------------------------------------------------------------------------
28 
29  // ----- Reconstruction run -------------------------------------------
30  FairRunAna *fRun= new FairRunAna();
31  fRun->SetInputFile(recoInput);
32  fRun->AddFriend(digiInputFile);
33  fRun->AddFriend(MCFile);
34  // fRun->AddFriend(pidInput);
35 // fRun->AddFriend("reco_complete_test.root");
36 // fRun->AddFriend(MCFile);
37  fRun->SetOutputFile("TST.root");
38  fRun->SetGenerateRunInfo(kTRUE);
39  fRun->SetUseFairLinks(kTRUE);
40  //fRun->RunWithTimeStamps();
41  FairGeane *Geane = new FairGeane();
42  fRun->AddTask(Geane);
43 
44  // ----- Parameter database --------------------------------------------
45  TString emcDigiFile = gSystem->Getenv("VMCWORKDIR");
46  emcDigiFile += "/macro/params/";
47  emcDigiFile += digiFile;
48 
49  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
50  FairParRootFileIo* parInput1 = new FairParRootFileIo();
51  parInput1->open(parFile.Data());
52 
53  FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
54  parIo1->open(emcDigiFile.Data(),"in");
55 
56  rtdb->setFirstInput(parInput1);
57  rtdb->setSecondInput(parIo1);
58 
59  // ------------------------------------------------------------------------
60 
61  PndPrintFairLinks* printlinksTask = new PndPrintFairLinks();
62  fRun->AddTask(printlinksTask);
63 
64 // PndMCMatchPrintTask* printTask = new PndMCMatchPrintTask();
65  // fRun->AddTask(printTask);
66 
67 // PndMCMatchAnaGapTask* anaTask = new PndMCMatchAnaGapTask();
68  // fRun->AddTask(anaTask);
69 
70 
71  // ----- Intialise and run --------------------------------------------
72  // PndEmcMapper::Init(1);
73  cout << "fRun->Init()" << endl;
74 
75  fRun->Init();
76 
77  timer.Start();
78  fRun->Run(0,nEvents);
79  // ------------------------------------------------------------------------
80 
81 
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 successfully." << 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  cout << " Test passed" << endl;
94  cout << " All ok " << endl;
95  // exit(0);
96  return 0;
97 }
TString digiFile
Definition: bump_emc.C:20
TString emcDigiFile
Definition: bump_emc.C:45
FairGeane * Geane
FairRunAna * fRun
Definition: hit_dirc.C:58
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
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