Let’s do overloaded functions first...
- you always need 4 parameters
- the parameters have to be of the right type
- hfill(10,x) meant “hfill(10,x,0,1.)”
- hfill(10,x,y) meant “hfill(10,x,0,y)” for one-dim histograms
- hfill(10,x,y) meant “hfill(10,x,y,1.)” for two-dim histograms
but since there is only one “hfill” function, you cannot do that in Fortran or C.
TH1F *h1 = new TH1F(”Name",”Title",128,0.,400.);
TH2F *h2 = new TH2F(”Name",”Title",16,0.,40.,16,0.,40.);
In C++, you can! These are ROOT TH1F and TH2F histogram, with overloaded fill methods