CMS 3D CMS Logo

DTResidualCalibration.h
Go to the documentation of this file.
1 #ifndef CalibMuon_DTCalibration_DTResidualCalibration_h
2 #define CalibMuon_DTCalibration_DTResidualCalibration_h
3 
14 
18 
19 #include <string>
20 #include <vector>
21 #include <map>
22 
23 class TFile;
24 class TH1F;
25 class TH2F;
26 class DTGeometry;
27 class DTSuperLayerId;
28 class DTLayerId;
29 
30 class DTResidualCalibration : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
31 public:
35  ~DTResidualCalibration() override;
36 
37  void beginJob() override;
38  void beginRun(const edm::Run&, const edm::EventSetup&) override;
39  void endJob() override;
40  void endRun(const edm::Run&, const edm::EventSetup&) override{};
41  void analyze(const edm::Event& event, const edm::EventSetup& setup) override;
42 
43 protected:
44 private:
45  unsigned int nevent;
46  unsigned int segmok, segmbad;
47 
48  float segmentToWireDistance(const DTRecHit1D& recHit1D, const DTRecSegment4D& segment);
49  // Book a set of histograms for a given super-layer/layer
50  void bookHistos(DTSuperLayerId slId);
51  void bookHistos(DTLayerId slId);
52  // Fill a set of histograms for a given super-layer/layer
53  void fillHistos(DTSuperLayerId slId, float distance, float residualOnDistance);
54  void fillHistos(DTLayerId slId, float distance, float residualOnDistance);
55 
57  const double histRange_;
60 
61  const bool detailedAnalysis_;
62  TFile* rootFile_;
63  // Geometry
66 
67  // Histograms per super-layer
68  std::map<DTSuperLayerId, TH1F*> histoMapTH1F_;
69  std::map<DTSuperLayerId, TH2F*> histoMapTH2F_;
70  // Histograms per layer
71  std::map<DTLayerId, TH1F*> histoMapPerLayerTH1F_;
72  std::map<DTLayerId, TH2F*> histoMapPerLayerTH2F_;
73 };
74 #endif
void endRun(const edm::Run &, const edm::EventSetup &) override
std::map< DTSuperLayerId, TH1F * > histoMapTH1F_
std::map< DTLayerId, TH2F * > histoMapPerLayerTH2F_
DTSegmentSelector * select_
void fillHistos(DTSuperLayerId slId, float distance, float residualOnDistance)
void bookHistos(DTSuperLayerId slId)
DTResidualCalibration(const edm::ParameterSet &pset)
Constructor.
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken_
void beginRun(const edm::Run &, const edm::EventSetup &) override
const std::string rootBaseDir_
~DTResidualCalibration() override
Destructor.
std::map< DTSuperLayerId, TH2F * > histoMapTH2F_
void analyze(const edm::Event &event, const edm::EventSetup &setup) override
const DTGeometry * dtGeom_
const edm::EDGetTokenT< DTRecSegment4DCollection > segment4DToken_
float segmentToWireDistance(const DTRecHit1D &recHit1D, const DTRecSegment4D &segment)
std::map< DTLayerId, TH1F * > histoMapPerLayerTH1F_
Definition: event.py:1
Definition: Run.h:45