File indexing completed on 2024-04-06 12:32:54
0001 #include "DataFormats/Common/interface/Handle.h"
0002 #include "Validation/MuonME0Validation/interface/ME0BaseValidation.h"
0003
0004 using namespace std;
0005 ME0BaseValidation::ME0BaseValidation(const edm::ParameterSet &ps) {
0006 nBinZR_ = ps.getUntrackedParameter<std::vector<double>>("nBinGlobalZR");
0007 RangeZR_ = ps.getUntrackedParameter<std::vector<double>>("RangeGlobalZR");
0008 nBinXY_ = ps.getUntrackedParameter<int>("nBinGlobalXY", 160);
0009
0010 regionLabel.push_back("-1");
0011 regionLabel.push_back("1");
0012
0013 layerLabel.push_back("1");
0014 layerLabel.push_back("2");
0015 layerLabel.push_back("3");
0016 layerLabel.push_back("4");
0017 layerLabel.push_back("5");
0018 layerLabel.push_back("6");
0019 geomToken_ = esConsumes<ME0Geometry, MuonGeometryRecord>();
0020 }
0021
0022 ME0BaseValidation::~ME0BaseValidation() {}
0023
0024 ME0BaseValidation::MonitorElement *ME0BaseValidation::BookHistZR(
0025 DQMStore::IBooker &ibooker, const char *name, const char *label, unsigned int region_num, unsigned int layer_num) {
0026 string hist_name, hist_label;
0027 if (layer_num == 0 || layer_num == 1 || layer_num == 2 || layer_num == 3 || layer_num == 4 || layer_num == 5 ||
0028 layer_num == 6) {
0029 hist_name = name + string("_zr_r") + regionLabel[region_num] + "_l" + layerLabel[layer_num];
0030 hist_label = label + string(" occupancy : region") + regionLabel[region_num] + " layer " + layerLabel[layer_num] +
0031 " " + " ; globalZ [cm]; globalR[cm]";
0032 } else {
0033 hist_name = name + string("_zr_r") + regionLabel[region_num];
0034 hist_label = label + string(" occupancy : region") + regionLabel[region_num] + " ; globalZ [cm]; globalR[cm]";
0035 }
0036 int xbin = (int)nBinZR_[0];
0037 int ybin = (int)nBinZR_[1];
0038 double xmin = 0;
0039 double xmax = 0;
0040 double ymin = 0;
0041 double ymax = 0;
0042 ymin = RangeZR_[RangeZR_.size() / 2 + 0];
0043 ;
0044 ymax = RangeZR_[RangeZR_.size() / 2 + 1];
0045 ;
0046 if (region_num == 0) {
0047 xmin = -RangeZR_[1];
0048 xmax = -RangeZR_[0];
0049 } else {
0050 xmin = RangeZR_[0];
0051 xmax = RangeZR_[1];
0052 }
0053 return ibooker.book2D(hist_name, hist_label, xbin, xmin, xmax, ybin, ymin, ymax);
0054 }
0055
0056 ME0BaseValidation::MonitorElement *ME0BaseValidation::BookHistXY(
0057 DQMStore::IBooker &ibooker, const char *name, const char *label, unsigned int region_num, unsigned int layer_num) {
0058 string hist_name, hist_label;
0059 if (layer_num == 0 || layer_num == 1 || layer_num == 2 || layer_num == 3 || layer_num == 4 || layer_num == 5 ||
0060 layer_num == 6) {
0061 hist_name = name + string("_xy_r") + regionLabel[region_num] + "_l" + layerLabel[layer_num];
0062 hist_label = label + string(" occupancy : region") + regionLabel[region_num] + " layer " + layerLabel[layer_num] +
0063 " " + " ; globalX [cm]; globalY[cm]";
0064 } else {
0065 hist_name = name + string("_xy_r") + regionLabel[region_num];
0066 hist_label = label + string(" occupancy : region") + regionLabel[region_num] + " ; globalX [cm]; globalY[cm]";
0067 }
0068 return ibooker.book2D(hist_name, hist_label, nBinXY_, -160, 160, nBinXY_, -160, 160);
0069 }