|
|
Go to the documentation of this file.
6 #include <boost/lexical_cast.hpp>
15 for (
auto const&
p : vpset) {
16 methods |=
p.getParameter<int32_t>(
"Method");
24 inFileLocation(conf.getParameter<
std::
string>(
"InFileLocation")),
25 fp_(conf.getParameter<
edm::FileInPath>(
"SiStripDetInfo")),
27 measurementPreferences(conf.getParameter<
edm::
VParameterSet>(
"MeasurementPreferences")),
32 localybin(conf.getUntrackedParameter<double>(
"LocalYBin", 0.0)),
33 stripsperbin(conf.getUntrackedParameter<unsigned>(
"StripsPerBin", 0)),
34 maxEvents(conf.getUntrackedParameter<unsigned>(
"MaxEvents", 0)),
36 conf.getParameter<
edm::FileInPath>(
"TrackerParameters").
fullPath())) {
41 TChain*
const chain =
new TChain(
"la_data");
55 auto lorentzAngle = std::make_unique<SiStripLorentzAngle>();
75 label = std::regex_replace(
label, std::regex(
"layer"),
"");
77 const double mu_H = -
result.second.calMeasured.first /
result.second.field;
78 const double sigma_mu_H =
result.second.calMeasured.second /
result.second.field;
79 const double weight =
pow(1. / sigma_mu_H, 2);
84 if (it->second->GetEntries())
85 it->second->Fit(
"gaus",
"LLQ");
111 TFile widthsFile(
"widths.root",
"RECREATE");
120 TFile
file((
name +
".root").c_str(),
"RECREATE");
125 hist->second->Write();
132 const std::map<T, LA_Filler_Fitter::Result>& _results)
const {
134 std::map<T, LA_Filler_Fitter::Result>
results = _results;
147 const TF1*
const f = it->second->GetFunction(
"gaus");
149 file << it->first <<
"\t" <<
f->GetParameter(1) <<
"\t" <<
f->GetParError(1) <<
"\t" <<
f->GetParameter(2)
150 <<
"\t" <<
f->GetParError(2) << std::endl;
159 std::vector<double> slopes(
p.getParameter<std::vector<double> >(
"Slopes"));
160 assert(slopes.size() == 14);
161 std::vector<double>
offsets(
p.getParameter<std::vector<double> >(
"Offsets"));
163 std::vector<double> pulls(
p.getParameter<std::vector<double> >(
"Pulls"));
164 assert(pulls.size() == 14);
166 for (
unsigned i = 0;
i < 14;
i++) {
167 const std::pair<unsigned, LA_Filler_Fitter::Method>
key(
i,
method);
177 result.calMeasured = std::make_pair<float, float>(
184 std::regex
format(
".*(T[IO]B)_layer(\\d)([as]).*");
185 const bool isTIB =
"TIB" == std::regex_replace(
layer,
format,
"\\1");
186 const bool stereo =
"s" == std::regex_replace(
layer,
format,
"\\3");
187 const unsigned layerNum = boost::lexical_cast<unsigned>(std::regex_replace(
layer,
format,
"\\2"));
const std::vector< std::string > inputFiles
void summarize_module_muH_byLayer(const LA_Filler_Fitter &)
void store_calibrations()
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
boost::filter_iterator< match_name, book_t::const_iterator > const_iterator
std::vector< ParameterSet > VParameterSet
void process_reports() const
uint32_t tobStereo(const DetId &id) const
void calibrate(const std::pair< unsigned, LA_Filler_Fitter::Method >, LA_Filler_Fitter::Result &) const
MeasureLA(const edm::ParameterSet &)
std::map< std::pair< uint32_t, LA_Filler_Fitter::Method >, float > offset
std::string layerLabel(const SiStripDetId) const
const unsigned stripsperbin
static std::string method(Method m, bool fit=true)
iterator end(string_t re=".*")
const edm::VParameterSet reports
constexpr std::array< uint8_t, layerIndexSize > layer
uint32_t tibStereo(const DetId &id) const
void fill(double_t X, const char *name, uint_t NbinsX, double_t Xlow, double_t Xup, double_t W=1)
std::map< std::pair< uint32_t, LA_Filler_Fitter::Method >, float > slope
std::unique_ptr< SiStripLorentzAngle > produce(const SiStripLorentzAngleRcd &)
const std::string inFileLocation
const edm::VParameterSet measurementPreferences
static unsigned layer_index(bool TIB, bool stereo, unsigned layer)
static std::map< std::string, Result > layer_results(const Book &, const Method)
void write_report_text(const std::string, const LA_Filler_Fitter::Method &, const std::map< T, LA_Filler_Fitter::Result > &) const
static void fit(Book &book)
void write_report_plots(const std::string, const LA_Filler_Fitter::Method, const GRANULARITY) const
boost::filter_iterator< match_name, book_t::iterator > iterator
const edm::VParameterSet calibrations
iterator begin(string_t re=".*")
SubDetector subDetector() const
void write_report_text_ms(const std::string, const LA_Filler_Fitter::Method) const
static constexpr auto TIB
Power< A, B >::type pow(const A &a, const B &b)
std::map< std::pair< uint32_t, LA_Filler_Fitter::Method >, float > error_scaling
Detector identifier class for the strip tracker.
void store_methods_and_granularity(const edm::VParameterSet &)
static std::map< uint32_t, Result > module_results(const Book &, const Method)
void fill(TTree *, Book &) const
static std::string granularity(int32_t g)
std::pair< unsigned, LA_Filler_Fitter::Method > calibration_key(const std::string layer, const LA_Filler_Fitter::Method) const
TrackerTopology fromTrackerParametersXMLFile(const std::string &xmlFileName)
unsigned int tibLayer(const DetId &id) const