Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:41:56

0001 #ifndef DTNoiseTask_H
0002 #define DTNoiseTask_H
0003 
0004 /** \class DTNoiseTask
0005  *  No description available.
0006  *
0007  *  \authors G. Mila , G. Cerminara - INFN Torino
0008  */
0009 
0010 #include "DQMServices/Core/interface/DQMOneEDAnalyzer.h"
0011 
0012 #include "DQMServices/Core/interface/DQMStore.h"
0013 
0014 #include "DataFormats/MuonDetId/interface/DTChamberId.h"
0015 #include "DataFormats/MuonDetId/interface/DTSuperLayerId.h"
0016 #include "DataFormats/DTDigi/interface/DTDigi.h"
0017 #include "DataFormats/DTDigi/interface/DTDigiCollection.h"
0018 
0019 #include "CondFormats/DataRecord/interface/DTTtrigRcd.h"
0020 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0021 
0022 // RecHit
0023 #include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
0024 
0025 #include "FWCore/Framework/interface/ESHandle.h"
0026 #include "FWCore/Utilities/interface/InputTag.h"
0027 
0028 namespace edm {
0029   class ParameterSet;
0030   class EventSetup;
0031   class Event;
0032 }  // namespace edm
0033 
0034 class DTGeometry;
0035 class DTTtrig;
0036 
0037 //-class DTNoiseTask : public edm::EDAnalyzer {
0038 class DTNoiseTask : public DQMOneEDAnalyzer<edm::one::WatchLuminosityBlocks> {
0039 public:
0040   /// Constructor
0041   DTNoiseTask(const edm::ParameterSet& ps);
0042 
0043   /// Destructor
0044   ~DTNoiseTask() override;
0045 
0046   // Operations
0047   void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0048 
0049 protected:
0050   void dqmBeginRun(const edm::Run&, const edm::EventSetup&) override;
0051 
0052   void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& setup) final {}
0053   void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& setup) override;
0054 
0055   /// Analyze
0056   void analyze(const edm::Event& e, const edm::EventSetup& c) override;
0057 
0058 private:
0059   void bookHistos(DQMStore::IBooker&, DTChamberId chId);
0060   void bookHistos(DQMStore::IBooker&, DTSuperLayerId slId);
0061 
0062   // The label to retrieve the digis
0063   edm::EDGetTokenT<DTDigiCollection> dtDigiToken_;
0064   // counter of processed events
0065   int evtNumber;
0066   //switch for time boxes filling
0067   bool doTimeBoxHistos;
0068   // Lable of 4D segments in the event
0069   edm::EDGetTokenT<DTRecSegment4DCollection> recHits4DToken_;
0070   //switch for segment veto
0071   bool doSegmentVeto;
0072 
0073   edm::ESGetToken<DTGeometry, MuonGeometryRecord> muonGeomToken_;
0074   const DTGeometry* dtGeom;
0075   edm::ESGetToken<DTTtrig, DTTtrigRcd> tTrigMapToken_;
0076   const DTTtrig* tTrigMap;
0077 
0078   //tTrig map per Station
0079   std::map<DTChamberId, double> tTrigStMap;
0080 
0081   //the noise histos (Hz)
0082   std::map<DTChamberId, MonitorElement*> noiseHistos;
0083 
0084   //map for histo normalization
0085   std::map<DTChamberId, int> mapEvt;
0086 
0087   //the time boxes
0088   std::map<DTSuperLayerId, MonitorElement*> tbHistos;
0089 
0090   MonitorElement* nEventMonitor;
0091 
0092   // safe margin (ns) between ttrig and beginning of counting area
0093   double safeMargin;
0094 };
0095 #endif
0096 
0097 /* Local Variables: */
0098 /* show-trailing-whitespace: t */
0099 /* truncate-lines: t */
0100 /* End: */