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