FairRoot/PandaRoot
Functions
dbuilder.C File Reference

Go to the source code of this file.

Functions

void dbuilder (TString infile="reco_complete.root", Int_t nEvents=0)
 

Function Documentation

void dbuilder ( TString  infile = "reco_complete.root",
Int_t  nEvents = 0 
)

Definition at line 1 of file dbuilder.C.

References ctime, digiFile, Double_t, emcDigiFile, exit(), fRun, Geane, infile(), PndEmcMapper::Init(), iVerbose, nEvents, outFile, parFile, parInput1, parIo1, rtdb, rtime, 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  // Parameter file
10  TString parFile = "simparams.root"; // at the moment you do not need it
11 
12  // Digitisation file (ascii)
13  TString digiFile = "all.par";
14 
15  // Output file
16  TString outFile = infile + "_" + "dbuilt.root";
17 
18  // ----- Timer --------------------------------------------------------
19  TStopwatch timer;
20  // ------------------------------------------------------------------------
21 
22  // ----- Reconstruction run -------------------------------------------
23  FairRunAna *fRun= new FairRunAna();
24  fRun->SetInputFile(infile);
25  fRun->AddFriend("digi_complete.root");
26  fRun->AddFriend("sim_complete.root");
27  fRun->SetOutputFile(outFile);
28  fRun->SetGenerateRunInfo(kFALSE);
29  FairGeane *Geane = new FairGeane();
30  fRun->AddTask(Geane);
31 
32  // ----- Parameter database --------------------------------------------
33  TString emcDigiFile = gSystem->Getenv("VMCWORKDIR");
34  emcDigiFile += "/macro/params/";
35  emcDigiFile += digiFile;
36 
37  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
38  FairParRootFileIo* parInput1 = new FairParRootFileIo();
39  parInput1->open(parFile.Data());
40 
41  FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
42  parIo1->open(emcDigiFile.Data(),"in");
43 
44  rtdb->setFirstInput(parInput1);
45  rtdb->setSecondInput(parIo1);
46 
47  // ------------------------------------------------------------------------
48 
49  OnlineDBuilderTask * builderTask = new OnlineDBuilderTask("SttMvdGemGenTrack");
50 // builderTask->SetTrackBranchName("TracksIsochrone");
51  fRun->AddTask(builderTask);
52 
53  // ----- Intialise and run --------------------------------------------
55  cout << "fRun->Init()" << endl;
56  fRun->Init();
57 
58  timer.Start();
59  fRun->Run(0,nEvents);
60  // ------------------------------------------------------------------------
61 
62 
63  // ----- Finish -------------------------------------------------------
64  timer.Stop();
65  Double_t rtime = timer.RealTime();
66  Double_t ctime = timer.CpuTime();
67  cout << endl << endl;
68  cout << "Macro finished successfully." << endl;
69  cout << "Output file is " << outFile << endl;
70  cout << "Parameter file is " << parFile << endl;
71  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
72  cout << endl;
73  // ------------------------------------------------------------------------
74  cout << " Test passed" << endl;
75  cout << " All ok " << endl;
76  exit(0);
77 }
exit(0)
TString outFile
Definition: hit_dirc.C:17
TString digiFile
Definition: bump_emc.C:20
TString emcDigiFile
Definition: bump_emc.C:45
FairGeane * Geane
FairRunAna * fRun
Definition: hit_dirc.C:58
Double_t
TString parFile
Definition: hit_dirc.C:14
Int_t nEvents
Definition: hit_dirc.C:11
TStopwatch timer
Definition: hit_dirc.C:51
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
Int_t iVerbose
Double_t rtime
Definition: hit_dirc.C:113
TFile infile("dedx_out.root","READ")