Logo ROOT  
Reference Guide
hsimpleProxyDriver.C File Reference

Detailed Description

View in nbviewer Open in SWAN This is the driver of the hsimpleProxy example It provides the infrastructure to run that code on an ntuple To be run from the tutorials directory

void hsimpleProxyDriver()
{
std::cout << gSystem->WorkingDirectory() << std::endl;
TFile *file = TFile::Open("hsimple.root");
if (!file){
std::cerr << "Input file not found.\n";
return ;
}
TTree *ntuple = nullptr;
file->GetObject("ntuple",ntuple);
std::string s1(__FILE__);
TString dir = gSystem->UnixPathName(s1.substr(0, s1.find_last_of("\\/")).c_str());
ntuple->Draw(dir+"/hsimpleProxy.C+");
}
Author
Rene Brun

Definition in file hsimpleProxyDriver.C.

TTree
Definition: TTree.h:79
TFile::Open
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
Definition: TFile.cxx:3946
TString
Definition: TString.h:136
TSystem::WorkingDirectory
virtual const char * WorkingDirectory()
Return working directory.
Definition: TSystem.cxx:870
s1
#define s1(x)
Definition: RSha256.hxx:109
TTree::Draw
virtual void Draw(Option_t *opt)
Default Draw method for all objects.
Definition: TTree.h:427
TFile
Definition: TFile.h:54
gSystem
R__EXTERN TSystem * gSystem
Definition: TSystem.h:559
TSystem::UnixPathName
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
Definition: TSystem.cxx:1061
file
Definition: file.py:1