CMS 3D CMS Logo

ME0BaseValidation.cc
Go to the documentation of this file.
3 
4 using namespace std;
6  nBinZR_ = ps.getUntrackedParameter<std::vector<double>>("nBinGlobalZR");
7  RangeZR_ = ps.getUntrackedParameter<std::vector<double>>("RangeGlobalZR");
8  nBinXY_ = ps.getUntrackedParameter<int>("nBinGlobalXY", 160);
9 
10  regionLabel.push_back("-1");
11  regionLabel.push_back("1");
12 
13  layerLabel.push_back("1");
14  layerLabel.push_back("2");
15  layerLabel.push_back("3");
16  layerLabel.push_back("4");
17  layerLabel.push_back("5");
18  layerLabel.push_back("6");
19  geomToken_ = esConsumes<ME0Geometry, MuonGeometryRecord>();
20 }
21 
23 
25  DQMStore::IBooker &ibooker, const char *name, const char *label, unsigned int region_num, unsigned int layer_num) {
26  string hist_name, hist_label;
27  if (layer_num == 0 || layer_num == 1 || layer_num == 2 || layer_num == 3 || layer_num == 4 || layer_num == 5 ||
28  layer_num == 6) {
29  hist_name = name + string("_zr_r") + regionLabel[region_num] + "_l" + layerLabel[layer_num];
30  hist_label = label + string(" occupancy : region") + regionLabel[region_num] + " layer " + layerLabel[layer_num] +
31  " " + " ; globalZ [cm]; globalR[cm]";
32  } else {
33  hist_name = name + string("_zr_r") + regionLabel[region_num];
34  hist_label = label + string(" occupancy : region") + regionLabel[region_num] + " ; globalZ [cm]; globalR[cm]";
35  }
36  int xbin = (int)nBinZR_[0];
37  int ybin = (int)nBinZR_[1];
38  double xmin = 0;
39  double xmax = 0;
40  double ymin = 0;
41  double ymax = 0;
42  ymin = RangeZR_[RangeZR_.size() / 2 + 0];
43  ;
44  ymax = RangeZR_[RangeZR_.size() / 2 + 1];
45  ;
46  if (region_num == 0) {
47  xmin = -RangeZR_[1];
48  xmax = -RangeZR_[0];
49  } else {
50  xmin = RangeZR_[0];
51  xmax = RangeZR_[1];
52  }
53  return ibooker.book2D(hist_name, hist_label, xbin, xmin, xmax, ybin, ymin, ymax);
54 }
55 
57  DQMStore::IBooker &ibooker, const char *name, const char *label, unsigned int region_num, unsigned int layer_num) {
58  string hist_name, hist_label;
59  if (layer_num == 0 || layer_num == 1 || layer_num == 2 || layer_num == 3 || layer_num == 4 || layer_num == 5 ||
60  layer_num == 6) {
61  hist_name = name + string("_xy_r") + regionLabel[region_num] + "_l" + layerLabel[layer_num];
62  hist_label = label + string(" occupancy : region") + regionLabel[region_num] + " layer " + layerLabel[layer_num] +
63  " " + " ; globalX [cm]; globalY[cm]";
64  } else {
65  hist_name = name + string("_xy_r") + regionLabel[region_num];
66  hist_label = label + string(" occupancy : region") + regionLabel[region_num] + " ; globalX [cm]; globalY[cm]";
67  }
68  return ibooker.book2D(hist_name, hist_label, nBinXY_, -160, 160, nBinXY_, -160, 160);
69 }
ME0BaseValidation(const edm::ParameterSet &ps)
~ME0BaseValidation() override
MonitorElement * BookHistZR(DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int layer_num=99)
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * BookHistXY(DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int layer_num=99)
char const * label
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:221