Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DTMonitorClient_DTRunConditionVarClient_H
0002 #define DTMonitorClient_DTRunConditionVarClient_H
0003 
0004 /** \class DTRunConditionVarClient
0005  *
0006  * Description:
0007  *  
0008  *
0009  * \author : Paolo Bellan, Antonio Branca
0010  * $date   : 23/09/2011 15:42:04 CET $
0011  *
0012  * Modification:
0013  *
0014  *  threadsafe version (//-) oct/nov 2014 - WATWanAbdullah -ncpp-um-my
0015  *
0016  *
0017  */
0018 
0019 #include "FWCore/Framework/interface/Frameworkfwd.h"
0020 #include "DataFormats/Common/interface/Handle.h"
0021 #include "FWCore/Framework/interface/ESHandle.h"
0022 #include "FWCore/Framework/interface/Event.h"
0023 #include "FWCore/Framework/interface/MakerMacros.h"
0024 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0025 #include "FWCore/Framework/interface/LuminosityBlock.h"
0026 
0027 #include "CondFormats/DTObjects/interface/DTMtime.h"
0028 #include "CondFormats/DataRecord/interface/DTMtimeRcd.h"
0029 #include "CondFormats/DTObjects/interface/DTRecoConditions.h"
0030 #include "CondFormats/DataRecord/interface/DTRecoConditionsVdriftRcd.h"
0031 
0032 #include "DQMServices/Core/interface/DQMStore.h"
0033 #include "FWCore/ServiceRegistry/interface/Service.h"
0034 
0035 #include "DQMServices/Core/interface/DQMEDHarvester.h"
0036 
0037 #include <memory>
0038 #include <iostream>
0039 #include <fstream>
0040 #include <string>
0041 #include <vector>
0042 #include <map>
0043 
0044 class DTGeometry;
0045 class DTChamberId;
0046 class DTLayerId;
0047 class DTMtime;
0048 class DTRecoConditions;
0049 
0050 class DTRunConditionVarClient : public DQMEDHarvester {
0051 public:
0052   /// Constructor
0053   DTRunConditionVarClient(const edm::ParameterSet& ps);
0054 
0055   /// Destructor
0056   ~DTRunConditionVarClient() override;
0057 
0058   void beginRun(const edm::Run& r, const edm::EventSetup& c) override;
0059 
0060 protected:
0061   void dqmEndJob(DQMStore::IBooker&, DQMStore::IGetter&) override;
0062 
0063   /// book the report summary
0064 
0065   void bookWheelHistos(DQMStore::IBooker&,
0066                        std::string histoType,
0067                        std::string subfolder,
0068                        int wh,
0069                        int nbins,
0070                        float min,
0071                        float max,
0072                        bool isVDCorr = false,
0073                        bool makeRings = false);
0074 
0075   /// DQM Client Diagnostic
0076   void dqmEndLuminosityBlock(DQMStore::IBooker&,
0077                              DQMStore::IGetter&,
0078                              edm::LuminosityBlock const&,
0079                              edm::EventSetup const&) override;
0080 
0081   float varQuality(float var, float maxGood, float minBad);
0082   void percDevVDrift(DTChamberId indexCh, float meanVD, float sigmaVD, float& devVD, float& errdevVD);
0083 
0084 private:
0085   MonitorElement* getChamberHistos(DQMStore::IGetter&, const DTChamberId&, std::string);
0086 
0087   int nevents;
0088 
0089   float minRangeVDrift;
0090   float maxRangeVDrift;
0091   float minRangeT0;
0092   float maxRangeT0;
0093 
0094   float maxGoodVDriftDev;
0095   float minBadVDriftDev;
0096   float maxGoodT0;
0097   float minBadT0;
0098 
0099   float maxGoodVDriftSigma;
0100   float minBadVDriftSigma;
0101   float maxGoodT0Sigma;
0102   float minBadT0Sigma;
0103 
0104   edm::ESGetToken<DTMtime, DTMtimeRcd> mTimeMapToken_;
0105   const DTMtime* mTimeMap_;  // legacy DB object
0106 
0107   edm::ESGetToken<DTRecoConditions, DTRecoConditionsVdriftRcd> vDriftToken_;
0108   const DTRecoConditions* vDriftMap_;  // DB object in new format
0109   bool readLegacyVDriftDB;             // which one to use
0110 
0111   bool bookingdone;
0112 
0113   MonitorElement* glbVDriftSummary;
0114   MonitorElement* glbT0Summary;
0115 
0116   std::map<int, std::map<std::string, MonitorElement*> > wheelHistos;
0117   std::map<int, std::map<int, std::map<std::string, MonitorElement*> > > wheelRingHistos;
0118   std::map<std::string, MonitorElement*> summaryHistos;
0119   std::map<std::string, MonitorElement*> allwheelHistos;
0120 };
0121 
0122 #endif