CMS 3D CMS Logo

L1TOccupancyClientHistogramService.h
Go to the documentation of this file.
1 #ifndef DQM_L1TMONITORCLIENT_L1TOCCUPANCYCLIENTHISTOGRAMSERVICE_H
2 #define DQM_L1TMONITORCLIENT_L1TOCCUPANCYCLIENTHISTOGRAMSERVICE_H
3 
9 
11 
12 #include <memory>
13 #include <iostream>
14 #include <fstream>
15 #include <string>
16 #include <map>
17 #include <TH1F.h>
18 #include <TH1D.h>
19 #include <TH2F.h>
20 
22 public:
25 
27  L1TOccupancyClientHistogramService(const edm::ParameterSet& iParameters, DQMStore::IBooker& ibooker, bool iVerbose);
28 
29  //loads the histo of test into histos_
31 
32  //updates histo (i.e. calculates differential to previous LS and adds it to cumulatice histo)
34  void updateHistogramEndRun(std::string iHistName);
35 
36  //resets the cumulative histo (after performing the test in L1TOccupancyClient)
38 
39  // Masks channels of histo in specific strip to perform L1TOccupancyClient::getAvrg()
40  int maskBins(std::string test, TH2F* histo, int strip, int axis);
41 
42  bool isMasked(std::string test, int x, int y); //checks if cells is masked
43  bool isStripMasked(std::string test, int binStrip, int axis); //checks if a whole strip is masked
44 
46  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
53  std::string iHistName,
54  std::string iHistLocation); // Get rebinned version of the hist
55 
56  std::vector<int> getLSCertification(std::string iHistName); // Get list of tested LS for test iHistName
57 
58 private:
59  //DQMStore* mDBE; // storage service
60  bool mVerbose; // verbose mode
61  edm::ParameterSet mParameters; // Copy of the parameters
62 
63  // Maps
64  std::map<std::string, bool> mHistValid; // Map of valid histograms (i.e. that exist)
65  std::map<std::string, std::pair<TH2F*, TH2F*> > mHistograms; // The cumulative histograms
66  std::map<std::string, std::vector<std::pair<int, int> >*> mMaskedBins; // Marked Bins
67  std::map<std::string, TH2F*> mHistDiffMinus1; // Last already closed LS Block Histogram Diff
68  std::map<std::string, std::vector<int> > mLSListDiff; // LS list of current block
69  std::map<std::string, std::vector<int> > mLSListDiffMinus1; // LS list of block -1
70 };
71 
72 #endif
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::vector< std::pair< int, int > > * > mMaskedBins
int maskBins(std::string test, TH2F *histo, int strip, int axis)
void setMaskedBins(std::string test, const std::vector< edm::ParameterSet > &mask)
constexpr uint32_t mask
Definition: gpuClustering.h:24
bool isStripMasked(std::string test, int binStrip, int axis)
std::map< std::string, std::vector< int > > mLSListDiff
std::map< std::string, std::pair< TH2F *, TH2F * > > mHistograms
std::map< std::string, std::vector< int > > mLSListDiffMinus1
void updateHistogramEndLS(DQMStore::IGetter &igetter, std::string test, std::string histo, int iLS)
bool isMasked(std::string test, int x, int y)