Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-05-20 22:34:15

0001 #ifndef DTnoiseDBValidation_H
0002 #define DTnoiseDBValidation_H
0003 
0004 /** \class DTnoiseDBValidation
0005  *  Plot the noise from the DB comparaison
0006  *
0007  *  \author G. Mila - INFN Torino
0008  */
0009 
0010 #include "DQMServices/Core/interface/DQMStore.h"
0011 #include "FWCore/Framework/interface/EDAnalyzer.h"
0012 #include "FWCore/Framework/interface/ESHandle.h"
0013 #include "FWCore/Framework/interface/Frameworkfwd.h"
0014 #include "FWCore/Framework/interface/MakerMacros.h"
0015 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0016 #include "FWCore/ServiceRegistry/interface/Service.h"
0017 #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h"
0018 #include "CondFormats/DataRecord/interface/DTStatusFlagRcd.h"
0019 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0020 
0021 #include <map>
0022 #include <string>
0023 #include <vector>
0024 
0025 class DTGeometry;
0026 class DTChamberId;
0027 class DTStatusFlag;
0028 class TFile;
0029 
0030 class DTnoiseDBValidation : public edm::EDAnalyzer {
0031 public:
0032   typedef dqm::legacy::MonitorElement MonitorElement;
0033   typedef dqm::legacy::DQMStore DQMStore;
0034   /// Constructor
0035   DTnoiseDBValidation(const edm::ParameterSet &pset);
0036 
0037   /// Destructor
0038   ~DTnoiseDBValidation() override;
0039 
0040   /// Operations
0041   void beginRun(const edm::Run &run, const edm::EventSetup &setup) override;
0042   void endRun(edm::Run const &, edm::EventSetup const &) override;
0043   void endJob() override;
0044   void analyze(const edm::Event &event, const edm::EventSetup &setup) override {}
0045 
0046 protected:
0047 private:
0048   void bookHisto(const DTChamberId &);
0049 
0050   DQMStore *dbe_;
0051   // The DB label
0052   edm::ESGetToken<DTStatusFlag, DTStatusFlagRcd> labelDBRef_;
0053   edm::ESGetToken<DTStatusFlag, DTStatusFlagRcd> labelDB_;
0054   const DTStatusFlag *noiseRefMap;
0055   const DTStatusFlag *noiseMap;
0056   std::string diffTestName_, wheelTestName_, stationTestName_, sectorTestName_, layerTestName_;
0057 
0058   bool outputMEsInRootFile_;
0059   std::string outputFileName_;
0060 
0061   // The DTGeometry
0062   edm::ESGetToken<DTGeometry, MuonGeometryRecord> muonGeomToken_;
0063   const DTGeometry *dtGeom;
0064 
0065   // The noise map
0066   const DTStatusFlag *noiseMap_;
0067   const DTStatusFlag *noiseRefMap_;
0068 
0069   // the total number of noisy cell
0070   int noisyCellsRef_;
0071   int noisyCellsValid_;
0072   // the histos
0073   MonitorElement *diffHisto_;
0074   MonitorElement *wheelHisto_;
0075   MonitorElement *stationHisto_;
0076   MonitorElement *sectorHisto_;
0077   MonitorElement *layerHisto_;
0078   std::map<DTChamberId, MonitorElement *> noiseHistoMap_;
0079 };
0080 #endif