CMS 3D CMS Logo

RPCDcsInfo.cc
Go to the documentation of this file.
5 
7  subsystemname_ = ps.getUntrackedParameter<std::string>("subSystemFolder", "RPC");
8  dcsinfofolder_ = ps.getUntrackedParameter<std::string>("dcsInfoFolder", "DCSInfo");
9  scalersRawToDigiLabel_ = consumes<DcsStatusCollection>(ps.getParameter<edm::InputTag>("ScalersRawToDigiLabel"));
10 }
11 
13 
15  edm::Run const& /* iRun */,
16  edm::EventSetup const& /* iSetup */) {
17  // Fetch GlobalTag information and fill the string/ME.
18  ibooker.cd();
20 
21  DCSbyLS_ = ibooker.book1D("DCSbyLS", "DCS", 1, 0.5, 1.5);
23 
24  // initialize
25  dcs = true;
26 }
27 
29  makeDcsInfo(e);
30  return;
31 }
32 
34  // int nlumi = l.id().luminosityBlock();
35 
36  // fill dcs vs lumi
37  /* set those bins 0 for which bits are ON
38  needed for merge off lumi histograms across files */
39  if (dcs)
40  DCSbyLS_->setBinContent(1, 0.);
41  else
42  DCSbyLS_->setBinContent(1, 1.);
43 
44  dcs = true;
45 
46  return;
47 }
48 
51 
52  if (!e.getByToken(scalersRawToDigiLabel_, dcsStatus)) {
53  dcs = false;
54  return;
55  }
56 
57  if (!dcsStatus.isValid()) {
58  edm::LogWarning("RPCDcsInfo") << "scalersRawToDigi not found";
59  dcs = false; // info not available: set to false
60  return;
61  }
62 
63  for (DcsStatusCollection::const_iterator dcsStatusItr = dcsStatus->begin(); dcsStatusItr != dcsStatus->end();
64  ++dcsStatusItr) {
65  if (!dcsStatusItr->ready(DcsStatus::RPC))
66  dcs = false;
67  }
68 
69  return;
70 }
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
Definition: DQMStore.cc:239
T getParameter(std::string const &) const
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Analyze.
Definition: RPCDcsInfo.cc:28
T getUntrackedParameter(std::string const &, T const &) const
~RPCDcsInfo() override
Destructor.
Definition: RPCDcsInfo.cc:12
std::string dcsinfofolder_
Definition: RPCDcsInfo.h:37
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:418
void setLumiFlag()
this ME is meant to be stored for each luminosity section
std::string subsystemname_
Definition: RPCDcsInfo.h:36
void makeDcsInfo(const edm::Event &e)
Definition: RPCDcsInfo.cc:49
void dqmEndLuminosityBlock(const edm::LuminosityBlock &l, const edm::EventSetup &c) override
Definition: RPCDcsInfo.cc:33
MonitorElement * DCSbyLS_
Definition: RPCDcsInfo.h:41
bool isValid() const
Definition: HandleBase.h:70
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
edm::EDGetTokenT< DcsStatusCollection > scalersRawToDigiLabel_
Definition: RPCDcsInfo.h:42
bool dcs
Definition: RPCDcsInfo.h:39
RPCDcsInfo(const edm::ParameterSet &ps)
Constructor.
Definition: RPCDcsInfo.cc:6
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: RPCDcsInfo.cc:14
Definition: Run.h:45