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