6 #include <boost/lexical_cast.hpp>
14 inFileLocation(conf.getParameter<
std::
string>(
"InFileLocation")),
16 maxEvents(conf.getUntrackedParameter<unsigned>(
"MaxEvents", 0)),
17 samples(conf.getParameter<unsigned>(
"Samples")),
18 nbins(conf.getParameter<unsigned>(
"NBins")),
19 lowBin(conf.getParameter<double>(
"LowBin")),
20 highBin(conf.getParameter<double>(
"HighBin")),
21 vMethods(conf.getParameter<
std::
vector<
int> >(
"Methods")),
25 Book book(
"la_ensemble");
26 TChain*
const chain =
new TChain(
"la_ensemble");
52 for (
auto const&
summary : ensemble.second)
55 const std::pair<std::pair<float, float>, std::pair<float, float> >
line =
63 std::regex
format(
".*(T[IO]B)_layer(\\d)([as])_(.*)");
64 if (std::regex_match(ensemble.first,
format)) {
65 const bool TIB =
"TIB" == std::regex_replace(ensemble.first,
format,
"\\1");
66 const bool stereo =
"s" == std::regex_replace(ensemble.first,
format,
"\\3");
67 const unsigned layer = boost::lexical_cast<unsigned>(std::regex_replace(ensemble.first,
format,
"\\2"));
68 label = std::regex_replace(ensemble.first,
format,
"\\4");
79 <<
"# Best Fit Line: " <<
line.first.first <<
"(" <<
line.first.second <<
") + x* " <<
line.second.first
80 <<
"(" <<
line.second.second <<
")" << std::endl
81 <<
"# Pull (average sigma of (x_measure-x_truth)/e_measure): " << pull << std::endl
82 <<
"LA_Calibration( METHOD_XXXXX , xxx, " <<
line.second.first <<
", " <<
line.first.first <<
", " << pull
89 TFile
file((
Prefix +
"sampleFits.root").c_str(),
"RECREATE");
93 hist->second->Write();
98 TFile
file((
Prefix +
"ensembleFits.root").c_str(),
"RECREATE");
100 hist->second->Write();
107 file << cal.first << std::endl <<
"\t slopes(";
108 for (
float i : cal.second.slopes)
110 file <<
")" << std::endl <<
"\t offsets(";
111 for (
float i : cal.second.offsets)
113 file <<
")" << std::endl <<
"\t pulls(";
114 for (
float i : cal.second.pulls)
116 file <<
")" << std::endl;