6 #include <boost/lexical_cast.hpp> 15 for(
auto const&
p : vpset) {
16 methods |=
p.getParameter<int32_t>(
"Method");
17 byModule = byModule ||
p.getParameter<int32_t>(
"Granularity");
18 byLayer = byLayer || !
p.getParameter<int32_t>(
"Granularity");
25 fp_(conf.getParameter<
edm::FileInPath>(
"SiStripDetInfo") ),
30 localybin(conf.getUntrackedParameter<double>(
"LocalYBin",0.0)),
31 stripsperbin(conf.getUntrackedParameter<unsigned>(
"StripsPerBin",0)),
32 maxEvents( conf.getUntrackedParameter<unsigned>(
"MaxEvents",0)),
39 TChain*
const chain =
new TChain(
"la_data");
54 auto lorentzAngle = std::make_unique<SiStripLorentzAngle>();
78 label = boost::regex_replace(label,boost::regex(
"layer"),
"");
80 const double mu_H = -
result.second.calMeasured.first /
result.second.field;
81 const double sigma_mu_H =
result.second.calMeasured.second /
result.second.field;
82 const double weight =
pow(1./sigma_mu_H, 2);
84 book.
fill(mu_H, label, 150,-0.05,0.1, weight);
87 if(it->second->GetEntries()) it->second->Fit(
"gaus",
"LLQ");
107 { TFile widthsFile(
"widths.root",
"RECREATE");
114 TFile
file((name+
".root").c_str(),
"RECREATE");
117 if(
hist->second)
hist->second->Write();
125 std::map<T,LA_Filler_Fitter::Result>
results = _results;
127 for(
auto&
result : results) {
129 file <<
result.first <<
"\t" <<
result.second << std::endl;
139 const TF1*
const f = it->second->GetFunction(
"gaus");
141 file << it->first <<
"\t" 142 << f->GetParameter(1) <<
"\t" 143 << f->GetParError(1) <<
"\t" 144 << f->GetParameter(2) <<
"\t" 145 << f->GetParError(2) << std::endl;
155 std::vector<double> slopes(
p.getParameter<std::vector<double> >(
"Slopes")); assert(slopes.size()==14);
156 std::vector<double> offsets(
p.getParameter<std::vector<double> >(
"Offsets")); assert(offsets.size()==14);
157 std::vector<double> pulls(
p.getParameter<std::vector<double> >(
"Pulls")); assert(pulls.size()==14);
159 for(
unsigned i=0;
i<14;
i++) {
160 const std::pair<unsigned,LA_Filler_Fitter::Method>
key(
i, method);
175 std::pair<uint32_t,LA_Filler_Fitter::Method>
MeasureLA:: 177 boost::regex
format(
".*(T[IO]B)_layer(\\d)([as]).*");
178 const bool isTIB =
"TIB" == boost::regex_replace(layer, format,
"\\1");
179 const bool stereo =
"s" == boost::regex_replace(layer, format,
"\\3");
180 const unsigned layerNum = boost::lexical_cast<
unsigned>(boost::regex_replace(layer, format,
"\\2"));
184 std::pair<uint32_t,LA_Filler_Fitter::Method>
MeasureLA:: auto setWhatProduced(T *iThis, const es::Label &iLabel={})
const edm::FileInPath fp_
std::string layerLabel(const SiStripDetId) const
static std::map< std::string, Result > layer_results(const Book &, const Method)
void calibrate(const std::pair< unsigned, LA_Filler_Fitter::Method >, LA_Filler_Fitter::Result &) const
void summarize_module_muH_byLayer(const LA_Filler_Fitter &)
static unsigned layer_index(bool TIB, bool stereo, unsigned layer)
static void fit(Book &book)
unsigned int tibLayer(const DetId &id) const
const unsigned stripsperbin
const edm::VParameterSet measurementPreferences
std::vector< ParameterSet > VParameterSet
const std::vector< std::string > inputFiles
uint32_t tobStereo(const DetId &id) const
void process_reports() const
std::map< std::pair< uint32_t, LA_Filler_Fitter::Method >, float > slope
static std::string granularity(int32_t g)
void fill(TTree *, Book &) const
std::pair< float, float > measured
void store_methods_and_granularity(const edm::VParameterSet &)
const edm::VParameterSet calibrations
MeasureLA(const edm::ParameterSet &)
const edm::VParameterSet reports
iterator begin(string_t re=".*")
format
Some error handling for the usage.
const std::string inFileLocation
static std::string method(Method m, bool fit=true)
std::unique_ptr< SiStripLorentzAngle > produce(const SiStripLorentzAngleRcd &)
Detector identifier class for the strip tracker.
SubDetector subDetector() const
void write_report_text_ms(const std::string, const LA_Filler_Fitter::Method) const
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 > offset
void write_report_plots(const std::string, const LA_Filler_Fitter::Method, const GRANULARITY) const
boost::filter_iterator< match_name, book_t::const_iterator > const_iterator
void write_report_text(const std::string, const LA_Filler_Fitter::Method &, const std::map< T, LA_Filler_Fitter::Result > &) const
std::map< std::pair< uint32_t, LA_Filler_Fitter::Method >, float > error_scaling
TrackerTopology fromTrackerParametersXMLFile(const std::string &xmlFileName)
std::pair< float, float > calMeasured
uint32_t tibStereo(const DetId &id) const
boost::filter_iterator< match_name, book_t::iterator > iterator
Power< A, B >::type pow(const A &a, const B &b)
std::pair< unsigned, LA_Filler_Fitter::Method > calibration_key(const std::string layer, const LA_Filler_Fitter::Method) const
iterator end(string_t re=".*")