39 TFile *hfile =
nullptr;
43 TString fullPath = dir+
"hsimple.root";
46 if (hfile)
return hfile;
51 if (hfile)
return hfile;
57 printf(
"you must run the script in a directory with write access\n");
61 hfile =
new TFile(
filename,
"RECREATE",
"Demo ROOT file with histograms");
64 TH1F *hpx =
new TH1F(
"hpx",
"This is the px distribution",100,-4,4);
68 hpxpy->SetDirectory(hfile);
69 TProfile *hprof =
new TProfile(
"hprof",
"Profile of pz versus px",100,-4,4,0,20);
74 const bool doBenchmark =
false;
82 c1->GetFrame()->SetFillColor(21);
83 c1->GetFrame()->SetBorderSize(6);
84 c1->GetFrame()->SetBorderMode(-1);
91 for (
Int_t i = 0; i < 25000; i++) {
98 ntuple->Fill(px,py,pz,rnd,i);
int Int_t
Signed integer 4 bytes (int).
float Float_t
Float 4 bytes (float).
externTBenchmark * gBenchmark
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Int_t Write(const char *name=nullptr, Int_t opt=0, Int_t bufsize=0) override
Write this object to the current directory.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
void Close(Option_t *option="") override
Delete all objects from memory and directory structure itself.
1-D histogram with a float per channel (see TH1 documentation)
virtual void SetDirectory(TDirectory *dir)
void Draw(Option_t *option="") override
Default Draw method for all objects.
virtual Int_t Fill(Double_t x)
2-D histogram with a float per channel (see TH1 documentation)
A simple TTree restricted to a list of float variables only.
Int_t Fill(const Double_t *v)
Random number generator class based on M.
Double_t Rndm() override
Machine independent random number generator.
virtual void Rannor(Float_t &a, Float_t &b)
Return 2 numbers distributed following a gaussian with mean=0 and sigma=1.
TString & ReplaceAll(const TString &s1, const TString &s2)