Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-23 22:52:46

0001 #ifndef CalibTracker_SiStripLorentzAngle_EnsembleCalibrationLA_h
0002 #define CalibTracker_SiStripLorentzAngle_EnsembleCalibrationLA_h
0003 
0004 #include "FWCore/Framework/interface/Frameworkfwd.h"
0005 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0006 #include "CalibTracker/SiStripLorentzAngle/interface/LA_Filler_Fitter.h"
0007 #include "Geometry/Records/interface/TrackerTopologyRcd.h"
0008 
0009 namespace sistrip {
0010   class EnsembleCalibrationLA : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
0011   public:
0012     explicit EnsembleCalibrationLA(const edm::ParameterSet&);
0013     void analyze(const edm::Event&, const edm::EventSetup&) override {}
0014     void beginRun(const edm::Run&, const edm::EventSetup&) override;
0015     void endRun(const edm::Run&, const edm::EventSetup&) override;
0016     void endJob() override;
0017 
0018     ~EnsembleCalibrationLA() override;
0019 
0020   private:
0021     void write_ensembles_text(const Book&);
0022     void write_ensembles_plots(const Book&) const;
0023     void write_samples_plots(const Book&) const;
0024     void write_calibrations() const;
0025 
0026     const std::vector<std::string> inputFiles;
0027     const std::string inFileLocation, Prefix;
0028     const unsigned maxEvents, samples, nbins;
0029     const double lowBin, highBin;
0030     std::vector<int> vMethods;
0031 
0032     struct MethodCalibrations {
0033       MethodCalibrations()
0034           : slopes(std::vector<float>(14, 0)), offsets(std::vector<float>(14, 10)), pulls(std::vector<float>(14, 0)) {}
0035       std::vector<float> slopes;
0036       std::vector<float> offsets;
0037       std::vector<float> pulls;
0038     };
0039     std::map<std::string, MethodCalibrations> calibrations;
0040 
0041     edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopoToken_;
0042     const TrackerTopology* tTopo_;
0043   };
0044 }  // namespace sistrip
0045 #endif