Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-07 04:34:57

0001 #ifndef CalibMuon_DTCalibration_DTVDriftSegmentCalibration_h
0002 #define CalibMuon_DTCalibration_DTVDriftSegmentCalibration_h
0003 
0004 /** \class DTVDriftSegmentCalibration
0005  *  Produces histograms from v-drift computation in
0006  *  segment fit to be used for v-drift calibration
0007  *
0008  *  \author A. Vilela Pereira
0009  */
0010 
0011 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0012 #include "FWCore/Utilities/interface/InputTag.h"
0013 #include "CalibMuon/DTCalibration/interface/DTSegmentSelector.h"
0014 #include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
0015 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0016 #include "Geometry/DTGeometry/interface/DTGeometry.h"
0017 
0018 #include <map>
0019 
0020 class DTChamberId;
0021 class TFile;
0022 class TH1F;
0023 class TH2F;
0024 
0025 class DTVDriftSegmentCalibration : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
0026 public:
0027   // Constructor
0028   DTVDriftSegmentCalibration(const edm::ParameterSet& pset);
0029   // Destructor
0030   ~DTVDriftSegmentCalibration() override;
0031 
0032   void beginJob() override;
0033   void beginRun(const edm::Run& run, const edm::EventSetup& setup) override;
0034   void analyze(const edm::Event& event, const edm::EventSetup& eventSetup) override;
0035   void endRun(const edm::Run& run, const edm::EventSetup& setup) override {}
0036   void endJob() override;
0037 
0038 private:
0039   typedef std::map<DTChamberId, std::vector<TH1F*> > ChamberHistosMapTH1F;
0040   typedef std::map<DTChamberId, std::vector<TH2F*> > ChamberHistosMapTH2F;
0041   void bookHistos(DTChamberId);
0042 
0043   DTSegmentSelector* select_;
0044 
0045   const edm::EDGetTokenT<DTRecSegment4DCollection> theRecHits4DToken_;
0046   //bool writeVDriftDB_;
0047   const std::string theCalibChamber_;
0048 
0049   TFile* rootFile_;
0050   ChamberHistosMapTH1F theVDriftHistoMapTH1F_;
0051   ChamberHistosMapTH2F theVDriftHistoMapTH2F_;
0052 
0053   const edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomToken_;
0054 };
0055 #endif