4 #include <boost/lexical_cast.hpp>
20 inputFiles( conf.getParameter<std::vector<std::string> >(
"InputFiles") ),
21 inFileLocation( conf.getParameter<std::string>(
"InFileLocation")),
22 fp_(conf.getParameter<edm::
FileInPath>(
"SiStripDetInfo") ),
24 measurementPreferences( conf.getParameter<edm::
VParameterSet>(
"MeasurementPreferences")),
25 calibrations(conf.getParameter<edm::
VParameterSet>(
"Calibrations")),
27 localybin(conf.getUntrackedParameter<double>(
"LocalYBin",0.0)),
28 stripsperbin(conf.getUntrackedParameter<unsigned>(
"StripsPerBin",0)),
29 maxEvents( conf.getUntrackedParameter<unsigned>(
"MaxEvents",0))
35 TChain*
const chain =
new TChain(
"la_data");
67 std::pair<uint32_t,LA_Filler_Fitter::Result>
result;
72 label = boost::regex_replace(label,boost::regex(
"layer"),
"");
74 const double mu_H = -result.second.calMeasured.first / result.second.field;
75 const double sigma_mu_H = result.second.calMeasured.second / result.second.field;
76 const double weight =
pow(1./sigma_mu_H, 2);
78 book.
fill(mu_H, label, 150,-0.05,0.1, weight);
81 if(it->second->GetEntries()) it->second->Fit(
"gaus",
"LLQ");
101 { TFile widthsFile(
"widths.root",
"RECREATE");
108 TFile
file((name+
".root").c_str(),
"RECREATE");
111 if(
hist->second)
hist->second->Write();
119 std::pair<T,LA_Filler_Fitter::Result>
result;
120 BOOST_FOREACH(result, results) {
122 file << result.first <<
"\t" << result.second << std::endl;
132 const TF1*
const f = it->second->GetFunction(
"gaus");
134 file << it->first <<
"\t"
135 << f->GetParameter(1) <<
"\t"
136 << f->GetParError(1) <<
"\t"
137 << f->GetParameter(2) <<
"\t"
138 << f->GetParError(2) << std::endl;
148 std::vector<double> slopes(p.
getParameter<std::vector<double> >(
"Slopes")); assert(slopes.size()==14);
149 std::vector<double> offsets(p.
getParameter<std::vector<double> >(
"Offsets")); assert(offsets.size()==14);
150 std::vector<double> pulls(p.
getParameter<std::vector<double> >(
"Pulls")); assert(pulls.size()==14);
152 for(
unsigned i=0;
i<14;
i++) {
153 const std::pair<unsigned,LA_Filler_Fitter::Method>
key(
i, method);
168 std::pair<uint32_t,LA_Filler_Fitter::Method>
MeasureLA::
170 boost::regex
format(
".*(T[IO]B)_layer(\\d)([as]).*");
171 const bool TIB =
"TIB" == boost::regex_replace(layer, format,
"\\1");
172 const bool stereo =
"s" == boost::regex_replace(layer, format,
"\\3");
173 const unsigned layerNum = boost::lexical_cast<
unsigned>(boost::regex_replace(layer, format,
"\\2"));
177 std::pair<uint32_t,LA_Filler_Fitter::Method>
MeasureLA::
T getParameter(std::string const &) const
static std::pair< unsigned, LA_Filler_Fitter::Method > calibration_key(const std::string layer, const LA_Filler_Fitter::Method)
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
tuple SiStripLorentzAngle
static unsigned layer_index(bool TIB, bool stereo, unsigned layer)
static void fit(Book &book)
unsigned int layer() const
layer id
const unsigned stripsperbin
const edm::VParameterSet measurementPreferences
std::vector< ParameterSet > VParameterSet
const std::vector< std::string > inputFiles
void process_reports() const
std::map< std::pair< uint32_t, LA_Filler_Fitter::Method >, float > slope
string format
Some error handling for the usage.
static std::string granularity(int32_t g)
void write_report_text(const std::string, const LA_Filler_Fitter::Method, const std::map< T, LA_Filler_Fitter::Result >) const
void fill(TTree *, Book &) const
std::pair< float, float > measured
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
void store_methods_and_granularity(const edm::VParameterSet &)
static std::string layerLabel(const SiStripDetId)
const edm::VParameterSet calibrations
MeasureLA(const edm::ParameterSet &)
const edm::VParameterSet reports
iterator begin(string_t re=".*")
const std::string inFileLocation
static std::string method(Method m, bool fit=true)
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 summarize_module_muH_byLayer()
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)
boost::shared_ptr< SiStripLorentzAngle > produce(const SiStripLorentzAngleRcd &)
std::map< std::pair< uint32_t, LA_Filler_Fitter::Method >, float > offset
unsigned int layer() const
layer id
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
std::map< std::pair< uint32_t, LA_Filler_Fitter::Method >, float > error_scaling
std::pair< float, float > calMeasured
boost::filter_iterator< match_name, book_t::iterator > iterator
Power< A, B >::type pow(const A &a, const B &b)
iterator end(string_t re=".*")