CMS 3D CMS Logo

L1TOccupancyClient.h
Go to the documentation of this file.
1 #ifndef DQM_L1TMONITORCLIENT_L1TOCCUPANCYCLIENT_H
2 #define DQM_L1TMONITORCLIENT_L1TOCCUPANCYCLIENT_H
3 
8 
13 
14 #include <memory>
15 #include <iostream>
16 #include <fstream>
17 #include <string>
18 #include <vector>
19 #include <map>
20 #include <TH1F.h>
21 #include <TH1D.h>
22 #include <TH2F.h>
23 #include <TF1.h>
24 #include <TProfile2D.h>
25 #include <TNamed.h>
26 #include <TRandom3.h>
27 #include <TDirectory.h>
28 
30 public:
33 
35  ~L1TOccupancyClient() override;
36 
37 protected:
38  void dqmEndJob(DQMStore::IBooker& ibooker, DQMStore::IGetter& igetter) override;
39  void book(DQMStore::IBooker& ibooker, DQMStore::IGetter& igetter);
41  DQMStore::IGetter& igetter,
42  const edm::LuminosityBlock& lumiSeg,
43  const edm::EventSetup& c) override; // DQM Client Diagnostic
44 
45  //DQM test routines
46  double xySymmetry(const edm::ParameterSet& ps,
47  std::string test_name,
48  std::vector<std::pair<int, double> >& deadChannels,
49  std::vector<std::pair<int, double> >& statDev,
50  bool& enoughStats); // Performs the checking of enough statistics and invokes compareWithStrip()
51 
52 private:
53  edm::ParameterSet parameters_; //parameter set from python
55  TFile* file_; //output file for test results
56 
57  // bool
58  bool verbose_; //verbose mode
59 
60  // vector
61  std::vector<edm::ParameterSet> tests_; // all tests defined in python file
62  std::vector<edm::ParameterSet*> mValidTests; // Valid tests
63  // map
64  std::map<std::string, MonitorElement*> meResults;
65  std::map<std::string, MonitorElement*> meDifferential;
66  std::map<std::string, MonitorElement*> meCertification;
67 
68 private:
69  // performs the actual test
70  int compareWithStrip(TH2F* histo,
72  int binStrip,
73  int nBins,
74  int axis,
75  double avg,
76  const edm::ParameterSet& ps,
77  std::vector<std::pair<int, double> >& deadChannels);
78 
79  // Gets the bin-number of a bin with content and on axis
80  void getBinCoordinateOnAxisWithValue(TH2F* h2f, double content, int& coord, int axis);
81 
82  // Puts out the bad and masked channels of a specific test to h2f
83  void printDeadChannels(const std::vector<std::pair<int, double> >& deadChannels,
84  TH2F* h2f,
85  const std::vector<std::pair<int, double> >& statDev,
86  std::string test_name);
87 
88  // Gets the average (avrgMode=1 arithmetic, avrgMode=2 median) for a specific binStrip in histo h2f for a specific test
89  double getAvrg(TH2F* h2f, std::string test, int axis, int nBins, int binStrip, int avrgMode);
90 };
91 
92 #endif
std::map< std::string, MonitorElement * > meCertification
void getBinCoordinateOnAxisWithValue(TH2F *h2f, double content, int &coord, int axis)
void printDeadChannels(const std::vector< std::pair< int, double > > &deadChannels, TH2F *h2f, const std::vector< std::pair< int, double > > &statDev, std::string test_name)
double getAvrg(TH2F *h2f, std::string test, int axis, int nBins, int binStrip, int avrgMode)
double xySymmetry(const edm::ParameterSet &ps, std::string test_name, std::vector< std::pair< int, double > > &deadChannels, std::vector< std::pair< int, double > > &statDev, bool &enoughStats)
void dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) override
void book(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
std::map< std::string, MonitorElement * > meDifferential
void dqmEndLuminosityBlock(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) override
edm::ParameterSet parameters_
std::vector< edm::ParameterSet * > mValidTests
std::map< std::string, MonitorElement * > meResults
int compareWithStrip(TH2F *histo, std::string test, int binStrip, int nBins, int axis, double avg, const edm::ParameterSet &ps, std::vector< std::pair< int, double > > &deadChannels)
L1TOccupancyClient(const edm::ParameterSet &ps)
Constructor.
~L1TOccupancyClient() override
Destructor.
std::vector< edm::ParameterSet > tests_
L1TOccupancyClientHistogramService * hservice_