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 
10 
12 
13 #include <memory>
14 #include <iostream>
15 #include <fstream>
16 #include <string>
17 #include <map>
18 #include <TH1F.h>
19 #include <TH1D.h>
20 #include <TH2F.h>
21 
23 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)
35  void updateHistogramEndRun(std::string iHistName);
36 
37  //resets the cumulative histo (after performing the test in L1TOccupancyClient)
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 
47  const std::vector<edm::ParameterSet>& mask); //set masked channels specified in python
48  std::vector<std::pair<int, int> > getMaskedBins(std::string test); //returns masked channels of test
49 
50  unsigned int getNBinsMasked(std::string test); // Get number of masked bins in test
51  unsigned int getNBinsHistogram(std::string test); // Get actual number of bins in test (i.e. nBins-nMaskedBins)
52  TH2F* getDifferentialHistogram(std::string test); // Get cumulative histogram
54  std::string iHistName,
55  std::string iHistLocation); // Get rebinned version of the hist
56 
57  std::vector<int> getLSCertification(std::string iHistName); // Get list of tested LS for test iHistName
58 
59 private:
60  //DQMStore* mDBE; // storage service
61  bool mVerbose; // verbose mode
62  edm::ParameterSet mParameters; // Copy of the parameters
63 
64  // Maps
65  std::map<std::string, bool> mHistValid; // Map of valid histograms (i.e. that exist)
66  std::map<std::string, std::pair<TH2F*, TH2F*> > mHistograms; // The cumulative histograms
67  std::map<std::string, std::vector<std::pair<int, int> >*> mMaskedBins; // Marked Bins
68  std::map<std::string, TH2F*> mHistDiffMinus1; // Last already closed LS Block Histogram Diff
69  std::map<std::string, std::vector<int> > mLSListDiff; // LS list of current block
70  std::map<std::string, std::vector<int> > mLSListDiffMinus1; // LS list of block -1
71 };
72 
73 #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)