Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:07:09

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/LuminosityBlock.h"
0022 
0023 #include "DQMServices/Core/interface/DQMStore.h"
0024 #include "FWCore/ServiceRegistry/interface/Service.h"
0025 #include "DQMServices/Core/interface/DQMOneEDAnalyzer.h"
0026 
0027 #include <string>
0028 #include <map>
0029 #include <vector>
0030 
0031 class DTGeometry;
0032 
0033 class DTEfficiencyTask : public DQMOneEDAnalyzer<edm::one::WatchLuminosityBlocks> {
0034 public:
0035   /// Constructor
0036   DTEfficiencyTask(const edm::ParameterSet& pset);
0037 
0038   /// Destructor
0039   ~DTEfficiencyTask() override;
0040 
0041   /// To reset the MEs
0042   void beginLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& context) override;
0043   void endLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& context) final {}
0044 
0045   // Operations
0046   void analyze(const edm::Event& event, const edm::EventSetup& setup) override;
0047 
0048 protected:
0049   /// BeginRun
0050   void dqmBeginRun(const edm::Run&, const edm::EventSetup&) override;
0051 
0052   // Book the histograms
0053   void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0054 
0055 private:
0056   edm::ESGetToken<DTGeometry, MuonGeometryRecord> muonGeomToken_;
0057   const DTGeometry* muonGeom;
0058   edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomToken_;
0059   const DTGeometry* dtGeom;
0060 
0061   // Switch for verbosity
0062   bool debug;
0063 
0064   // Lable of 4D segments in the event
0065   edm::EDGetTokenT<DTRecSegment4DCollection> recHits4DToken_;
0066 
0067   // Lable of 1D rechits in the event
0068   edm::EDGetTokenT<DTRecHitCollection> recHitToken_;
0069 
0070   edm::ParameterSet parameters;
0071 
0072   // Fill a set of histograms for a given L
0073   void fillHistos(DTLayerId lId, int firstWire, int lastWire, int numWire);
0074   void fillHistos(DTLayerId lId, int firstWire, int lastWire, int missingWire, bool UnassHit);
0075 
0076   std::map<DTLayerId, std::vector<MonitorElement*> > histosPerL;
0077 };
0078 #endif
0079 
0080 /* Local Variables: */
0081 /* show-trailing-whitespace: t */
0082 /* truncate-lines: t */
0083 /* End: */