hello people,
my research partner and i are constructing a program to analyse some data. there are a lot of histograms to compare to each other and we’ve decided on constructing a function to book, fill, and write histograms once a variable type has been passed by argument.
the idea is to avoid the necessity to hard-code histogram information - title, range, binning and axis labels. we’ve created a separate class containing arrays with set information to be passed to the “plots()” function. the problem is how to correctly assign histograms to their relevant variable.
below is a rough idea of what we’re trying to do:
bool cut1 = /* variable */ < /*some value*/;
if (cut1 == 1){
plots(/*variable*/)
}
.
.
.
plots(/*argument*/)
{
if (/*some requirement*/}
{
/*book plots*/
}
else if (/*some further requirement)
{
/*fill plots*/
}
else
{
/*write plots*/
}
we were wondering if there were any suggestions as to our problem; any insights would be very helpful. thanks for your time.