21int main(
int argc,
char *argv[]) {
24 throw std::runtime_error(
25 Form(
"File: %s, Line: %d\nT0Fit::main() - Usage: %s <input file> <output file>!", __FILE__, __LINE__, argv[0]));
28 TROOT wurscht(
"wurscht",
"wurscht");
29 TFile infile(argv[1]);
30 TDirectory *dir = &infile;
31 TFile outfile(argv[2],
"RECREATE");
36 throw std::runtime_error(
37 Form(
"File: %s, Line: %d\nT0Fit::main() - Cannot find TDirectory 'MT_t0_fitter' in file %s!", __FILE__, __LINE__, argv[1]));
40 TIter nextkey(dir->GetListOfKeys());
43 while ((key = (TKey *)nextkey())) {
44 TObject *obj = key->ReadObj();
45 if (obj->IsA()->InheritsFrom(
"TH1F")) {
46 TH1F *hist =
dynamic_cast<TH1F *
>(obj);
47 if (hist == NULL)
continue;
48 string hname = hist->GetName();
49 if (hname ==
"t_spec_Summary")
continue;
50 hist->GetListOfFunctions()->Clear();
52 fitter.SetTSpec(n, hist, &settings);
54 if (fitter.FitT0()) { fitter.FitTmax(); }