|
|
Go to the documentation of this file.
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");
35 laff.
fill(chain, book);
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;
std::map< std::string, MethodCalibrations > calibrations
static std::pair< std::pair< float, float >, std::pair< float, float > > offset_slope(const std::vector< EnsembleSummary > &)
boost::filter_iterator< match_name, book_t::const_iterator > const_iterator
EnsembleCalibrationLA(const edm::ParameterSet &)
void write_calibrations() const
void write_ensembles_text(const Book &)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
void write_ensembles_plots(const Book &) const
void summarize_ensembles(Book &) const
void endRun(const edm::Run &, const edm::EventSetup &) override
iterator end(string_t re=".*")
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< int > vMethods
static unsigned layer_index(bool TIB, bool stereo, unsigned layer)
void write_samples_plots(const Book &) const
static void fit(Book &book)
static float pull(const std::vector< EnsembleSummary > &)
bool getData(T &iHolder) const
iterator begin(string_t re=".*")
static std::map< std::string, std::vector< EnsembleSummary > > ensemble_summary(const Book &)
const std::string inFileLocation
const std::vector< std::string > inputFiles
void fill(TTree *, Book &) const
const TrackerTopology * tTopo_