CMS 3D CMS Logo

L1TRPCTFClient.cc
Go to the documentation of this file.
2 
9 #include "TRandom.h"
10 
11 #include <TF1.h>
12 #include <cstdio>
13 #include <sstream>
14 #include <cmath>
15 #include <TProfile.h>
16 #include <TProfile2D.h>
17 
18 using namespace edm;
19 using namespace std;
20 
22  parameters_ = ps;
23  initialize();
24 }
25 
26 L1TRPCTFClient::~L1TRPCTFClient() { LogInfo("TriggerDQM") << "[TriggerDQM]: ending... "; }
27 
28 //--------------------------------------------------------
30  counterLS_ = 0;
31  counterEvt_ = 0;
32 
33  // base folder for the contents of this job
34  monitorName_ = parameters_.getUntrackedParameter<string>("monitorName", "");
35  // cout << "Monitor name = " << monitorName_ << endl;
36  prescaleLS_ = parameters_.getUntrackedParameter<int>("prescaleLS", -1);
37  // cout << "DQM lumi section prescale = " << prescaleLS_ << " lumi section(s)"<< endl;
38  prescaleEvt_ = parameters_.getUntrackedParameter<int>("prescaleEvt", -1);
39  // cout << "DQM event prescale = " << prescaleEvt_ << " events(s)"<< endl;
40  output_dir_ = parameters_.getUntrackedParameter<string>("output_dir", "");
41  // cout << "DQM output dir = " << output_dir_ << endl;
42  input_dir_ = parameters_.getUntrackedParameter<string>("input_dir", "");
43  // cout << "DQM input dir = " << input_dir_ << endl;
44 
45  verbose_ = parameters_.getUntrackedParameter<bool>("verbose", false);
46 
47  m_runInEventLoop = parameters_.getUntrackedParameter<bool>("runInEventLoop", false);
48  m_runInEndLumi = parameters_.getUntrackedParameter<bool>("runInEndLumi", false);
49  m_runInEndRun = parameters_.getUntrackedParameter<bool>("runInEndRun", false);
50  m_runInEndJob = parameters_.getUntrackedParameter<bool>("runInEndJob", false);
51 
52  LogInfo("TriggerDQM");
53 }
54 
55 //--------------------------------------------------------
57  LogInfo("TriggerDQM") << "[TriggerDQM]: Begin Job";
58 
59  ibooker.setCurrentFolder(output_dir_);
60 
61  m_deadChannels = ibooker.book2D("RPCTF_deadchannels", "RPCTF deadchannels", 33, -16.5, 16.5, 144, -0.5, 143.5);
62  m_noisyChannels = ibooker.book2D("RPCTF_noisychannels", "RPCTF noisy channels", 33, -16.5, 16.5, 144, -0.5, 143.5);
63 }
64 
65 //--------------------------------------------------------
66 
68  DQMStore::IGetter &igetter,
69  const edm::LuminosityBlock &lumiSeg,
70  const edm::EventSetup &c) {
71  if (verbose_)
72  std::cout << "L1TRPCTFClient::endLuminosityBlock" << std::endl;
73 
74  if (m_runInEndLumi) {
75  book(ibooker);
76  processHistograms(igetter);
77  }
78 }
79 
81  book(ibooker);
82  processHistograms(igetter);
83 }
84 
85 //--------------------------------------------------------
87  igetter.setCurrentFolder(input_dir_);
88 
89  {
90  MonitorElement *me = igetter.get(input_dir_ + "/RPCTF_muons_eta_phi_bx0");
91 
92  if (me) {
93  const QReport *qreport;
94 
95  qreport = me->getQReport("DeadChannels_RPCTF_2D");
96  if (qreport) {
97  vector<dqm::me_util::Channel> badChannels = qreport->getBadChannels();
98  for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); channel != badChannels.end();
99  ++channel) {
100  m_deadChannels->setBinContent((*channel).getBinX(), (*channel).getBinY(), 100);
101  } // for(badchannels)
102  } //if (qreport)
103 
104  qreport = me->getQReport("HotChannels_RPCTF_2D");
105  if (qreport) {
106  vector<dqm::me_util::Channel> badChannels = qreport->getBadChannels();
107  for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); channel != badChannels.end();
108  ++channel) {
109  // (*channel).getBinY() == 0 for NoisyChannels QTEST
110  m_noisyChannels->setBinContent((*channel).getBinX(), 100);
111  } // for(badchannels)
112  } //if (qreport)
113  // else std::cout << "dupa" << std::endl;
114  } // if (me)
115  }
116 
117  if (verbose_) {
118  std::vector<string> meVec = igetter.getMEs();
119  for (vector<string>::const_iterator it = meVec.begin(); it != meVec.end(); it++) {
120  std::string full_path = input_dir_ + "/" + (*it);
121  MonitorElement *me = igetter.get(full_path);
122 
123  // for this MEs, get list of associated QTs
124  std::vector<QReport *> Qtest_map = me->getQReports();
125 
126  if (!Qtest_map.empty()) {
127  std::cout << "Test: " << full_path << std::endl;
128  for (std::vector<QReport *>::const_iterator it = Qtest_map.begin(); it != Qtest_map.end(); ++it) {
129  std::cout << " Name " << (*it)->getQRName() << " Status " << (*it)->getStatus() << std::endl;
130 
131  std::vector<dqm::me_util::Channel> badChannels = (*it)->getBadChannels();
132 
133  vector<dqm::me_util::Channel>::iterator badchsit = badChannels.begin();
134  while (badchsit != badChannels.end()) {
135  int ix = (*badchsit).getBinX();
136  int iy = (*badchsit).getBinY();
137  std::cout << "(" << ix << "," << iy << ") ";
138  ++badchsit;
139  }
140  std::cout << std::endl;
141  }
142  }
143 
144  } //
145  }
146 }
MessageLogger.h
L1TRPCTFClient::dqmEndLuminosityBlock
void dqmEndLuminosityBlock(DQMStore::IBooker &ibooker, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: L1TRPCTFClient.cc:67
ESHandle.h
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm
HLT enums.
Definition: AlignableModifier.h:19
dqm::implementation::IGetter::getMEs
virtual std::vector< std::string > getMEs() const
Definition: DQMStore.cc:698
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::LogInfo
Definition: MessageLogger.h:254
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
DQMStore.h
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
L1TRPCTFClient::~L1TRPCTFClient
~L1TRPCTFClient() override
Destructor.
Definition: L1TRPCTFClient.cc:26
Service.h
MonitorElementData::QReport::getBadChannels
const std::vector< DQMChannel > & getBadChannels() const
Definition: MonitorElementCollection.h:116
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:36
L1TRPCTFClient.h
MonitorElementData::QReport
Definition: MonitorElementCollection.h:55
L1TRPCTFClient::initialize
void initialize()
Definition: L1TRPCTFClient.cc:29
edm::EventSetup
Definition: EventSetup.h:57
L1TRPCTFClient::book
void book(DQMStore::IBooker &ibooker)
Definition: L1TRPCTFClient.cc:56
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
L1TRPCTFClient::dqmEndJob
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Definition: L1TRPCTFClient.cc:80
std
Definition: JetResolutionObject.h:76
dqm::implementation::IGetter
Definition: DQMStore.h:484
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:651
EventSetup.h
dqm::implementation::IBooker
Definition: DQMStore.h:43
initialize
static AlgebraicMatrix initialize()
Definition: BeamSpotTransientTrackingRecHit.cc:24
ParameterSet.h
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
L1TRPCTFClient::L1TRPCTFClient
L1TRPCTFClient(const edm::ParameterSet &ps)
Constructor.
Definition: L1TRPCTFClient.cc:21
L1TRPCTFClient::processHistograms
void processHistograms(DQMStore::IGetter &igetter)
Definition: L1TRPCTFClient.cc:86