CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/CalibTracker/SiStripLorentzAngle/plugins/MeasureLA.h

Go to the documentation of this file.
00001 #ifndef CalibTracker_SiStripLorentzAngle_MeasureLA_h
00002 #define CalibTracker_SiStripLorentzAngle_MeasureLA_h
00003 
00004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00005 #include "FWCore/Framework/interface/ESProducer.h"
00006 
00007 #include "CondFormats/SiStripObjects/interface/SiStripLorentzAngle.h"
00008 #include "CondFormats/DataRecord/interface/SiStripLorentzAngleRcd.h"
00009 #include "CalibTracker/SiStripLorentzAngle/interface/LA_Filler_Fitter.h"
00010 #include "CalibTracker/SiStripCommon/interface/Book.h"
00011 
00012 namespace sistrip {
00013 
00014 class MeasureLA : public edm::ESProducer {
00015 
00016  public:
00017 
00018   explicit MeasureLA(const edm::ParameterSet&);
00019   boost::shared_ptr<SiStripLorentzAngle> produce(const SiStripLorentzAngleRcd&);
00020   
00021  private:
00022 
00023   enum GRANULARITY {LAYER=0, MODULE=1, MODULESUMMARY=2};
00024   static std::string granularity(int32_t g) { switch(g) {
00025     case LAYER: return "_layer"; 
00026     case MODULE: return "_module"; 
00027     case MODULESUMMARY: return "_moduleSummary";
00028   } return "";};
00029 
00030   void store_calibrations();
00031   void store_methods_and_granularity(const edm::VParameterSet&);
00032 
00033   void summarize_module_muH_byLayer();
00034   void process_reports() const;
00035   template<class T>
00036   void write_report_text(const std::string, const LA_Filler_Fitter::Method, const std::map<T,LA_Filler_Fitter::Result>) const;
00037   void write_report_text_ms(const std::string, const LA_Filler_Fitter::Method ) const;
00038   void write_report_plots(const std::string, const LA_Filler_Fitter::Method, const GRANULARITY) const;
00039 
00040   void calibrate(const std::pair<unsigned,LA_Filler_Fitter::Method>, LA_Filler_Fitter::Result&) const;
00041   static std::pair<unsigned,LA_Filler_Fitter::Method> calibration_key(const std::string layer, const LA_Filler_Fitter::Method);
00042   static std::pair<unsigned,LA_Filler_Fitter::Method> calibration_key(const uint32_t detid, const LA_Filler_Fitter::Method);
00043 
00044   const std::vector<std::string> inputFiles;
00045   const std::string inFileLocation;
00046   const edm::FileInPath fp_;
00047   const edm::VParameterSet reports, measurementPreferences, calibrations;
00048   std::map<std::pair<uint32_t,LA_Filler_Fitter::Method>,float> slope, offset, error_scaling;
00049   int32_t methods;
00050   bool byModule, byLayer;
00051   const float localybin;
00052   const unsigned stripsperbin,maxEvents;
00053   Book book;
00054 
00055 };
00056 
00057 }
00058 #endif