14 if (GEMGeometry_ ==
nullptr)
16 LogDebug(
"GEMCoPadDigiValidation") <<
"Geometry is acquired from MuonGeometryRecord\n";
18 LogDebug(
"GEMCoPadDigiValidation") <<
"ibooker set current folder\n";
23 GEMGeometry_->
regions()[0]->stations()[0]->superChambers()[0]->chambers()[0]->etaPartitions()[0]->npads();
27 if (GEMGeometry_->
regions()[0]->stations().size() > 1 &&
28 !GEMGeometry_->
regions()[0]->stations()[1]->superChambers().empty()) {
30 GEMGeometry_->
regions()[0]->stations()[1]->superChambers()[0]->chambers()[0]->etaPartitions()[0]->npads();
33 for (
auto ®ion : GEMGeometry_->
regions()) {
34 int re = region->region();
37 TString simpleZR_title = TString::Format(
"Copad ZR Occupancy%s; |Z|(cm) ; R(cm)", title_suffix.Data());
38 TString simpleZR_histname = TString::Format(
"copad_simple_zr%s", histname_suffix.Data());
40 auto *simpleZR =
getSimpleZR(ibooker, simpleZR_title, simpleZR_histname);
41 if (simpleZR !=
nullptr) {
44 for (
auto &
station : region->stations()) {
49 TString dcEta_title = TString::Format(
50 "Copad's occupancy for detector component %s; # of " 51 "sub-detector ;#eta-partition",
52 title_suffix2.Data());
53 TString dcEta_histname = TString::Format(
"copad_dcEta%s", histname_suffix2.Data());
56 if (dcEta !=
nullptr) {
62 for (
auto ®ion : GEMGeometry_->
regions()) {
63 int re = region->region();
64 int region_num = (re + 1) / 2;
67 for (
auto &
station : region->stations()) {
69 int station_num = st - 1;
78 ibooker.
book2D((
"copad_dg_phipad" + name_prefix).c_str(),
79 (
"Digi occupancy: " + label_prefix +
"; phi [rad]; Pad number").c_str(),
87 ibooker.
book1D((
"copad_dg" + name_prefix).c_str(),
88 (
"Digi occupancy per pad number: " + label_prefix +
";Pad number; entries").c_str(),
93 ibooker.
book1D((
"copad_dg_bx" + name_prefix).c_str(),
94 (
"Bunch crossing: " + label_prefix +
"; bunch crossing ; entries").c_str(),
99 BookHistZR(ibooker,
"copad_dg",
"CoPad Digi", region_num, station_num);
101 BookHistXY(ibooker,
"copad_dg",
"CoPad Digi", region_num, station_num);
102 TString xy_name = TString::Format(
"copad_dg_xy%s_odd", name_prefix.c_str());
103 TString xy_title = TString::Format(
"Digi XY occupancy %s at odd chambers", label_prefix.c_str());
105 xy_name = TString::Format(
"copad_dg_xy%s_even", name_prefix.c_str());
106 xy_title = TString::Format(
"Digi XY occupancy %s at even chambers", label_prefix.c_str());
107 theCSCCoPad_xy_ch[xy_name.Hash()] = ibooker.
book2D(xy_name, xy_title, 360, -360, 360, 360, -360, 360);
121 GEMGeometry_ = &*hGeom;
123 edm::LogError(
"GEMCoPadDigiValidation") <<
"+++ Error : GEM geometry is unavailable on event loop. +++\n";
129 edm::LogError(
"GEMCoPadDigiValidation") <<
"Cannot get pads by token.";
136 int st =
id.station();
141 for (digiItr = (*cItr).second.first; digiItr != (*cItr).second.second; ++digiItr) {
144 Short_t nroll = (*digiItr).roll();
145 LogDebug(
"GEMCoPadDigiValidation") <<
"schId : " << schId;
147 if (gdet ==
nullptr) {
149 << schId <<
" : This detId cannot be loaded from GEMGeometry // Original" <<
id <<
" station : " << st;
150 edm::LogError(
"GEMCoPadDigiValidation") <<
"Getting DetId failed. Discard this gem copad hit. ";
155 LogDebug(
"GEMCoPadDigiValidation") <<
" #pads in this partition : " 158 Short_t pad1 = (Short_t)digiItr->pad(1);
159 Short_t pad2 = (Short_t)digiItr->pad(2);
160 Short_t bx1 = (Short_t)digiItr->bx(1);
161 Short_t bx2 = (Short_t)digiItr->bx(2);
162 LogDebug(
"GEMCoPadDigiValidation") <<
" copad #1 pad : " << pad1 <<
" bx : " << bx1;
163 LogDebug(
"GEMCoPadDigiValidation") <<
" copad #2 pad : " << pad2 <<
" bx : " << bx2;
168 if (bx2 < (Short_t)
minBXGEM_ || bx2 > (Short_t)maxBXGEM_)
176 Float_t g_r1 = (Float_t)gp1.
perp();
177 Float_t g_r2 = (Float_t)gp2.
perp();
178 Float_t g_z1 = (Float_t)gp1.
z();
179 Float_t g_z2 = (Float_t)gp2.
z();
181 Float_t g_phi = (Float_t)gp1.
phi();
182 Float_t g_x = (Float_t)gp1.
x();
183 Float_t g_y = (Float_t)gp1.
y();
191 edm::LogError(
"GEMCoPadDigiValidation") <<
"region : " << re << std::endl;
193 int binX = (chamber - 1) * 2 + la;
195 int station_num = st - 1;
199 TString simple_zr_histname = TString::Format(
"copad_simple_zr%s", histname_suffix.Data());
204 TString dcEta_histname = TString::Format(
"copad_dcEta%s", histname_suffix.Data());
219 if (chamber % 2 == 0) {
220 hname = TString::Format(
"copad_dg_xy%s_even", name_prefix.c_str());
222 hname = TString::Format(
"copad_dg_xy%s_odd", name_prefix.c_str());
T getParameter(std::string const &) const
const GEMChamber * chamber(GEMDetId id) const
Return the chamber corresponding to the given id.
MonitorElement * theCSCCoPad_zr[2][3]
MonitorElement * BookHistZR(DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int station_num, unsigned int layer_num=99)
std::unordered_map< UInt_t, MonitorElement * > theCSCCoPad_xy_ch
Geom::Phi< T > phi() const
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)
std::string getSuffixTitle(int region, int station, int layer)
const Plane & surface() const
The nominal surface of the GeomDet.
const GEMGeometry * initGeometry(const edm::EventSetup &)
std::string getSuffixName(int region, int station, int layer)
GEMCoPadDigiValidation(const edm::ParameterSet &)
void setCurrentFolder(std::string const &fullpath)
~GEMCoPadDigiValidation() override
const std::vector< const GEMRegion * > & regions() const
Return a vector of all GEM regions.
MonitorElement * book1D(Args &&...args)
int region() const
Region id: 0 for Barrel Not in use, +/-1 For +/- Endcap.
const GEMSuperChamber * superChamber(GEMDetId id) const
MonitorElement * theCSCCoPad_xy[2][3]
MonitorElement * theCSCCoPad[2][3]
MonitorElement * book2D(Args &&...args)
const GeomDet * idToDet(DetId) const override
MonitorElement * theCSCCoPad_phipad[2][3]
MonitorElement * theCSCCoPad_bx[2][3]
std::vector< DigiType >::const_iterator const_iterator
MonitorElement * getDCEta(DQMStore::IBooker &, const GEMStation *, TString, TString)
std::unordered_map< UInt_t, MonitorElement * > theCoPad_dcEta
void analyze(const edm::Event &e, const edm::EventSetup &) override
const GEMEtaPartition * etaPartition(GEMDetId id) const
Return the eta partition corresponding to the given id.
edm::EDGetToken InputTagToken_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::unordered_map< UInt_t, MonitorElement * > theCoPad_simple_zr