Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:44:00

0001 #ifndef DTt0DBValidation_H
0002 #define DTt0DBValidation_H
0003 
0004 /** \class DTt0DBValidation
0005  *  Plot the t0 from the DB
0006  *
0007  *  \author G. Mila - INFN Torino
0008  */
0009 
0010 #include "DQMServices/Core/interface/DQMStore.h"
0011 #include "FWCore/Framework/interface/one/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 
0019 #include "DataFormats/MuonDetId/interface/DTLayerId.h"
0020 #include "DataFormats/MuonDetId/interface/DTWireId.h"
0021 #include "Geometry/DTGeometry/interface/DTGeometry.h"
0022 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0023 #include "CondFormats/DataRecord/interface/DTT0Rcd.h"
0024 
0025 #include <fstream>
0026 #include <string>
0027 #include <vector>
0028 
0029 class DTT0;
0030 class TFile;
0031 
0032 class DTt0DBValidation : public edm::one::EDAnalyzer<edm::one::SharedResources, edm::one::WatchRuns> {
0033 public:
0034   typedef dqm::legacy::MonitorElement MonitorElement;
0035   typedef dqm::legacy::DQMStore DQMStore;
0036   /// Constructor
0037   DTt0DBValidation(const edm::ParameterSet &pset);
0038 
0039   /// Destructor
0040   ~DTt0DBValidation() override;
0041 
0042   /// Operations
0043   // Read the DTGeometry and the t0 DB
0044   void beginRun(const edm::Run &run, const edm::EventSetup &setup) override;
0045   void endRun(edm::Run const &, edm::EventSetup const &) override;
0046   void endJob() override;
0047   void analyze(const edm::Event &event, const edm::EventSetup &setup) override {}
0048 
0049 private:
0050   void bookHistos(DTLayerId lId, int firstWire, int lastWire);
0051   void bookHistos(int wheel);
0052 
0053   DQMStore *dbe_;
0054   // Switch for verbosity
0055   std::string metname_;
0056   // The DB label
0057   edm::ESGetToken<DTT0, DTT0Rcd> labelDBRef_;
0058   edm::ESGetToken<DTT0, DTT0Rcd> labelDB_;
0059 
0060   // The file which will contain the difference plot
0061   bool outputMEsInRootFile_;
0062   std::string outputFileName_;
0063 
0064   std::string t0TestName_;
0065 
0066   // The DTGeometry
0067   edm::ESGetToken<DTGeometry, MuonGeometryRecord> muonGeomToken_;
0068   const DTGeometry *dtGeom;
0069 
0070   // The t0 map
0071   const DTT0 *tZeroRefMap_;
0072   const DTT0 *tZeroMap_;
0073 
0074   // Map of the t0 and sigma per wire
0075   std::map<DTWireId, std::vector<float>> t0RefMap_;
0076   std::map<DTWireId, std::vector<float>> t0Map_;
0077 
0078   // Map of the t0 difference histos per layer
0079   std::map<DTLayerId, MonitorElement *> t0DiffHistos_;
0080 
0081   // Summary histos
0082   std::map<int, MonitorElement *> wheelSummary_;
0083 };
0084 #endif