11void hist047_Graphics_candle_decay()
15 auto *hist =
new TH2I(
"hist",
"Decay; probability density; time", 1000, 0, 1000, 20, 0, 20);
18 for (
int iBin = 0; iBin < 19; iBin++) {
19 for (
int j = 0; j < 1000000; j++) {
22 float myRand = rand.
Gaus(350 + iBin * 8, 20 + 2 * iBin);
23 hist->Fill(myRand, iBin);
27 hist->SetFillStyle(0);
28 hist->SetFillColor(
kGray);
29 hist->SetLineColor(
kBlue);
31 auto *can =
new TCanvas(
"can",
"Candle Decay", 800, 600);
35 hist->Draw(
"violiny(112000000)");
37 auto *hist2 =
static_cast<TH2I *
>(hist->Clone(
"hist2"));
46 hist2->DrawCopy(
"candley2");
virtual void SetBarWidth(Float_t width=0.5)
Set the width of bars as fraction of the bin width for drawing mode "B".
2-D histogram with an int per channel (see TH1 documentation)
This is the base class for the ROOT Random number generators.
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...