Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-05-21 22:39:42

0001 #ifndef DTEfficiencyTask_H
0002 #define DTEfficiencyTask_H
0003 
0004 /** \class DTEfficiencyTask
0005  *  DQM Analysis of 4D DT segments, it produces plots about: <br>
0006  *      - single cell efficiency
0007  *  All histos are produced per Layer
0008  *
0009  *
0010  *  \author G. Mila - INFN Torino
0011  */
0012 
0013 #include "FWCore/Framework/interface/Frameworkfwd.h"
0014 #include "DataFormats/Common/interface/Handle.h"
0015 #include "FWCore/Framework/interface/ESHandle.h"
0016 #include "DataFormats/MuonDetId/interface/DTLayerId.h"
0017 #include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
0018 #include "DataFormats/DTRecHit/interface/DTRecHitCollection.h"
0019 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0020 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0021 #include "FWCore/Framework/interface/EDAnalyzer.h"
0022 #include "FWCore/Framework/interface/LuminosityBlock.h"
0023 
0024 #include "DQMServices/Core/interface/DQMStore.h"
0025 #include "FWCore/ServiceRegistry/interface/Service.h"
0026 #include "DQMServices/Core/interface/DQMOneEDAnalyzer.h"
0027 
0028 #include <string>
0029 #include <map>
0030 #include <vector>
0031 
0032 class DTGeometry;
0033 
0034 class DTEfficiencyTask : public DQMOneEDAnalyzer<edm::one::WatchLuminosityBlocks> {
0035 public:
0036   /// Constructor
0037   DTEfficiencyTask(const edm::ParameterSet& pset);
0038 
0039   /// Destructor
0040   ~DTEfficiencyTask() override;
0041 
0042   /// To reset the MEs
0043   void beginLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& context) override;
0044   void endLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& context) final {}
0045 
0046   // Operations
0047   void analyze(const edm::Event& event, const edm::EventSetup& setup) override;
0048 
0049 protected:
0050   /// BeginRun
0051   void dqmBeginRun(const edm::Run&, const edm::EventSetup&) override;
0052 
0053   // Book the histograms
0054   void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0055 
0056 private:
0057   edm::ESGetToken<DTGeometry, MuonGeometryRecord> muonGeomToken_;
0058   const DTGeometry* muonGeom;
0059   edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomToken_;
0060   const DTGeometry* dtGeom;
0061 
0062   // Switch for verbosity
0063   bool debug;
0064 
0065   // Lable of 4D segments in the event
0066   edm::EDGetTokenT<DTRecSegment4DCollection> recHits4DToken_;
0067 
0068   // Lable of 1D rechits in the event
0069   edm::EDGetTokenT<DTRecHitCollection> recHitToken_;
0070 
0071   edm::ParameterSet parameters;
0072 
0073   // Fill a set of histograms for a given L
0074   void fillHistos(DTLayerId lId, int firstWire, int lastWire, int numWire);
0075   void fillHistos(DTLayerId lId, int firstWire, int lastWire, int missingWire, bool UnassHit);
0076 
0077   std::map<DTLayerId, std::vector<MonitorElement*> > histosPerL;
0078 };
0079 #endif
0080 
0081 /* Local Variables: */
0082 /* show-trailing-whitespace: t */
0083 /* truncate-lines: t */
0084 /* End: */