CMS 3D CMS Logo

RPCDCSSummary.cc
Go to the documentation of this file.
2 
7 
8 //#include "DQMServices/Core/interface/DQMStore.h"
9 
10 //CondFormats
13 
15  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
16 
17  FEDRange_.first = ps.getUntrackedParameter<unsigned int>("MinimumRPCFEDId", 790);
18  FEDRange_.second = ps.getUntrackedParameter<unsigned int>("MaximumRPCFEDId", 792);
19 
20  offlineDQM_ = ps.getUntrackedParameter<bool>("OfflineDQM", true);
21 
22  NumberOfFeds_ = FEDRange_.second - FEDRange_.first + 1;
23  init_ = false;
24  defaultValue_ = 1.;
25 }
26 
28 
30 
32  DQMStore::IGetter& igetter,
33  edm::LuminosityBlock const& lumiB,
34  edm::EventSetup const& setup) {
35  if (!init_) {
36  this->checkDCSbit(setup);
37  if (!offlineDQM_) {
38  this->myBooker(ibooker);
39  }
40  }
41 }
42 
44  if (offlineDQM_) {
45  this->myBooker(ibooker);
46  }
47 }
48 
50  defaultValue_ = 1.;
51 
52  if (auto runInfoRec = setup.tryToGet<RunInfoRcd>()) {
53  defaultValue_ = -1.;
54  //get fed summary information
56  runInfoRec->get(sumFED);
57  std::vector<int> FedsInIds = sumFED->m_fed_in;
58  unsigned int f = 0;
59  bool flag = false;
60  while (!flag && f < FedsInIds.size()) {
61  int fedID = FedsInIds[f];
62  //make sure fed id is in allowed range
63  if (fedID >= FEDRange_.first && fedID <= FEDRange_.second) {
64  defaultValue_ = 1.;
65  flag = true;
66  }
67  f++;
68  }
69  }
70  init_ = true;
71 }
72 
74  ibooker.setCurrentFolder("RPC/EventInfo");
75  // global fraction
76  totalDCSFraction = ibooker.bookFloat("DCSSummary");
78 
79  DCSMap_ = ibooker.book2D("DCSSummaryMap", "RPC DCS Summary Map", 15, -7.5, 7.5, 12, 0.5, 12.5);
80 
81  //customize the 2d histo
82  std::stringstream BinLabel;
83  for (int i = 1; i < 13; i++) {
84  BinLabel.str("");
85  BinLabel << "Sec" << i;
86  DCSMap_->setBinLabel(i, BinLabel.str(), 2);
87  }
88 
89  for (int i = -2; i <= 2; i++) {
90  BinLabel.str("");
91  BinLabel << "Wheel" << i;
92  DCSMap_->setBinLabel((i + 8), BinLabel.str(), 1);
93  }
94 
95  for (int i = 1; i <= numberOfDisks_; i++) {
96  BinLabel.str("");
97  BinLabel << "Disk" << i;
98  DCSMap_->setBinLabel((i + 11), BinLabel.str(), 1);
99  BinLabel.str("");
100  BinLabel << "Disk" << -i;
101  DCSMap_->setBinLabel((-i + 5), BinLabel.str(), 1);
102  }
103 
104  //fill the histo with "1" --- just for the moment
105  for (int i = 1; i <= 15; i++) {
106  for (int j = 1; j <= 12; j++) {
107  if (i == 5 || i == 11 || (j > 6 && (i < 6 || i > 10)))
108  DCSMap_->setBinContent(i, j, -1); //bins that not correspond to subdetector parts
109  else
111  }
112  }
113 
114  if (numberOfDisks_ < 4) {
115  for (int j = 1; j <= 12; j++) {
116  DCSMap_->setBinContent(1, j, -1); //bins that not correspond to subdetector parts
117  DCSMap_->setBinContent(15, j, -1);
118  }
119  }
120 
121  // book the ME
122  ibooker.setCurrentFolder("RPC/EventInfo/DCSContents");
123 
124  int limit = numberOfDisks_;
125  if (numberOfDisks_ < 2)
126  limit = 2;
127 
128  for (int i = -1 * limit; i <= limit; i++) { //loop on wheels and disks
129  if (i > -3 && i < 3) { //wheels
130  std::stringstream streams;
131  streams << "RPC_Wheel" << i;
132  dcsWheelFractions[i + 2] = ibooker.bookFloat(streams.str());
134  }
135 
136  if (i == 0 || i > numberOfDisks_ || i < (-1 * numberOfDisks_))
137  continue;
138 
139  int offset = numberOfDisks_;
140  if (i > 0)
141  offset--; //used to skip case equale to zero
142  std::stringstream streams;
143  streams << "RPC_Disk" << i;
144  dcsDiskFractions[i + 2] = ibooker.bookFloat(streams.str());
146  }
147 }
mps_fire.i
i
Definition: mps_fire.py:355
RunSummaryRcd.h
dqm::implementation::IBooker::bookFloat
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
RPCDCSSummary::FEDRange_
std::pair< int, int > FEDRange_
Definition: RPCDCSSummary.h:39
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:31
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
RunInfo::m_fed_in
std::vector< int > m_fed_in
Definition: RunInfo.h:25
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
RPCDCSSummary::myBooker
void myBooker(DQMStore::IBooker &)
Definition: RPCDCSSummary.cc:73
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
RPCDCSSummary::init_
bool init_
Definition: RPCDCSSummary.h:30
RPCDCSSummary::~RPCDCSSummary
~RPCDCSSummary() override
Destructor.
Definition: RPCDCSSummary.cc:27
Service.h
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
edm::ESHandle
Definition: DTSurvey.h:22
CentralityFilter_cfi.BinLabel
BinLabel
Definition: CentralityFilter_cfi.py:5
RunInfoRcd
Definition: RunSummaryRcd.h:26
edm::ParameterSet
Definition: ParameterSet.h:36
dqm::impl::MonitorElement::setBinLabel
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:771
RPCDCSSummary::numberOfDisks_
int numberOfDisks_
Definition: RPCDCSSummary.h:40
edm::EventSetup
Definition: EventSetup.h:57
RunInfo.h
dqm::impl::MonitorElement::setBinContent
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
Definition: MonitorElement.cc:691
RPCDCSSummary.h
remoteMonitoring_LED_IterMethod_cfg.limit
limit
Definition: remoteMonitoring_LED_IterMethod_cfg.py:427
RPCDCSSummary::dcsWheelFractions
MonitorElement * dcsWheelFractions[5]
Definition: RPCDCSSummary.h:37
dqm::implementation::IGetter
Definition: DQMStore.h:484
RPCDCSSummary::offlineDQM_
bool offlineDQM_
Definition: RPCDCSSummary.h:33
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
RPCDCSSummary::DCSMap_
MonitorElement * DCSMap_
Definition: RPCDCSSummary.h:35
HLT_2018_cff.streams
streams
Definition: HLT_2018_cff.py:3574
EventSetup.h
RPCDCSSummary::NumberOfFeds_
int NumberOfFeds_
Definition: RPCDCSSummary.h:41
dqm::implementation::IBooker
Definition: DQMStore.h:43
RPCDCSSummary::dqmEndJob
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Definition: RPCDCSSummary.cc:43
RPCDCSSummary::dcsDiskFractions
MonitorElement * dcsDiskFractions[10]
Definition: RPCDCSSummary.h:38
ParameterSet.h
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
RPCDCSSummary::RPCDCSSummary
RPCDCSSummary(const edm::ParameterSet &)
Constructor.
Definition: RPCDCSSummary.cc:14
RPCDCSSummary::defaultValue_
double defaultValue_
Definition: RPCDCSSummary.h:31
RPCDCSSummary::checkDCSbit
void checkDCSbit(edm::EventSetup const &)
Definition: RPCDCSSummary.cc:49
RPCDCSSummary::beginJob
void beginJob() override
Definition: RPCDCSSummary.cc:29
RPCDCSSummary::totalDCSFraction
MonitorElement * totalDCSFraction
Definition: RPCDCSSummary.h:36
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116