Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DTResolutionAnalysisTest_H
0002 #define DTResolutionAnalysisTest_H
0003 
0004 /** \class DTResolutionAnalysisTest
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 "DQMServices/Core/interface/DQMStore.h"
0017 #include "FWCore/Framework/interface/LuminosityBlock.h"
0018 
0019 #include "FWCore/Framework/interface/ESHandle.h"
0020 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0021 #include "DQMServices/Core/interface/DQMEDHarvester.h"
0022 
0023 #include <string>
0024 #include <map>
0025 
0026 class DTGeometry;
0027 class DTSuperLayerId;
0028 
0029 class DTResolutionAnalysisTest : public DQMEDHarvester {
0030 public:
0031   /// Constructor
0032   DTResolutionAnalysisTest(const edm::ParameterSet& ps);
0033 
0034   /// Destructor
0035   ~DTResolutionAnalysisTest() override;
0036 
0037   /// BeginRun
0038   void beginRun(const edm::Run& r, const edm::EventSetup& c) override;
0039 
0040   void bookHistos(DQMStore::IBooker&);
0041   void bookHistos(DQMStore::IBooker&, int wh);
0042   void bookHistos(DQMStore::IBooker&, int wh, int sect);
0043 
0044   /// Get the ME name
0045   std::string getMEName(const DTSuperLayerId& slID);
0046 
0047 protected:
0048   void dqmEndJob(DQMStore::IBooker&, DQMStore::IGetter&) override;
0049 
0050 private:
0051   void resetMEs();
0052 
0053   int nevents;
0054   unsigned int nLumiSegs;
0055   int prescaleFactor;
0056   int run;
0057   int percentual;
0058 
0059   // permitted test ranges
0060   double maxGoodMeanValue;
0061   double minBadMeanValue;
0062   double maxGoodSigmaValue;
0063   double minBadSigmaValue;
0064 
0065   bool doCalibAnalysis;
0066 
0067   edm::ESGetToken<DTGeometry, MuonGeometryRecord> muonGeomToken_;
0068   const DTGeometry* muonGeom;
0069 
0070   // Histograms for tests
0071   std::map<std::pair<int, int>, MonitorElement*> MeanHistos;
0072   std::map<std::pair<int, int>, MonitorElement*> SigmaHistos;
0073   // wheel summary histograms
0074   std::map<int, MonitorElement*> wheelMeanHistos;
0075   std::map<int, MonitorElement*> wheelSigmaHistos;
0076 
0077   std::map<int, MonitorElement*> meanDistr;
0078   std::map<int, MonitorElement*> sigmaDistr;
0079 
0080   // wheel and ring mean histograms
0081   std::map<int, std::map<int, std::map<std::string, MonitorElement*> > > wheelRingHistos;
0082 
0083   // Compute the station from the bin number of mean and sigma histos
0084   int stationFromBin(int bin) const;
0085   // Compute the sl from the bin number of mean and sigma histos
0086   int slFromBin(int bin) const;
0087 
0088   double meanInRange(double mean) const;
0089   double sigmaInRange(double sigma) const;
0090 
0091   MonitorElement* globalResSummary;
0092 
0093   // top folder for the histograms in DQMStore
0094   std::string topHistoFolder;
0095 };
0096 
0097 #endif