FairRoot/PandaRoot
Functions
tutorials/analysis/ana_simple.C File Reference

Go to the source code of this file.

Functions

void ana_simple (TString infile, TString cfgfile="analysis.cfg", int nevts=0, TString outfile="")
 

Function Documentation

void ana_simple ( TString  infile,
TString  cfgfile = "analysis.cfg",
int  nevts = 0,
TString  outfile = "" 
)

Definition at line 10 of file tutorials/analysis/ana_simple.C.

References ctime, Double_t, gDebug, PndSimpleAnalysis::Init(), outfile, printf(), rootlogon(), rtime, and timer.

11 {
12  TStopwatch timer;
13  timer.Start();
14  gDebug=0;
15 
16  // Load basic libraries
17  gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C");rootlogon();
18 
19 /* // Load this example libraries
20  gSystem->Load("libGeoBase");
21  gSystem->Load("libParBase");
22  gSystem->Load("libBase");
23  //gSystem->Load("libPndData");
24  //gSystem->Load("libGen");
25  gSystem->Load("libRho");
26  gSystem->Load("libfastsim");*/
27 
28  if (outfile=="") outfile=infile+"_ana.root";
29 
30  //analysis
31 
32  PndEventReader evr(infile);
33  if (nevts==0) nevts=evr.GetEntries();
34 
35  cout <<"\n####### Processing "<<nevts <<" events...\n"<<endl;
36 
37 
38  FairRunAna *fRunA= new FairRunAna();
39  fRunA->SetInputFile(infile);
40  fRunA->SetOutputFile(outfile);
41 
42  //append the analysis task
43  PndSimpleAnalysis *anaTask=new PndSimpleAnalysis(cfgfile.Data());
44  fRunA->AddTask(anaTask);
45 
46  fRunA->Init();
47  fRunA->Run(0,nevts);
48 
49 
50  timer.Stop();
51  Double_t rtime = timer.RealTime();
52  Double_t ctime = timer.CpuTime();
53  printf("RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime);
54 }
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
Double_t
TStopwatch timer
Definition: hit_dirc.C:51
gDebug
Definition: sim_emc_apd.C:6
Double_t ctime
Definition: hit_dirc.C:114
virtual InitStatus Init()
Double_t rtime
Definition: hit_dirc.C:113
TFile infile("dedx_out.root","READ")
TString outfile