FairRoot/PandaRoot
ana_fast.C
Go to the documentation of this file.
1 // *******
2 // Macro for running analysis in a Task
3 // Take a look to tutorials/anatask/PndAnalysis.cxx
4 // Add the line add_subdirectory(tutorials/anatask)
5 // to pandaroot/CMakeLists.txt
6 // and do a 'make install' in build directory first
7 // *******
8 
9 
10 int ana_fast(TString infile="dsdsj_20k.evt.root",int nevts=0,TString outfile="ana.root")
11 {
12  TStopwatch timer;
13  timer.Start();
14  gDebug=0;
15 
16  // Load basic libraries
17  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
18  basiclibs();
19 
20  // Load this example libraries
21  gSystem->Load("libGeoBase");
22  gSystem->Load("libParBase");
23  gSystem->Load("libBase");
24  gSystem->Load("libPndData");
25  gSystem->Load("libGen");
26  gSystem->Load("libRho");
27  gSystem->Load("libfsim");
28 
29 
30  if (outfile=="") outfile=infile+"_ana.root";
31 
32  //analysis
33 
34  FairRunAna *fRunA= new FairRunAna();
35  fRunA->SetInputFile(infile);
36  fRunA->SetOutputFile(outfile);
37 
38  //append the analysis task
39  PndAnalysis *anaTask=new PndAnalysis();
40  fRunA->AddTask(anaTask);
41 
42  fRunA->Init();
43  if (nevts==0) nevts=10;
44  fRunA->Run(0,nevts);
45 
46 
47  timer.Stop();
48  Double_t rtime = timer.RealTime();
49  Double_t ctime = timer.CpuTime();
50  printf("RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime);
51  return 0;
52 }
53 
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
basiclibs()
Double_t
TStopwatch timer
Definition: hit_dirc.C:51
gDebug
Definition: sim_emc_apd.C:6
int ana_fast(TString infile="dsdsj_20k.evt.root", int nevts=0, TString outfile="ana.root")
Definition: ana_fast.C:10
Double_t ctime
Definition: hit_dirc.C:114
Double_t rtime
Definition: hit_dirc.C:113
TFile infile("dedx_out.root","READ")
TString outfile