30void timeResSplitCases(TString config_file_name =
"") {
31 if (config_file_name !=
"") {
32 g_config_file_name = config_file_name;
35 TEnv
env(g_config_file_name);
37 g_input_file_path =
env.GetValue(
"input_file_path_TTI",
"default");
38 g_output_plot_path =
env.GetValue(
"output_plot_path",
"default");
39 dataset_name =
env.GetValue(
"dataset_name",
"default");
40 g_dataset_description =
env.GetValue(
"dataset_description",
"My Sample");
41 print_png =
env.GetValue(
"print_png",
false);
42 do_zoom =
env.GetValue(
"do_zoom",
false);
43 g_use_log_scale =
env.GetValue(
"use_log_scale",
false);
44 work_status =
env.GetValue(
"work_status",
"default");
45 g_time_acc_tool =
env.GetValue(
47 "HGTD_TrkTimePerformanceStudies.ExpertTrackTimeFromClusters/");
48 g_track_selection_tool =
env.GetValue(
49 "track_selection_tool",
50 "HGTD_TrkTimePerformanceStudies.AllTracksSelection/");
52 TFile*
file = TFile::Open(g_input_file_path,
"READ");
53 if (
file ==
nullptr ||
file->IsZombie()) {
54 std::cout <<
"could not open input file " << g_input_file_path << std::endl;
66 std::vector<Color_t>
colors = {
67 kTeal + 4, kTeal + 2, kTeal, kTeal - 9, kMagenta, kRed, kRed, kRed, kRed};
69 std::vector<TH1F *>
hists;
70 std::cout << g_track_selection_tool + g_time_acc_tool << std::endl;
72 for (
const TString& primes_fraction : primes_fractions) {
73 TString plotname =
"m_hist_timeres_outlier_cases" + primes_fraction;
74 auto hist = (
TH1F*)
file->Get(g_track_selection_tool + g_time_acc_tool +
76 if (hist ==
nullptr) {
77 std::cout <<
"could not find " << plotname << std::endl;
80 hists.push_back(hist);
84 new TH1F(
"overall_hist",
";t_{reco} - t_{truth} [ns]; number of tracks",
86 for (
const auto &
h : hists) {
91 new THStack(
"stack_hist",
";t_{reco} - t_{truth} [ns]; Number of Tracks");
93 for (
size_t i = 0;
i <
hists.size();
i++) {
95 hists.at(i)->SetLineWidth(0.);
96 stack_hist->Add(
hists.at(i));
99 stack_hist->SetMaximum(stack_hist->GetMaximum() * 1.7);
102 stack_hist->SetMaximum(100);
105 TCanvas *
c =
new TCanvas();
107 if (g_use_log_scale) {
112 "axishist",
";t_{reco} - t_{truth} [ns]; Number of Tracks", 10, -0.4, 0.4);
114 if (g_use_log_scale) {
115 hist->SetAxisRange(1, 1.e8,
"Y");
117 hist->SetAxisRange(0, 0.08,
"Y");
122 stack_hist->Draw(
"hist same");
124 overall_hist->SetMarkerColor(kBlack);
125 overall_hist->SetLineWidth(0);
126 overall_hist->SetMarkerStyle(20);
127 overall_hist->SetMarkerSize(0);
134 Color_t text_color = kBlack;
135 atlas::ATLAS_LABEL(0.19, 0.88, text_color);
136 atlas::myText(0.31, 0.88, text_color, work_status);
138 float label_text_size = 0.05;
140 atlas::myText(0.19, 0.83, text_color, g_dataset_description.Data(), label_text_size);
141 atlas::myText(0.19, 0.77, text_color,
"Timing scenario \"Initial\"",
145 auto legend =
new TLegend(0.62, 0.65, 0.9, 0.92);
149 legend->SetTextSize(0.035);
151 for (
size_t i = 0;
i <
labels.size();
i++) {
158 Form(
"%s/%s_%s.pdf", g_output_plot_path.Data(),
159 dataset_name.ReplaceAll(
" ",
"").ReplaceAll(
",",
"_").Data(),
161 if (g_use_log_scale) {
162 plot_name.ReplaceAll(
".pdf",
"LogScale.pdf");
166 c->Print(plot_name.ReplaceAll(
".pdf",
".png"));
168 plot_name.ReplaceAll(
".png",
".C");
173int main(
int argc,
char* argv[]) {
175 std::cout <<
"Syntax: " <<
argv[0] <<
" <config file>" << std::endl;
178 timeResSplitCases(argv[1]);
Define macros for attributes used to control the static checker.
#define ATLAS_NO_CHECK_FILE_THREAD_SAFETY
Header file for AthHistogramAlgorithm.
TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration.