CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 
30 
31  public:
32 
35 
37  virtual ~L1TOccupancyClient();
38 
39  protected:
40 
42  void beginJob(void);
43  void endJob();
44 
46  void beginRun(const edm::Run& r, const edm::EventSetup& c);
47  void endRun (const edm::Run& r, const edm::EventSetup& c);
48 
49  void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg,const edm::EventSetup& context);
50  void endLuminosityBlock (const edm::LuminosityBlock& lumiSeg,const edm::EventSetup& c); // DQM Client Diagnostic
51 
53  void analyze(const edm::Event& e, const edm::EventSetup& c) ;
54 
55  //DQM test routines
56  double xySymmetry(edm::ParameterSet ps,
57  std::string test_name,
58  std::vector<std::pair<int,double> >& deadChannels,
59  std::vector<std::pair<int,double> >& statDev,
60  bool& enoughStats); // Performs the checking of enough statistics and invokes compareWithStrip()
61 
62  private:
63 
64  edm::ParameterSet parameters_; //parameter set from python
65  DQMStore* dbe_; //store service
67  TFile* file_; //output file for test results
68 
69  // bool
70  bool verbose_; //verbose mode
71 
72  // vector
73  std::vector<edm::ParameterSet> tests_; // all tests defined in python file
74  std::vector<edm::ParameterSet*> mValidTests; // Valid tests
75  // map
76  std::map<std::string,MonitorElement*> meResults;
77  std::map<std::string,MonitorElement*> meDifferential;
78  std::map<std::string,MonitorElement*> meCertification;
79 
80  private:
81 
82  // performs the actual test
83  int compareWithStrip(TH2F* histo,
84  std::string test,
85  int binStrip,
86  int nBins,
87  int axis,
88  double avg,
90  std::vector<std::pair<int,double> >& deadChannels);
91 
92  // Gets the bin-number of a bin with content and on axis
93  void getBinCoordinateOnAxisWithValue(TH2F* h2f,
94  double content,
95  int& coord,
96  int axis);
97 
98  // Puts out the bad and masked channels of a specific test to h2f
99  void printDeadChannels(std::vector<std::pair<int,double> > deadChannels,
100  TH2F* h2f,
101  std::vector<std::pair<int,double> > statDev,
102  std::string test_name);
103 
104  // Gets the average (avrgMode=1 arithmetic, avrgMode=2 median) for a specific binStrip in histo h2f for a specific test
105  double getAvrg(TH2F* h2f, std::string test, int axis, int nBins, int binStrip, int avrgMode);
106 
107 };
108 
109 #endif
std::map< std::string, MonitorElement * > meResults
void analyze(const edm::Event &e, const edm::EventSetup &c)
Fake Analyze.
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
void getBinCoordinateOnAxisWithValue(TH2F *h2f, double content, int &coord, int axis)
virtual ~L1TOccupancyClient()
Destructor.
void beginJob(void)
BeginJob.
int compareWithStrip(TH2F *histo, std::string test, int binStrip, int nBins, int axis, double avg, edm::ParameterSet ps, std::vector< std::pair< int, double > > &deadChannels)
double getAvrg(TH2F *h2f, std::string test, int axis, int nBins, int binStrip, int avrgMode)
std::map< std::string, MonitorElement * > meCertification
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
double xySymmetry(edm::ParameterSet ps, std::string test_name, std::vector< std::pair< int, double > > &deadChannels, std::vector< std::pair< int, double > > &statDev, bool &enoughStats)
void endRun(const edm::Run &r, const edm::EventSetup &c)
std::map< std::string, MonitorElement * > meDifferential
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
edm::ParameterSet parameters_
void printDeadChannels(std::vector< std::pair< int, double > > deadChannels, TH2F *h2f, std::vector< std::pair< int, double > > statDev, std::string test_name)
std::vector< edm::ParameterSet * > mValidTests
L1TOccupancyClient(const edm::ParameterSet &ps)
Constructor.
Definition: Run.h:33
std::vector< edm::ParameterSet > tests_
L1TOccupancyClientHistogramService * hservice_