Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-31 23:13:56

0001 #ifndef DTResolutionTest_H
0002 #define DTResolutionTest_H
0003 
0004 /** \class DTResolutionTest
0005  * *
0006  *  DQM Test Client
0007  *
0008  *  \author  G. Mila - INFN Torino
0009  *
0010  *  threadsafe version (//-) oct/nov 2014 - WATWanAbdullah -ncpp-um-my
0011  *
0012  *   
0013  */
0014 
0015 #include "FWCore/Framework/interface/Frameworkfwd.h"
0016 #include "DataFormats/Common/interface/Handle.h"
0017 #include "FWCore/Framework/interface/ESHandle.h"
0018 #include "FWCore/Framework/interface/Event.h"
0019 #include "FWCore/Framework/interface/MakerMacros.h"
0020 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0021 #include "FWCore/Framework/interface/LuminosityBlock.h"
0022 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0023 
0024 #include "DQMServices/Core/interface/DQMStore.h"
0025 #include "FWCore/ServiceRegistry/interface/Service.h"
0026 
0027 #include "DQMServices/Core/interface/DQMEDHarvester.h"
0028 
0029 #include <memory>
0030 #include <iostream>
0031 #include <fstream>
0032 #include <string>
0033 #include <vector>
0034 #include <map>
0035 
0036 class DTGeometry;
0037 class DTChamberId;
0038 class DTSuperLayerId;
0039 
0040 class DTResolutionTest : public DQMEDHarvester {
0041 public:
0042   /// Constructor
0043   DTResolutionTest(const edm::ParameterSet& ps);
0044 
0045   /// Destructor
0046   ~DTResolutionTest() override;
0047 
0048 protected:
0049   /// Endjob
0050   void dqmEndJob(DQMStore::IBooker&, DQMStore::IGetter&) override;
0051 
0052   /// book the new ME
0053   void bookHistos(DQMStore::IBooker&, const DTChamberId& ch);
0054 
0055   /// book the summary histograms
0056   void bookHistos(DQMStore::IBooker&, int wh);
0057 
0058   /// Get the ME name
0059   std::string getMEName(const DTSuperLayerId& slID);
0060   std::string getMEName2D(const DTSuperLayerId& slID);
0061 
0062   /// DQM Client Diagnostic
0063   void dqmEndLuminosityBlock(DQMStore::IBooker&,
0064                              DQMStore::IGetter&,
0065                              edm::LuminosityBlock const&,
0066                              edm::EventSetup const&) override;
0067 
0068 private:
0069   int nevents;
0070   unsigned int nLumiSegs;
0071   int prescaleFactor;
0072   int run;
0073   int percentual;
0074 
0075   bool bookingdone;
0076 
0077   edm::ParameterSet parameters;
0078   edm::ESGetToken<DTGeometry, MuonGeometryRecord> muonGeomToken_;
0079   const DTGeometry* muonGeom;
0080 
0081   // histograms: < detRawID, Histogram >
0082   std::map<std::pair<int, int>, MonitorElement*> MeanHistos;
0083   std::map<std::pair<int, int>, MonitorElement*> SigmaHistos;
0084   std::map<std::pair<int, int>, MonitorElement*> SlopeHistos;
0085   std::map<std::string, MonitorElement*> MeanHistosSetRange;
0086   std::map<std::string, MonitorElement*> SigmaHistosSetRange;
0087   std::map<std::string, MonitorElement*> SlopeHistosSetRange;
0088   std::map<std::string, MonitorElement*> MeanHistosSetRange2D;
0089   std::map<std::string, MonitorElement*> SigmaHistosSetRange2D;
0090   std::map<std::string, MonitorElement*> SlopeHistosSetRange2D;
0091 
0092   // wheel summary histograms
0093   std::map<int, MonitorElement*> wheelMeanHistos;
0094   std::map<int, MonitorElement*> wheelSigmaHistos;
0095   std::map<int, MonitorElement*> wheelSlopeHistos;
0096 
0097   // cms summary histograms
0098   std::map<std::pair<int, int>, int> cmsMeanHistos;
0099   std::map<std::pair<int, int>, bool> MeanFilled;
0100   std::map<std::pair<int, int>, int> cmsSigmaHistos;
0101   std::map<std::pair<int, int>, bool> SigmaFilled;
0102   std::map<std::pair<int, int>, int> cmsSlopeHistos;
0103   std::map<std::pair<int, int>, bool> SlopeFilled;
0104 
0105   // Compute the station from the bin number of mean and sigma histos
0106   int stationFromBin(int bin) const;
0107   // Compute the sl from the bin number of mean and sigma histos
0108   int slFromBin(int bin) const;
0109 };
0110 
0111 #endif