CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
L1TOccupancyClient.h
Go to the documentation of this file.
1 #ifndef DQM_L1TMONITORCLIENT_L1TOCCUPANCYCLIENT_H
2 #define DQM_L1TMONITORCLIENT_L1TOCCUPANCYCLIENT_H
3 
9 
14 
15 #include <memory>
16 #include <iostream>
17 #include <fstream>
18 #include <string>
19 #include <vector>
20 #include <map>
21 #include <TH1F.h>
22 #include <TH1D.h>
23 #include <TH2F.h>
24 #include <TF1.h>
25 #include <TProfile2D.h>
26 #include <TNamed.h>
27 #include <TRandom3.h>
28 #include <TDirectory.h>
29 
31 public:
34 
36  ~L1TOccupancyClient() override;
37 
38 protected:
39  void dqmEndJob(DQMStore::IBooker& ibooker, DQMStore::IGetter& igetter) override;
40  void book(DQMStore::IBooker& ibooker, DQMStore::IGetter& igetter);
42  DQMStore::IGetter& igetter,
43  const edm::LuminosityBlock& lumiSeg,
44  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  edm::ParameterSet parameters_; //parameter set from python
56  TFile* file_; //output file for test results
57 
58  // bool
59  bool verbose_; //verbose mode
60 
61  // vector
62  std::vector<edm::ParameterSet> tests_; // all tests defined in python file
63  std::vector<edm::ParameterSet*> mValidTests; // Valid tests
64  // map
65  std::map<std::string, MonitorElement*> meResults;
66  std::map<std::string, MonitorElement*> meDifferential;
67  std::map<std::string, MonitorElement*> meCertification;
68 
69 private:
70  // performs the actual test
71  int compareWithStrip(TH2F* histo,
73  int binStrip,
74  int nBins,
75  int axis,
76  double avg,
77  const edm::ParameterSet& ps,
78  std::vector<std::pair<int, double> >& deadChannels);
79 
80  // Gets the bin-number of a bin with content and on axis
81  void getBinCoordinateOnAxisWithValue(TH2F* h2f, double content, int& coord, int axis);
82 
83  // Puts out the bad and masked channels of a specific test to h2f
84  void printDeadChannels(const std::vector<std::pair<int, double> >& deadChannels,
85  TH2F* h2f,
86  const std::vector<std::pair<int, double> >& statDev,
87  std::string test_name);
88 
89  // Gets the average (avrgMode=1 arithmetic, avrgMode=2 median) for a specific binStrip in histo h2f for a specific test
90  double getAvrg(TH2F* h2f, std::string test, int axis, int nBins, int binStrip, int avrgMode);
91 };
92 
93 #endif
std::map< std::string, MonitorElement * > meCertification
void getBinCoordinateOnAxisWithValue(TH2F *h2f, double content, int &coord, int axis)
const edm::EventSetup & c
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_