This is a basic histogram being created but my question in the line TH1F *hist=new TH1F("hist", "Histogram", 100, 0, 100); I know pointers help store an address to a object and constructors are helpful in inputting values to objects in a class but what is going in this line ? Is a pointer created and defined as a constructor ? and what is the use of the "new" ?
// Creating a histogram
void tut1()
// Void functions do not return values, simply prints a message so I assume our message here is the histogram, histograms display values but they are not themselves not values
{
TH1F *hist=new TH1F("hist", "Histogram", 100, 0, 100);
// This is just a constructor
// TH1F is a inherited class from the base class TH1
//(the name of the histogram, the title of the histograms, number of bins, start of x axis, and ending paramater of x axis)
// Here we are accessing TH1F the capital F is for floats and we use this to use 1D histograms
// To Fill the histogram we use
hist->Fill(10);
hist->Fill(40);
// Add titles for the axis's
hist->GetXaxis()-SetTitle("X Axis");
hist->GetYaxis()-SetTitle("Y Axis");
TCanvas *c1 = new TCanvas();
hist->Draw();
// Tcanvas is used to draw our plot it is the window that is used to display our image
}