11 if ( GEMGeometry_ ==
nullptr)
return ;
12 int npadsGE11 = GEMGeometry_->
regions()[0]->stations()[0]->superChambers()[0]->chambers()[0]->etaPartitions()[0]->npads();
17 std::vector<const GEMStation*>::const_iterator it = GEMGeometry_->
regions()[0]->stations().end();
19 npadsGE21 = (*it)->superChambers()[0]->chambers()[0]->etaPartitions()[0]->npads();
27 TString simpleZR_title = TString::Format(
"ZR Occupancy%s; |Z|(cm) ; R(cm)",title_suffix.Data());
28 TString simpleZR_histname = TString::Format(
"pad_simple_zr%s",histname_suffix.Data());
30 auto* simpleZR =
getSimpleZR(ibooker, simpleZR_title, simpleZR_histname);
31 if ( simpleZR !=
nullptr) {
39 TString dcEta_title = TString::Format(
"Occupancy for detector component %s;;#eta-partition",title_suffix2.Data());
40 TString dcEta_histname = TString::Format(
"pad_dcEta%s",histname_suffix2.Data());
43 if ( dcEta !=
nullptr) {
53 int region_num = (re+1)/2;
56 int station_num = st-1;
57 if ( station_num == 0 ) nPads = npadsGE11;
58 else nPads = npadsGE21;
59 for(
int la = 1 ; la <= 2 ; la++) {
63 theCSCPad_phipad[region_num][station_num][layer_num] = ibooker.
book2D( (
"pad_dg_phipad"+name_prefix).c_str(), (
"Digi occupancy: "+label_prefix+
"; phi [rad]; Pad number").c_str(), 280,-
TMath::Pi(),
TMath::Pi(), nPads/2,0,nPads );
64 theCSCPad[region_num][station_num][layer_num] = ibooker.
book1D( (
"pad_dg"+name_prefix).c_str(), (
"Digi occupancy per pad number: "+label_prefix+
";Pad number; entries").c_str(), nPads,0.5,nPads+0.5);
65 theCSCPad_bx[region_num][station_num][layer_num] = ibooker.
book1D( (
"pad_dg_bx"+name_prefix).c_str(), (
"Bunch crossing: "+label_prefix+
"; bunch crossing ; entries").c_str(), 11,-5.5,5.5);
66 theCSCPad_zr[region_num][station_num][layer_num] =
BookHistZR(ibooker,
"pad_dg",
"Pad Digi",region_num,station_num,layer_num);
67 theCSCPad_xy[region_num][station_num][layer_num] =
BookHistXY(ibooker,
"pad_dg",
"Pad Digi",region_num,station_num,layer_num);
68 TString xy_name = TString::Format(
"pad_dg_xy%s_odd",name_prefix.c_str());
69 TString xy_title = TString::Format(
"Digi XY occupancy %s at odd chambers",label_prefix.c_str());
71 xy_name = TString::Format(
"pad_dg_xy%s_even",name_prefix.c_str());
72 xy_title = TString::Format(
"Digi XY occupancy %s at even chambers",label_prefix.c_str());
73 theCSCPad_xy_ch[ xy_name.Hash()] = ibooker.
book2D(xy_name, xy_title, 360, -360,360, 360, -360, 360);
94 GEMGeometry_ = &*hGeom;
97 edm::LogError(
"GEMPadDigiValidaation") <<
"+++ Error : GEM geometry is unavailable on event loop. +++\n";
103 edm::LogError(
"GEMPadDigiValidation") <<
"Cannot get pads by label GEMPadToken.";
111 if ( gdet ==
nullptr) {
112 std::cout<<
"Getting DetId failed. Discard this gem pad hit.Maybe it comes from unmatched geometry."<<std::endl;
118 int re =
id.region();
120 int st =
id.station();
121 Short_t chamber = (Short_t)
id.chamber();
122 Short_t nroll = (Short_t)
id.roll();
127 for (digiItr = (*cItr ).second.first; digiItr != (*cItr ).second.second; ++digiItr)
129 Short_t pad = (Short_t) digiItr->
pad();
130 Short_t bx = (Short_t) digiItr->bx();
135 Float_t g_r = (Float_t) gp.
perp();
136 Float_t g_phi = (Float_t) gp.
phi();
137 Float_t g_x = (Float_t) gp.
x();
138 Float_t g_y = (Float_t) gp.
y();
139 Float_t g_z = (Float_t) gp.
z();
140 edm::LogInfo(
"GEMPadDIGIValidation")<<
"Global x "<<g_x<<
"Global y "<<g_y<<
"\n";
141 edm::LogInfo(
"GEMPadDIGIValidation")<<
"Global pad "<<pad<<
"Global phi "<<g_phi<<std::endl;
142 edm::LogInfo(
"GEMPadDIGIValidation")<<
"Global bx "<<bx<<std::endl;
144 int region_num = (re+1)/2;
145 int station_num = st-1;
146 int layer_num = la-1;
147 int binX = (chamber-1)*2+layer_num;
152 TString simple_zr_histname = TString::Format(
"pad_simple_zr%s",histname_suffix.Data());
156 TString dcEta_histname = TString::Format(
"pad_dcEta%s",histname_suffix.Data());
167 if ( chamber %2 == 0 ) { hname = TString::Format(
"pad_dg_xy%s_even",name_prefix.c_str()); }
168 else { hname = TString::Format(
"pad_dg_xy%s_odd",name_prefix.c_str()); }
MonitorElement * theCSCPad_zr[2][3][2]
T getParameter(std::string const &) const
MonitorElement * theCSCPad[2][3][2]
MonitorElement * theCSCPad_xy[2][3][2]
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 * > thePad_dcEta
std::unordered_map< UInt_t, MonitorElement * > theCSCPad_xy_ch
edm::EDGetToken InputTagToken_
virtual const GeomDet * idToDet(DetId) const override
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 GEMEtaPartition * etaPartition(GEMDetId id) const
Return a GEMEtaPartition given its id.
const GEMGeometry * initGeometry(const edm::EventSetup &)
std::string getSuffixName(int region, int station, int layer)
GEMPadDigiValidation(const edm::ParameterSet &)
const std::vector< const GEMRegion * > & regions() const
Return a vector of all GEM regions.
MonitorElement * book1D(Args &&...args)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * theCSCPad_bx[2][3][2]
MonitorElement * book2D(Args &&...args)
std::vector< GEMPadDigi >::const_iterator const_iterator
MonitorElement * getDCEta(DQMStore::IBooker &, const GEMStation *, TString, TString)
return(e1-e2)*(e1-e2)+dp *dp
std::unordered_map< UInt_t, MonitorElement * > thePad_simple_zr
void analyze(const edm::Event &e, const edm::EventSetup &) override
MonitorElement * theCSCPad_phipad[2][3][2]