CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1TOccupancyClientHistogramService.h
Go to the documentation of this file.
1 #ifndef DQM_L1TMONITORCLIENT_L1TOCCUPANCYCLIENTHISTOGRAMSERVICE_H
2 #define DQM_L1TMONITORCLIENT_L1TOCCUPANCYCLIENTHISTOGRAMSERVICE_H
3 
11 
13 
14 #include <memory>
15 #include <iostream>
16 #include <fstream>
17 #include <string>
18 #include <map>
19 #include <TH1F.h>
20 #include <TH1D.h>
21 #include <TH2F.h>
22 
24 
25  public:
26 
28  L1TOccupancyClientHistogramService(const edm::ParameterSet& iParameters, DQMStore::IBooker &ibooker, bool iVerbose);
29 
30  //loads the histo of test into histos_
32 
33  //updates histo (i.e. calculates differential to previous LS and adds it to cumulatice histo)
34  void updateHistogramEndLS (DQMStore::IGetter &igetter, std::string test,std::string histo,int iLS);
35  void updateHistogramEndRun(std::string iHistName);
36 
37  //resets the cumulative histo (after performing the test in L1TOccupancyClient)
38  void resetHisto(std::string test);
39 
40  // Masks channels of histo in specific strip to perform L1TOccupancyClient::getAvrg()
41  int maskBins(std::string test, TH2F* histo, int strip, int axis);
42 
43  bool isMasked (std::string test, int x, int y); //checks if cells is masked
44  bool isStripMasked(std::string test, int binStrip, int axis); //checks if a whole strip is masked
45 
46  void setMaskedBins(std::string test, const std::vector<edm::ParameterSet>& mask); //set masked channels specified in python
47  std::vector<std::pair<int,int> > getMaskedBins(std::string test); //returns masked channels of test
48 
49  unsigned int getNBinsMasked (std::string test); // Get number of masked bins in test
50  unsigned int getNBinsHistogram(std::string test); // Get actual number of bins in test (i.e. nBins-nMaskedBins)
51  TH2F* getDifferentialHistogram(std::string test); // Get cumulative histogram
52  TH2F* getRebinnedHistogram(DQMStore::IGetter &igetter, std::string iHistName, std::string iHistLocation); // Get rebinned version of the hist
53 
54  std::vector<int> getLSCertification(std::string iHistName); // Get list of tested LS for test iHistName
55 
56  private:
57 
58  //DQMStore* mDBE; // storage service
59  bool mVerbose; // verbose mode
60  edm::ParameterSet mParameters; // Copy of the parameters
61 
62  // Maps
63  std::map<std::string,bool> mHistValid; // Map of valid histograms (i.e. that exist)
64  std::map<std::string,std::pair<TH2F*,TH2F*> > mHistograms; // The cumulative histograms
65  std::map<std::string,std::vector<std::pair<int,int> >* > mMaskedBins; // Marked Bins
66  std::map<std::string,TH2F*> mHistDiffMinus1; // Last already closed LS Block Histogram Diff
67  std::map<std::string,std::vector<int> > mLSListDiff; // LS list of current block
68  std::map<std::string,std::vector<int> > mLSListDiffMinus1; // LS list of block -1
69 
70 };
71 
72 #endif
std::map< std::string, std::vector< std::pair< int, int > > * > mMaskedBins
TH2F * loadHisto(DQMStore::IGetter &igetter, std::string test, std::string histo)
TH2F * getRebinnedHistogram(DQMStore::IGetter &igetter, std::string iHistName, std::string iHistLocation)
std::vector< int > getLSCertification(std::string iHistName)
std::vector< std::pair< int, int > > getMaskedBins(std::string test)
std::map< std::string, std::pair< TH2F *, TH2F * > > mHistograms
int maskBins(std::string test, TH2F *histo, int strip, int axis)
void setMaskedBins(std::string test, const std::vector< edm::ParameterSet > &mask)
bool isStripMasked(std::string test, int binStrip, int axis)
std::map< std::string, std::vector< int > > mLSListDiffMinus1
std::map< std::string, std::vector< int > > mLSListDiff
void updateHistogramEndLS(DQMStore::IGetter &igetter, std::string test, std::string histo, int iLS)
bool isMasked(std::string test, int x, int y)