15 if (GEMGeometry_ ==
nullptr)
17 LogDebug(
"GEMStripDigiValidation") <<
"Geometry is acquired from MuonGeometryRecord\n";
19 LogDebug(
"GEMStripDigiValidation") <<
"ibooker set current folder\n";
21 LogDebug(
"GEMStripDigiValidation") <<
"nregions set.\n";
22 LogDebug(
"GEMStripDigiValidation") <<
"nstations set.\n";
23 int nstripsGE11 = 384;
24 int nstripsGE21 = 768;
26 LogDebug(
"GEMStripDigiValidation") <<
"Successfully binning set.\n";
30 for (
auto ®ion : GEMGeometry_->
regions()) {
31 int re = region->region();
34 TString simpleZR_title = TString::Format(
"ZR Occupancy%s; |Z|(cm) ; R(cm)", title_suffix.Data());
35 TString simpleZR_histname = TString::Format(
"strip_simple_zr%s", histname_suffix.Data());
37 auto *simpleZR =
getSimpleZR(ibooker, simpleZR_title, simpleZR_histname);
38 if (simpleZR !=
nullptr) {
42 for (
auto &
station : region->stations()) {
48 TString::Format(
"Occupancy for detector component %s;;#eta-partition", title_suffix2.Data());
49 TString dcEta_histname = TString::Format(
"strip_dcEta%s", histname_suffix2.Data());
52 if (dcEta !=
nullptr) {
60 for (
auto ®ion : GEMGeometry_->
regions()) {
61 for (
auto &
station : region->stations()) {
62 for (
int la = 1; la <= 2; la++) {
63 int re = region->region();
65 int region_num = (re + 1) / 2;
66 int station_num = st - 1;
67 int layer_num = la - 1;
70 nstrips = nstripsGE11;
72 nstrips = nstripsGE21;
76 ibooker.
book2D((
"strip_dg_phistrip" + name_prefix).c_str(),
77 (
"Digi occupancy: " + label_prefix +
"; phi [rad];strip number").c_str(),
84 theStrip[region_num][station_num][layer_num] =
85 ibooker.
book1D((
"strip_dg" + name_prefix).c_str(),
86 (
"Digi occupancy per stip number: " + label_prefix +
";strip number; entries").c_str(),
91 ibooker.
book1D((
"strip_dg_bx" + name_prefix).c_str(),
92 (
"Bunch crossing: " + label_prefix +
"; bunch crossing ; entries").c_str(),
97 BookHistZR(ibooker,
"strip_dg",
"Strip Digi", region_num, station_num, layer_num);
99 BookHistXY(ibooker,
"strip_dg",
"Strip Digi", region_num, station_num, layer_num);
100 TString xy_name = TString::Format(
"strip_dg_xy%s_odd", name_prefix.c_str());
101 TString xy_title = TString::Format(
"Digi XY occupancy %s at odd chambers", label_prefix.c_str());
102 theStrip_xy_ch[xy_name.Hash()] = ibooker.
book2D(xy_name, xy_title, 360, -360, 360, 360, -360, 360);
103 xy_name = TString::Format(
"strip_dg_xy%s_even", name_prefix.c_str());
104 xy_title = TString::Format(
"Digi XY occupancy %s at even chambers", label_prefix.c_str());
105 theStrip_xy_ch[xy_name.Hash()] = ibooker.
book2D(xy_name, xy_title, 360, -360, 360, 360, -360, 360);
110 LogDebug(
"GEMStripDigiValidation") <<
"Booking End.\n";
120 GEMGeometry_ = &*hGeom;
122 edm::LogError(
"GEMStripDigiValidation") <<
"+++ Error : GEM geometry is unavailable on event loop. +++\n";
129 edm::LogError(
"GEMStripDigiValidation") <<
"Cannot get strips by Token stripToken.\n";
136 if (gdet ==
nullptr) {
137 std::cout <<
"Getting DetId failed. Discard this gem strip hit.Maybe it " 138 "comes from unmatched geometry." 145 int re =
id.region();
147 int st =
id.station();
149 Short_t nroll = (Short_t)
id.roll();
152 for (digiItr = (*cItr).second.first; digiItr != (*cItr).second.second; ++digiItr) {
153 Short_t
strip = (Short_t)digiItr->strip();
154 Short_t bx = (Short_t)digiItr->bx();
159 Float_t g_r = (Float_t)gp.
perp();
161 Float_t g_phi = (Float_t)gp.
phi();
162 Float_t g_x = (Float_t)gp.
x();
163 Float_t g_y = (Float_t)gp.
y();
164 Float_t g_z = (Float_t)gp.
z();
166 int region_num = (re + 1) / 2;
167 int station_num = st - 1;
168 int layer_num = la - 1;
170 int binX = (chamber - 1) * 2 + layer_num;
175 TString simple_zr_histname = TString::Format(
"strip_simple_zr%s", histname_suffix.Data());
179 TString dcEta_histname = TString::Format(
"strip_dcEta%s", histname_suffix.Data());
184 if (
theStrip_xy[region_num][station_num][layer_num] !=
nullptr) {
187 theStrip[region_num][station_num][layer_num]->
Fill(strip);
193 if (chamber % 2 == 0) {
194 hname = TString::Format(
"strip_dg_xy%s_even", name_prefix.c_str());
196 hname = TString::Format(
"strip_dg_xy%s_odd", name_prefix.c_str());
200 std::cout <<
"Error is occued when histograms is called." << std::endl;
T getParameter(std::string const &) const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * BookHistZR(DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int station_num, unsigned int layer_num=99)
edm::EDGetToken InputTagToken_
Geom::Phi< T > phi() const
std::unordered_map< UInt_t, MonitorElement * > theStrip_dcEta
MonitorElement * theStrip_bx[2][3][2]
MonitorElement * getSimpleZR(DQMStore::IBooker &, TString, TString)
MonitorElement * BookHistXY(DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int station_num, unsigned int layer_num=99)
void analyze(const edm::Event &e, const edm::EventSetup &) override
GEMStripDigiValidation(const edm::ParameterSet &)
MonitorElement * theStrip_phistrip[2][3][2]
std::string getSuffixTitle(int region, int station, int layer)
const Plane & surface() const
The nominal surface of the GeomDet.
const GEMEtaPartition * etaPartition(GEMDetId id) const
Return a GEMEtaPartition given its id.
const GEMGeometry * initGeometry(const edm::EventSetup &)
MonitorElement * theStrip[2][3][2]
std::string getSuffixName(int region, int station, int layer)
void setCurrentFolder(std::string const &fullpath)
const std::vector< const GEMRegion * > & regions() const
Return a vector of all GEM regions.
MonitorElement * book1D(Args &&...args)
MonitorElement * book2D(Args &&...args)
std::unordered_map< UInt_t, MonitorElement * > theStrip_xy_ch
const GeomDet * idToDet(DetId) const override
std::vector< DigiType >::const_iterator const_iterator
MonitorElement * getDCEta(DQMStore::IBooker &, const GEMStation *, TString, TString)
MonitorElement * theStrip_zr[2][3][2]
~GEMStripDigiValidation() override
std::unordered_map< UInt_t, MonitorElement * > theStrip_simple_zr
MonitorElement * theStrip_xy[2][3][2]