Skip to content
Snippets Groups Projects
Commit 929daa55 authored by Stephen A. Wood's avatar Stephen A. Wood
Browse files

Allow %d in report formats.

  If ThcAnalyzer::PrintReport sees a format descriptor with 'd' at
  the end, then the value is converted to the nearest int before formatting.
parent 6a95020d
No related branches found
No related tags found
No related merge requests found
......@@ -33,8 +33,8 @@ Hit in chamber: {hdc_cham_hits[0]/hdc_tot_events:%.3f} {hdc_cham_hits[1]/hdc_tot
Hit in plane: {hdc_hits_per_plane[0]/hdc_tot_events:%.3f} {hdc_hits_per_plane[1]/hdc_tot_events:%.3f} {hdc_hits_per_plane[2]/hdc_tot_events:%.3f} {hdc_hits_per_plane[3]/hdc_tot_events:%.3f} {hdc_hits_per_plane[4]/hdc_tot_events:%.3f} {hdc_hits_per_plane[5]/hdc_tot_events:%.3f} {hdc_hits_per_plane[6]/hdc_tot_events:%.3f} {hdc_hits_per_plane[7]/hdc_tot_events:%.3f} {hdc_hits_per_plane[8]/hdc_tot_events:%.3f} {hdc_hits_per_plane[9]/hdc_tot_events:%.3f} {hdc_hits_per_plane[10]/hdc_tot_events:%.3f} {hdc_hits_per_plane[11]/hdc_tot_events:%.3f}
Run #{gen_run_number}
first event = {gen_run_starting_event}
last event = {gen_event_id_number}
first event = {gen_run_starting_event:%7d}
last event = {gen_event_id_number:%7d}
Later, such things as hardware scalers will be added to the set of variables
that can be used in expressions.
......
......@@ -119,7 +119,11 @@ void THcAnalyzer::PrintReport(const char* templatefile, const char* ofile)
format = "%f";
}
}
replacement=Form(format.c_str(),value);
if(format[format.length()-1] == 'd') {
replacement=Form(format.c_str(),TMath::Nint(value));
} else {
replacement=Form(format.c_str(),value);
}
}
// cout << "Replacement:" << replacement << endl;
line.replace(start,end-start+1,replacement);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment