CMS 3D CMS Logo

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