CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/DQM/DTMonitorClient/src/DTOccupancyTest.h

Go to the documentation of this file.
00001 #ifndef DTOccupancyTest_H
00002 #define DTOccupancyTest_H
00003 
00004 
00016 #include "FWCore/Framework/interface/Frameworkfwd.h"
00017 #include <FWCore/Framework/interface/EDAnalyzer.h>
00018 #include <FWCore/Framework/interface/ESHandle.h>
00019 #include "DQMServices/Core/interface/MonitorElement.h"
00020 #include <DataFormats/MuonDetId/interface/DTLayerId.h>
00021 
00022 #include "TH2F.h"
00023 
00024 #include <iostream>
00025 #include <string>
00026 #include <map>
00027 
00028 class DTGeometry;
00029 class DTChamberId;
00030 class DQMStore;
00031 
00032 #include "TFile.h"
00033 #include "TNtuple.h"
00034 
00035 class DTOccupancyTest: public edm::EDAnalyzer{
00036 
00037 public:
00038 
00040   DTOccupancyTest(const edm::ParameterSet& ps);
00041   
00043   virtual ~DTOccupancyTest();
00044 
00045 protected:
00046 
00048   void beginJob();
00049 
00051   void beginRun(edm::Run const& run, edm::EventSetup const& context) ;
00052 
00054   void endJob();
00055   
00056   void beginLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& context) ;
00057 
00059   void endLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& context);
00060 
00061 
00063   void analyze(const edm::Event& event, const edm::EventSetup& context);
00064 
00065 private:
00066 
00068   void bookHistos(const int wheelId, std::string folder, std::string histoTag);
00069 
00071   std::string getMEName(std::string histoTag, const DTChamberId& chId);
00072 
00073   // Run the test on the occupancy histos
00074   int runOccupancyTest(TH2F *histo, const DTChamberId& chId, float& chamberPercentage);
00075 
00076   std::string topFolder() const;
00077 
00078   int nevents;
00079 
00080   DQMStore* dbe;
00081 
00082   edm::ESHandle<DTGeometry> muonGeom;
00083 
00084   // wheel summary histograms  
00085   std::map< int, MonitorElement* > wheelHistos;  
00086   MonitorElement* summaryHisto;
00087   MonitorElement* glbSummaryHisto;
00088 
00089   std::set<DTLayerId> monitoredLayers;
00090 
00091   int lsCounter;
00092   int nMinEvts;
00093 
00094   bool writeRootFile;
00095   TFile *rootFile;
00096   TNtuple *ntuple;
00097   bool tpMode;
00098 
00099   bool runOnAllHitsOccupancies;
00100   bool runOnNoiseOccupancies;
00101   bool runOnInTimeOccupancies;
00102   std::string nameMonitoredHisto;
00103 
00104 };
00105 
00106 #endif