CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/DQM/DTMonitorClient/src/DTLocalTriggerBaseTest.h

Go to the documentation of this file.
00001 #ifndef DTLocalTriggerBaseTest_H
00002 #define DTLocalTriggerBaseTest_H
00003 
00004 
00016 #include "FWCore/Framework/interface/Frameworkfwd.h"
00017 #include "FWCore/Framework/interface/EDAnalyzer.h"
00018 #include "DataFormats/Common/interface/Handle.h"
00019 #include "FWCore/Framework/interface/ESHandle.h"
00020 #include "FWCore/Framework/interface/Event.h"
00021 #include "FWCore/Framework/interface/MakerMacros.h"
00022 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00023 #include <FWCore/Framework/interface/LuminosityBlock.h>
00024 
00025 #include "DQMServices/Core/interface/DQMStore.h"
00026 #include "DQMServices/Core/interface/MonitorElement.h"
00027 #include "FWCore/ServiceRegistry/interface/Service.h"
00028 
00029 #include <boost/cstdint.hpp>
00030 #include <string>
00031 #include <map>
00032 
00033 class DTChamberId;
00034 class DTGeometry;
00035 class TH1F;
00036 class TH2F;
00037 class TH1D;
00038 
00039 class DTLocalTriggerBaseTest: public edm::EDAnalyzer{
00040 
00041 public:
00042 
00044   DTLocalTriggerBaseTest() {};
00045   
00047   virtual ~DTLocalTriggerBaseTest();
00048 
00049 protected:
00050 
00052   void beginJob();
00053 
00055   void beginRun(edm::Run const& run, edm::EventSetup const& context);
00056 
00058   void beginLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& context) ;
00059 
00061   void analyze(const edm::Event& e, const edm::EventSetup& c);
00062 
00064   void endLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& context);
00065 
00067   void endRun(edm::Run const& run, edm::EventSetup const& context);
00068 
00070   void endJob();
00071 
00073   virtual void runClientDiagnostic() = 0;
00074 
00076   void bookSectorHistos( int wheel, int sector, std::string hTag, std::string folder="" );
00077 
00079   void bookWheelHistos( int wheel, std::string hTag, std::string folder="" );
00080 
00082   void bookCmsHistos( std::string hTag, std::string folder="" , bool isGlb = false);
00083 
00085   std::pair<float,float> phiRange(const DTChamberId& id);
00086 
00088   template <class T>  T* getHisto(MonitorElement* me);
00089 
00091   void setConfig(const edm::ParameterSet& ps, std::string name);
00092 
00093 /*   /// Set labels to wheel plots (Phi) */
00094 /*   void setLabelPh(MonitorElement* me); */
00095 
00096 /*   /// Set labels to theta plots (Theta) */
00097 /*   void setLabelTh(MonitorElement* me);  */
00098 
00100   std::string fullName(std::string htype);
00101 
00103   std::string getMEName(std::string histoTag, std::string subfolder, const DTChamberId& chambid);
00104 
00106   std::string getMEName(std::string histoTag, std::string subfolder, int wh);
00107   
00109   inline std::string & topFolder(bool isDCC) { return isDCC ? baseFolderDCC : baseFolderDDU; } ;
00110   
00112   inline std::string category() { return "DTDQM|DTMonitorClient|" + testName + "Test"; } ;
00113   
00114 
00115 
00116   int nevents;
00117   unsigned int nLumiSegs;
00118   int prescaleFactor;
00119   int run;
00120   std::string testName;
00121   std::vector<std::string> trigSources;
00122   std::vector<std::string> hwSources;
00123 
00124   DQMStore* dbe;
00125   std::string sourceFolder;
00126   edm::ParameterSet parameters;
00127   bool runOnline;
00128   std::string baseFolderDCC;
00129   std::string baseFolderDDU;
00130   std::string trigSource;
00131   std::string hwSource;
00132   edm::ESHandle<DTGeometry> muonGeom;
00133   std::map<int,std::map<std::string,MonitorElement*> > secME;
00134   std::map<int,std::map<std::string,MonitorElement*> > whME;
00135   std::map<std::string,MonitorElement*> cmsME;
00136 
00137 };
00138 
00139 
00140 template <class T>
00141 T* DTLocalTriggerBaseTest::getHisto(MonitorElement* me) {
00142   return me ? dynamic_cast<T*>(me->getRootObject()) : 0;
00143 }
00144 
00145 #endif
00146 
00147