CMS 3D CMS Logo

RPCDCSSummary.cc
Go to the documentation of this file.
2 
7 
8 #include <fmt/format.h>
9 
11  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
12 
13  FEDRange_.first = ps.getUntrackedParameter<unsigned int>("MinimumRPCFEDId", 790);
14  FEDRange_.second = ps.getUntrackedParameter<unsigned int>("MaximumRPCFEDId", 792);
15 
16  offlineDQM_ = ps.getUntrackedParameter<bool>("OfflineDQM", true);
17 
18  NumberOfFeds_ = FEDRange_.second - FEDRange_.first + 1;
19  init_ = false;
20  defaultValue_ = 1.;
21 
22  runInfoToken_ = esConsumes<edm::Transition::EndLuminosityBlock>();
23 }
24 
26 
28  DQMStore::IGetter& igetter,
29  edm::LuminosityBlock const& lumiB,
30  edm::EventSetup const& setup) {
31  if (!init_) {
32  this->checkDCSbit(setup);
33  if (!offlineDQM_) {
34  this->myBooker(ibooker);
35  }
36  }
37 }
38 
40  if (offlineDQM_) {
41  this->myBooker(ibooker);
42  }
43 }
44 
46  defaultValue_ = 1.;
47 
48  if (auto runInfoRec = setup.tryToGet<RunInfoRcd>()) {
49  defaultValue_ = -1.;
50  //get fed summary information
51  auto sumFED = runInfoRec->get(runInfoToken_);
52  const std::vector<int> FedsInIds = sumFED.m_fed_in;
53  unsigned int f = 0;
54  bool flag = false;
55  while (!flag && f < FedsInIds.size()) {
56  int fedID = FedsInIds[f];
57  //make sure fed id is in allowed range
58  if (fedID >= FEDRange_.first && fedID <= FEDRange_.second) {
59  defaultValue_ = 1.;
60  flag = true;
61  }
62  f++;
63  }
64  }
65  init_ = true;
66 }
67 
69  ibooker.setCurrentFolder("RPC/EventInfo");
70  // global fraction
71  totalDCSFraction = ibooker.bookFloat("DCSSummary");
73 
74  DCSMap_ = RPCSummaryMapHisto::book(ibooker, "DCSSummaryMap", "RPC DCS Summary Map");
75 
76  //fill the histo with "1" --- just for the moment
79 
80  // book the ME
81  ibooker.setCurrentFolder("RPC/EventInfo/DCSContents");
82 
83  const int limit = std::max(2, numberOfDisks_);
84 
85  for (int i = -1 * limit; i <= limit; i++) { //loop on wheels and disks
86  if (i > -3 && i < nWheels_ - 2) { //wheels
87  const std::string s = fmt::format("RPC_Wheel{}", i);
88  dcsWheelFractions[i + 2] = ibooker.bookFloat(s);
90  }
91 
92  if (i == 0 || i > numberOfDisks_ || i < -numberOfDisks_)
93  continue;
94 
95  if (i > -3 && i < nDisks_ - 2) {
96  const std::string s = fmt::format("RPC_Disk{}", i);
97  dcsDiskFractions[i + 2] = ibooker.bookFloat(s);
99  }
100  }
101 }
mps_fire.i
i
Definition: mps_fire.py:428
dqm::implementation::IBooker::bookFloat
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
RPCSummaryMapHisto.h
RPCDCSSummary::FEDRange_
std::pair< int, int > FEDRange_
Definition: RPCDCSSummary.h:41
ESHandle.h
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
RPCDCSSummary::dqmEndLuminosityBlock
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: RPCDCSSummary.cc:27
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
RPCDCSSummary::myBooker
void myBooker(DQMStore::IBooker &)
Definition: RPCDCSSummary.cc:68
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
RPCDCSSummary::init_
bool init_
Definition: RPCDCSSummary.h:30
alignCSCRings.s
s
Definition: alignCSCRings.py:92
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
RPCDCSSummary::dcsDiskFractions
MonitorElement * dcsDiskFractions[nDisks_]
Definition: RPCDCSSummary.h:40
RunInfoRcd
Definition: RunSummaryRcd.h:26
edm::ParameterSet
Definition: ParameterSet.h:47
RPCDCSSummary::runInfoToken_
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
Definition: RPCDCSSummary.h:28
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
RPCDCSSummary::numberOfDisks_
int numberOfDisks_
Definition: RPCDCSSummary.h:42
edm::EventSetup
Definition: EventSetup.h:58
RPCDCSSummary::nDisks_
constexpr static int nDisks_
Definition: RPCDCSSummary.h:39
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
RPCDCSSummary::nWheels_
constexpr static int nWheels_
Definition: RPCDCSSummary.h:37
RPCDCSSummary.h
remoteMonitoring_LED_IterMethod_cfg.limit
limit
Definition: remoteMonitoring_LED_IterMethod_cfg.py:427
dqm::implementation::IGetter
Definition: DQMStore.h:484
RPCDCSSummary::offlineDQM_
bool offlineDQM_
Definition: RPCDCSSummary.h:33
RPCDCSSummary::DCSMap_
MonitorElement * DCSMap_
Definition: RPCDCSSummary.h:35
EventSetup.h
RPCDCSSummary::NumberOfFeds_
int NumberOfFeds_
Definition: RPCDCSSummary.h:43
dqm::implementation::IBooker
Definition: DQMStore.h:43
RPCDCSSummary::dqmEndJob
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Definition: RPCDCSSummary.cc:39
RPCSummaryMapHisto::book
static MonitorElement * book(IBooker &booker, const std::string &name, const std::string &title)
Definition: RPCSummaryMapHisto.cc:7
ParameterSet.h
RPCDCSSummary::RPCDCSSummary
RPCDCSSummary(const edm::ParameterSet &)
Definition: RPCDCSSummary.cc:10
RPCDCSSummary::dcsWheelFractions
MonitorElement * dcsWheelFractions[nWheels_]
Definition: RPCDCSSummary.h:38
RPCDCSSummary::defaultValue_
double defaultValue_
Definition: RPCDCSSummary.h:31
RPCDCSSummary::checkDCSbit
void checkDCSbit(edm::EventSetup const &)
Definition: RPCDCSSummary.cc:45
RPCSummaryMapHisto::setBinsBarrel
static void setBinsBarrel(MonitorElement *me, const double value)
Definition: RPCSummaryMapHisto.cc:35
RPCDCSSummary::beginJob
void beginJob() override
Definition: RPCDCSSummary.cc:25
RPCDCSSummary::totalDCSFraction
MonitorElement * totalDCSFraction
Definition: RPCDCSSummary.h:36
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:117