I am new to root. I am trying to write a macro which can call subroutines. Below is my attempt at doing this which does not work. I’ve written a macro as though it were a C program with a main routine and one subroutine. I’ve tried to execute in ROOT with “.x file.cxx” where file.cxx is the name of the file with this code in it. What magic mantra of commands do I need to do in order to get such a thing to work in ROOT? Thanks.
int_t ploth( *Tpad pad, *TH1F histo );
int_t main( void ) {
gROOT->Reset();
c1 = new TCanvas(“c1”,“canvas”,200,10,900,700);
pad1 = new TPad(“pad1”,“pad1”,0.02,0.70,0.24,0.88);
//Open root file which has histogram h11 in it
TFile example(“tsensor.root”);
// Draw histogram
ploth( pad1, h11 );
return 0;
}
int_t ploth( *Tpad pad, *TH1F histo ) {
pad->Draw();
histo->DrawCopy();
return 0;
}