CMS 3D CMS Logo

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