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