Change the loop variables to more accurately describe what they're doing
Don't create a directory for each module. (Makes it easier to produce trend plots later)
Don't create a directory for each module and also have the histograms defined as TH1Fs. (Makes it easier for producing trend plots)
Create a trend plot for each histogram that's been written to file. NB the axis ranges still need to be changed and the starting run number and number of runs shouldn't need to be hard-coded