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 < 3) { //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  std::stringstream streams;
142  streams << "RPC_Disk" << i;
143  certDiskFractions[i + 2] = ibooker.bookFloat(streams.str());
145  }
146 }
T getUntrackedParameter(std::string const &, T const &) const
std::optional< T > tryToGet() const
Definition: EventSetup.h:94
void myBooker(DQMStore::IBooker &)
MonitorElement * bookFloat(TString const &name)
Definition: DQMStore.cc:233
MonitorElement * certWheelFractions[5]
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:418
~RPCDataCertification() override
Destructor.
void Fill(long long x)
MonitorElement * CertMap_
MonitorElement * totalCertFraction
std::pair< int, int > FEDRange_
RPCDataCertification(const edm::ParameterSet &pset)
Constructor.
std::vector< int > m_fed_in
Definition: RunInfo.h:25
double f[11][100]
MonitorElement * certDiskFractions[10]
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)
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
void checkFED(edm::EventSetup const &)
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Definition: DQMStore.cc:266
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override