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 
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
DQMEDHarvester.h
L1TOccupancyClient::hservice_
L1TOccupancyClientHistogramService * hservice_
Definition: L1TOccupancyClient.h:55
L1TOccupancyClient::meResults
std::map< std::string, MonitorElement * > meResults
Definition: L1TOccupancyClient.h:65
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
LuminosityBlock.h
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
DQMStore.h
EDAnalyzer.h
L1TOccupancyClient::tests_
std::vector< edm::ParameterSet > tests_
Definition: L1TOccupancyClient.h:62
L1TOccupancyClient
Definition: L1TOccupancyClient.h:30
L1TOccupancyClientHistogramService
Definition: L1TOccupancyClientHistogramService.h:22
L1TOccupancyClient::meDifferential
std::map< std::string, MonitorElement * > meDifferential
Definition: L1TOccupancyClient.h:66
MakerMacros.h
test
Definition: SmallWORMDict.h:13
seedmultiplicitymonitor_newtracking_cfi.nBins
nBins
Definition: seedmultiplicitymonitor_newtracking_cfi.py:8
L1TOccupancyClient::parameters_
edm::ParameterSet parameters_
Definition: L1TOccupancyClient.h:54
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
L1TOccupancyClient::~L1TOccupancyClient
~L1TOccupancyClient() override
Destructor.
Definition: L1TOccupancyClient.cc:43
Skims_PA_cff.content
content
Definition: Skims_PA_cff.py:19
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
L1TOccupancyClient::printDeadChannels
void printDeadChannels(const std::vector< std::pair< int, double > > &deadChannels, TH2F *h2f, const std::vector< std::pair< int, double > > &statDev, std::string test_name)
Definition: L1TOccupancyClient.cc:672
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
edm::EventSetup
Definition: EventSetup.h:58
L1TOccupancyClient::book
void book(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
Definition: L1TOccupancyClient.cc:56
L1TOccupancyClient::dqmEndLuminosityBlock
void dqmEndLuminosityBlock(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) override
Definition: L1TOccupancyClient.cc:265
DQMEDHarvester
Definition: DQMEDHarvester.py:1
L1TOccupancyClientHistogramService.h
L1TOccupancyClient::verbose_
bool verbose_
Definition: L1TOccupancyClient.h:59
Frameworkfwd.h
dqm::implementation::IGetter
Definition: DQMStore.h:484
L1TOccupancyClient::mValidTests
std::vector< edm::ParameterSet * > mValidTests
Definition: L1TOccupancyClient.h:63
L1TOccupancyClient::dqmEndJob
void dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) override
Definition: L1TOccupancyClient.cc:136
L1TOccupancyClient::xySymmetry
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)
Definition: L1TOccupancyClient.cc:388
dqm::implementation::IBooker
Definition: DQMStore.h:43
L1TOccupancyClient::meCertification
std::map< std::string, MonitorElement * > meCertification
Definition: L1TOccupancyClient.h:67
L1TOccupancyClient::L1TOccupancyClient
L1TOccupancyClient(const edm::ParameterSet &ps)
Constructor.
Definition: L1TOccupancyClient.cc:28
ParameterSet.h
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
L1TOccupancyClient::file_
TFile * file_
Definition: L1TOccupancyClient.h:56
L1TOccupancyClient::compareWithStrip
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)
Definition: L1TOccupancyClient.cc:731
L1TOccupancyClient::getAvrg
double getAvrg(TH2F *h2f, std::string test, int axis, int nBins, int binStrip, int avrgMode)
Definition: L1TOccupancyClient.cc:597
L1TOccupancyClient::getBinCoordinateOnAxisWithValue
void getBinCoordinateOnAxisWithValue(TH2F *h2f, double content, int &coord, int axis)
Definition: L1TOccupancyClient.cc:886