CMS 3D CMS Logo

RPCDaqInfo.cc
Go to the documentation of this file.
3 
8 
9 #include <fmt/format.h>
10 
12  FEDRange_.first = ps.getUntrackedParameter<unsigned int>("MinimumRPCFEDId", 790);
13  FEDRange_.second = ps.getUntrackedParameter<unsigned int>("MaximumRPCFEDId", 792);
14 
15  NumberOfFeds_ = FEDRange_.second - FEDRange_.first + 1;
16 
17  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
18 
19  runInfoToken_ = esConsumes<edm::Transition::EndLuminosityBlock>();
20 
21  init_ = false;
22 }
23 
26  DQMStore::IGetter& igetter,
27  edm::LuminosityBlock const& LB,
28  edm::EventSetup const& iSetup) {
29  if (!init_) {
30  this->myBooker(ibooker);
31  }
32 
33  if (auto runInfoRec = iSetup.tryToGet<RunInfoRcd>()) {
34  //get fed summary information
35  auto sumFED = runInfoRec->get(runInfoToken_);
36  const std::vector<int> FedsInIds = sumFED.m_fed_in;
37 
38  int FedCount = 0;
39 
40  //loop on all active feds
41  for (const int fedID : FedsInIds) {
42  //make sure fed id is in allowed range
43  if (fedID >= FEDRange_.first && fedID <= FEDRange_.second)
44  ++FedCount;
45  }
46 
47  //Fill active fed fraction ME
48  if (NumberOfFeds_ > 0)
49  DaqFraction_->Fill(FedCount / NumberOfFeds_);
50  else
51  DaqFraction_->Fill(-1);
52 
53  } else {
54  DaqFraction_->Fill(-1);
55  return;
56  }
57 }
58 
60 
62  //fraction of alive FEDs
63  ibooker.setCurrentFolder("RPC/EventInfo/DAQContents");
64 
65  const int limit = std::max(2, numberOfDisks_);
66 
67  for (int i = -limit; i <= limit; ++i) { //loop on wheels and disks
68  if (i > -3 && i < nWheels_ - 2) { //wheels
69  const std::string meName = fmt::format("RPC_Wheel{}", i);
70  daqWheelFractions[i + 2] = ibooker.bookFloat(meName);
71  daqWheelFractions[i + 2]->Fill(-1);
72  }
73 
74  if (i == 0 || i > numberOfDisks_ || i < -numberOfDisks_)
75  continue;
76 
77  if (i > -3 && i < nDisks_ - 2) {
78  const std::string meName = fmt::format("RPC_Disk{}", i);
79  daqDiskFractions[i + 2] = ibooker.bookFloat(meName);
80  daqDiskFractions[i + 2]->Fill(-1);
81  }
82  }
83 
84  //daq summary for RPCs
85  ibooker.setCurrentFolder("RPC/EventInfo");
86 
87  DaqFraction_ = ibooker.bookFloat("DAQSummary");
88  DaqMap_ = RPCSummaryMapHisto::book(ibooker, "DAQSummaryMap", "RPC DAQ Summary Map");
91 
92  init_ = true;
93 }
FEDNumbering.h
mps_fire.i
i
Definition: mps_fire.py:428
RPCDaqInfo::FEDRange_
std::pair< int, int > FEDRange_
Definition: RPCDaqInfo.h:38
RPCDaqInfo::myBooker
void myBooker(DQMStore::IBooker &)
Definition: RPCDaqInfo.cc:61
dqm::implementation::IBooker::bookFloat
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
RPCSummaryMapHisto.h
ESHandle.h
RPCDaqInfo::init_
bool init_
Definition: RPCDaqInfo.h:29
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
RPCDaqInfo::DaqMap_
MonitorElement * DaqMap_
Definition: RPCDaqInfo.h:32
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
RPCDaqInfo.h
RPCDaqInfo::daqDiskFractions
MonitorElement * daqDiskFractions[nDisks_]
Definition: RPCDaqInfo.h:36
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::EventSetup::tryToGet
std::optional< T > tryToGet() const
Definition: EventSetup.h:108
RPCDaqInfo::runInfoToken_
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
Definition: RPCDaqInfo.h:27
RPCDaqInfo::RPCDaqInfo
RPCDaqInfo(const edm::ParameterSet &)
Definition: RPCDaqInfo.cc:11
dqm-mbProfile.format
format
Definition: dqm-mbProfile.py:16
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
RPCSummaryMapHisto::setBinsEndcap
static void setBinsEndcap(MonitorElement *me, const double value)
Definition: RPCSummaryMapHisto.cc:43
RunInfoRcd
Definition: RunSummaryRcd.h:26
RPCDaqInfo::nWheels_
constexpr static int nWheels_
Definition: RPCDaqInfo.h:33
edm::ParameterSet
Definition: ParameterSet.h:47
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
RPCDaqInfo::NumberOfFeds_
int NumberOfFeds_
Definition: RPCDaqInfo.h:40
edm::EventSetup
Definition: EventSetup.h:58
RPCDaqInfo::nDisks_
constexpr static int nDisks_
Definition: RPCDaqInfo.h:35
RPCDaqInfo::beginJob
void beginJob() override
Definition: RPCDaqInfo.cc:24
RunSummary.h
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
remoteMonitoring_LED_IterMethod_cfg.limit
limit
Definition: remoteMonitoring_LED_IterMethod_cfg.py:427
RPCDaqInfo::dqmEndLuminosityBlock
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: RPCDaqInfo.cc:25
dqm::implementation::IGetter
Definition: DQMStore.h:484
RPCDaqInfo::daqWheelFractions
MonitorElement * daqWheelFractions[nWheels_]
Definition: RPCDaqInfo.h:34
EventSetup.h
dqm::implementation::IBooker
Definition: DQMStore.h:43
RPCDaqInfo::dqmEndJob
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Definition: RPCDaqInfo.cc:59
RPCSummaryMapHisto::book
static MonitorElement * book(IBooker &booker, const std::string &name, const std::string &title)
Definition: RPCSummaryMapHisto.cc:7
RPCDaqInfo::numberOfDisks_
int numberOfDisks_
Definition: RPCDaqInfo.h:40
RPCDaqInfo::DaqFraction_
MonitorElement * DaqFraction_
Definition: RPCDaqInfo.h:31
RPCSummaryMapHisto::setBinsBarrel
static void setBinsBarrel(MonitorElement *me, const double value)
Definition: RPCSummaryMapHisto.cc:35