FairRoot/PandaRoot
makeTCands.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 makeTCands(TString base="dsdsj20k.evt",int nevts=10)
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("libField");
26  gSystem->Load("libPassive");
27  gSystem->Load("libGen");
28  gSystem->Load("libEmc");
29  gSystem->Load("libgenfit");
30  gSystem->Load("libtpc");
31  gSystem->Load("libtpcreco");
32  gSystem->Load("libtrackrep");
33  //gSystem->Load("librecotasks");
34  //gSystem->Load("libMvd");
35  //gSystem->Load("libMvdReco");
36  //gSystem->Load("libLHETrack");
37  gSystem->Load("libanatask");
38  //gSystem->Load("libfsim");
39  gSystem->Load("libRho");
40 
41  //if (outfile=="") outfile=infile+"_ana.root";
42 
43  //analysis
44  TString infile=base+".mcreco.root";
45  TString outfile=base+".full.root";
46 
47  FairRunAna *fRunA= new FairRunAna();
48  fRunA->SetInputFile(infile);
49  fRunA->SetOutputFile(outfile.Data());
50 
51  //append the analysis task
52  PndStoreTCands *tcandTask=new PndStoreTCands();
53  fRunA->AddTask(tcandTask);
54 
55  //PndSimpleAnalysis *anaTask=new PndSimpleAnalysis(cfgfile.Data());
56  //fRunA->AddTask(anaTask);
57 
58  fRunA->Init();
59  if (nevts==0) nevts=10;
60  fRunA->Run(0,nevts);
61 
62 
63  timer.Stop();
64  Double_t rtime = timer.RealTime();
65  Double_t ctime = timer.CpuTime();
66  printf("RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime);
67  return 0;
68 }
69 
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
Double_t ctime
Definition: hit_dirc.C:114
Double_t rtime
Definition: hit_dirc.C:113
TFile infile("dedx_out.root","READ")
TString outfile
int makeTCands(TString base="dsdsj20k.evt", int nevts=10)
Definition: makeTCands.C:10