Logo ROOT   6.14/05
Reference Guide
hsimpleProxyDriver.C
Go to the documentation of this file.
1 /// \file
2 /// \ingroup tutorial_tree
3 /// \notebook -nodraw
4 /// This is the driver of the hsimpleProxy example
5 /// It provides the infrastructure to run that code on an ntuple
6 /// To be run from the tutorials directory
7 ///
8 /// \macro_code
9 ///
10 /// \author Rene Brun
11 
12 void hsimpleProxyDriver()
13 {
14  std::cout << gSystem->WorkingDirectory() << std::endl;
15  TFile *file = TFile::Open("hsimple.root");
16  if (!file){
17  std::cerr << "Input file not found.\n";
18  return ;
19  }
20  TTree *ntuple = nullptr;
21  file->GetObject("ntuple",ntuple);
22  TString dir = gSystem->DirName(__FILE__);
23  ntuple->Draw(dir+"/hsimpleProxy.C+");
24 }
virtual const char * WorkingDirectory()
Return working directory.
Definition: TSystem.cxx:869
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
Definition: TFile.h:47
Basic string class.
Definition: TString.h:131
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
Definition: TSystem.cxx:1004
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
Definition: TFile.cxx:3976
void GetObject(const char *namecycle, T *&ptr)
R__EXTERN TSystem * gSystem
Definition: TSystem.h:540
virtual void Draw(Option_t *opt)
Default Draw method for all objects.
Definition: TTree.h:357
Definition: file.py:1
A TTree object has a header with a name and a title.
Definition: TTree.h:70