Logo ROOT  
Reference Guide
No Matches
candledecay.C File Reference

Detailed Description

View in nbviewer Open in SWAN
Candle Decay, illustrate a time development of a certain value.

void candledecay()
auto c1 = new TCanvas("c1","Candle Decay",800,600);
auto rng = new TRandom();
auto h1 = new TH2I("h1","Decay",1000,0,1000,20,0,20);
float myRand;
for (int i = 0; i < 19; i++) {
for (int j = 0; j < 1000000; j++) {
myRand = rng->Gaus(350+i*8,20+2*i);
h1->GetXaxis()->SetTitle("probability density");
auto h2 = (TH2I*)h1->Clone("h2");
@ kGray
Definition Rtypes.h:65
@ kBlue
Definition Rtypes.h:66
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition TAttFill.h:37
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
Definition TAttFill.h:39
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition TAttLine.h:40
The Canvas class.
Definition TCanvas.h:23
TAxis * GetXaxis()
Definition TH1.h:324
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Definition TH1.cxx:3344
TAxis * GetYaxis()
Definition TH1.h:325
void Draw(Option_t *option="") override
Draw this histogram with options.
Definition TH1.cxx:3066
TObject * Clone(const char *newname="") const override
Make a complete copy of the underlying object.
Definition TH1.cxx:2752
virtual void SetBarWidth(Float_t width=0.5)
Set the width of bars as fraction of the bin width for drawing mode "B".
Definition TH1.h:365
2-D histogram with an int per channel (see TH1 documentation)
Definition TH2.h:225
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition TNamed.cxx:164
This is the base class for the ROOT Random number generators.
Definition TRandom.h:27
return c1
Definition legend1.C:41
TH1F * h1
Definition legend1.C:5
Georg Troska

Definition in file candledecay.C.