35 TString fullPath = dir+
"hsimple.root";
38 if (hfile)
return hfile;
43 if (hfile)
return hfile;
49 printf(
"you must run the script in a directory with write access\n");
53 hfile =
new TFile(filename,
"RECREATE",
"Demo ROOT file with histograms");
56 TH1F *
hpx =
new TH1F(
"hpx",
"This is the px distribution",100,-4,4);
76 for (
Int_t i = 0; i < 25000; i++) {
83 ntuple->
Fill(px,py,pz,rnd,i);
84 if (i && (i%kUPDATE) == 0) {
85 if (i == kUPDATE) hpx->
Draw();
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
virtual void Rannor(Float_t &a, Float_t &b)
Return 2 numbers distributed following a gaussian with mean=0 and sigma=1.
Random number generator class based on M.
virtual void SetBorderMode(Short_t bordermode)
TString & ReplaceAll(const TString &s1, const TString &s2)
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
static const char * filename()
virtual void Show(const char *name)
Stops Benchmark name and Prints results.
1-D histogram with a float per channel (see TH1 documentation)}
virtual const char * UnixPathName(const char *unixpathname)
Convert from a Unix pathname to a local pathname.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
virtual void Start(const char *name)
Starts Benchmark with the specified name.
TFrame * GetFrame()
Get frame.
virtual Double_t Rndm(Int_t i=0)
Machine independent random number generator.
virtual void SetBorderSize(Short_t bordersize)
A simple TTree restricted to a list of float variables only.
R__EXTERN TSystem * gSystem
virtual void Draw(Option_t *option="")
Draw this histogram with options.
virtual void SetFillColor(Color_t fcolor)
virtual Int_t Write(const char *name=0, Int_t opt=0, Int_t bufsiz=0)
Write memory objects to this file.
R__EXTERN TBenchmark * gBenchmark
2-D histogram with a float per channel (see TH1 documentation)}
Int_t Fill(const Double_t *v)
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
virtual Int_t Fill()
[fNvar] Array of variables
TFile * hsimple(Int_t get=0)
virtual void Update()
Update canvas pad buffers.
Int_t Fill(Double_t)
Invalid Fill method.
void Modified(Bool_t flag=1)
virtual void Close(Option_t *option="")
Close a file.