CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_4/src/DQM/L1TMonitorClient/interface/L1TOccupancyClientHistogramService.h

Go to the documentation of this file.
00001 #ifndef DQM_L1TMONITORCLIENT_L1TOCCUPANCYCLIENTHISTOGRAMSERVICE_H
00002 #define DQM_L1TMONITORCLIENT_L1TOCCUPANCYCLIENTHISTOGRAMSERVICE_H
00003 
00004 #include "FWCore/Framework/interface/Frameworkfwd.h"
00005 #include "FWCore/Framework/interface/Event.h"
00006 #include "FWCore/Framework/interface/MakerMacros.h"
00007 #include <FWCore/Framework/interface/EDAnalyzer.h>
00008 #include "DQMServices/Core/interface/DQMStore.h"
00009 #include "DQMServices/Core/interface/MonitorElement.h"
00010 #include "FWCore/Framework/interface/LuminosityBlock.h"
00011 
00012 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00013 
00014 #include <memory>
00015 #include <iostream>
00016 #include <fstream>
00017 #include <string>
00018 #include <map>
00019 #include <TH1F.h>
00020 #include <TH1D.h>
00021 #include <TH2F.h>
00022 
00023 class L1TOccupancyClientHistogramService {
00024 
00025   public:
00026   
00027     L1TOccupancyClientHistogramService(); 
00028     L1TOccupancyClientHistogramService(edm::ParameterSet iParameters, DQMStore* iDBE, bool iVerbose);
00029   
00030     //loads the histo of test into histos_
00031     TH2F* loadHisto  (std::string test,std::string histo); 
00032 
00033     //updates histo (i.e. calculates differential to previous LS and adds it to cumulatice histo)
00034     void updateHistogramEndLS (std::string test,std::string histo,int iLS); 
00035     void updateHistogramEndRun(std::string iHistName);
00036     
00037     //resets the cumulative histo (after performing the test in L1TOccupancyClient)
00038     void  resetHisto(std::string test);  
00039 
00040     // Masks channels of histo in specific strip to perform L1TOccupancyClient::getAvrg()
00041     int  maskBins(std::string test, TH2F* histo, int strip, int axis);  
00042 
00043     bool isMasked     (std::string test, int x, int y);           //checks if cells is masked
00044     bool isStripMasked(std::string test, int binStrip, int axis); //checks if a whole strip is masked
00045 
00046     void setMaskedBins(std::string test, std::vector<edm::ParameterSet> mask); //set masked channels specified in python
00047     std::vector<std::pair<int,int> > getMaskedBins(std::string test);          //returns masked channels of test
00048 
00049     unsigned int  getNBinsMasked   (std::string test);        // Get number of masked bins in test
00050     unsigned int  getNBinsHistogram(std::string test);        // Get actual number of bins in test (i.e. nBins-nMaskedBins)
00051     TH2F* getDifferentialHistogram(std::string test); // Get cumulative histogram
00052     TH2F* getRebinnedHistogram(std::string iHistName, std::string iHistLocation); // Get rebinned version of the hist
00053 
00054     std::vector<int> getLSCertification(std::string iHistName); // Get list of tested LS for test iHistName
00055     
00056   private:
00057 
00058     DQMStore*         mDBE;        // storage service
00059     bool              mVerbose;    // verbose mode
00060     edm::ParameterSet mParameters; // Copy of the parameters
00061 
00062     // Maps
00063     std::map<std::string,bool>                               mHistValid;        // Map of valid histograms (i.e. that exist)
00064     std::map<std::string,std::pair<TH2F*,TH2F*> >            mHistograms;       // The cumulative histograms
00065     std::map<std::string,std::vector<std::pair<int,int> >* > mMaskedBins;       // Marked Bins
00066     std::map<std::string,TH2F*>                              mHistDiffMinus1;   // Last already closed LS Block Histogram Diff
00067     std::map<std::string,std::vector<int> >                  mLSListDiff;       // LS list of current block
00068     std::map<std::string,std::vector<int> >                  mLSListDiffMinus1; // LS list of block -1
00069 
00070 };
00071 
00072 #endif