14 if ( GEMGeometry_ ==
nullptr)
return ;
15 LogDebug(
"GEMStripDIGIValidation")<<
"Geometry is acquired from MuonGeometryRecord\n";
17 LogDebug(
"GEMStripDIGIValidation")<<
"ibooker set current folder\n";
19 LogDebug(
"GEMStripDIGIValidation")<<
"nregions set.\n";
20 LogDebug(
"GEMStripDIGIValidation")<<
"nstations set.\n";
21 int nstripsGE11 = 384;
22 int nstripsGE21 = 768;
24 LogDebug(
"GEMStripDIGIValidation")<<
"Successfully binning set.\n";
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) {
47 TString dcEta_title = TString::Format(
"Occupancy for detector component %s;;#eta-partition",title_suffix2.Data());
48 TString dcEta_histname = TString::Format(
"strip_dcEta%s",histname_suffix2.Data());
51 if ( dcEta !=
nullptr) {
61 for(
int la = 1 ; la <= 2 ; la++) {
64 int region_num = (re+1)/2;
65 int station_num = st-1;
68 if ( st ==1 ) nstrips = nstripsGE11;
69 else nstrips = nstripsGE21;
72 theStrip_phistrip[region_num][station_num][layer_num] = ibooker.
book2D( (
"strip_dg_phistrip"+name_prefix).c_str(), (
"Digi occupancy: "+label_prefix+
"; phi [rad];strip number").c_str(), 280, -
TMath::Pi(),
TMath::Pi(), nstrips/2,0,nstrips);
73 theStrip[region_num][station_num][layer_num] = ibooker.
book1D( (
"strip_dg"+name_prefix).c_str(), (
"Digi occupancy per stip number: "+label_prefix+
";strip number; entries").c_str(), nstrips,0.5,nstrips+0.5);
74 theStrip_bx[region_num][station_num][layer_num] = ibooker.
book1D( (
"strip_dg_bx"+name_prefix).c_str(), (
"Bunch crossing: "+label_prefix+
"; bunch crossing ; entries").c_str(), 11,-5.5,5.5);
75 theStrip_zr[region_num][station_num][layer_num] =
BookHistZR(ibooker,
"strip_dg",
"Strip Digi",region_num,station_num,layer_num);
76 theStrip_xy[region_num][station_num][layer_num] =
BookHistXY(ibooker,
"strip_dg",
"Strip Digi",region_num,station_num,layer_num);
77 TString xy_name = TString::Format(
"strip_dg_xy%s_odd",name_prefix.c_str());
78 TString xy_title = TString::Format(
"Digi XY occupancy %s at odd chambers",label_prefix.c_str());
79 theStrip_xy_ch[ xy_name.Hash() ] = ibooker.
book2D(xy_name, xy_title, 360, -360,360, 360, -360, 360);
80 xy_name = TString::Format(
"strip_dg_xy%s_even",name_prefix.c_str());
81 xy_title = TString::Format(
"Digi XY occupancy %s at even chambers",label_prefix.c_str());
82 theStrip_xy_ch[ xy_name.Hash() ] = ibooker.
book2D(xy_name, xy_title, 360, -360,360, 360, -360, 360);
87 LogDebug(
"GEMStripDIGIValidation")<<
"Booking End.\n";
101 GEMGeometry_ = &*hGeom;
104 edm::LogError(
"MuonGEMStripDigis") <<
"+++ Error : GEM geometry is unavailable on event loop. +++\n";
111 edm::LogError(
"GEMStripDigiValidation") <<
"Cannot get strips by Token stripToken.\n";
118 if ( gdet ==
nullptr) {
119 std::cout<<
"Getting DetId failed. Discard this gem strip hit.Maybe it comes from unmatched geometry."<<std::endl;
125 int re =
id.region();
127 int st =
id.station();
128 Short_t chamber = (Short_t)
id.chamber();
129 Short_t nroll = (Short_t)
id.roll();
132 for (digiItr = (*cItr ).second.first; digiItr != (*cItr ).second.second; ++digiItr)
134 Short_t strip = (Short_t) digiItr->
strip();
135 Short_t bx = (Short_t) digiItr->bx();
140 Float_t g_r = (Float_t) gp.
perp();
142 Float_t g_phi = (Float_t) gp.
phi();
143 Float_t g_x = (Float_t) gp.
x();
144 Float_t g_y = (Float_t) gp.
y();
145 Float_t g_z = (Float_t) gp.
z();
148 int region_num = (re+1)/2;
149 int station_num = st-1;
150 int layer_num = la-1;
152 int binX = (chamber-1)*2+layer_num;
157 TString simple_zr_histname = TString::Format(
"strip_simple_zr%s",histname_suffix.Data());
162 TString dcEta_histname = TString::Format(
"strip_dcEta%s",histname_suffix.Data());
167 if (
theStrip_xy[region_num][station_num][layer_num] !=
nullptr) {
170 theStrip[region_num][station_num][layer_num]->
Fill(strip);
176 if ( chamber %2 == 0 ) { hname = TString::Format(
"strip_dg_xy%s_even",name_prefix.c_str()); }
177 else { hname = TString::Format(
"strip_dg_xy%s_odd",name_prefix.c_str()); }
181 std::cout<<
"Error is occued when histograms is called."<<std::endl;
T getParameter(std::string const &) const
std::unordered_map< UInt_t, MonitorElement * > theStrip_xy_ch
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_
virtual const GeomDet * idToDet(DetId) const override
Geom::Phi< T > phi() const
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
std::unordered_map< UInt_t, MonitorElement * > theStrip_dcEta
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]
~GEMStripDigiValidation()
std::string getSuffixName(int region, int station, int layer)
const std::vector< const GEMRegion * > & regions() const
Return a vector of all GEM regions.
MonitorElement * book1D(Args &&...args)
std::unordered_map< UInt_t, MonitorElement * > theStrip_simple_zr
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
std::vector< GEMDigi >::const_iterator const_iterator
MonitorElement * getDCEta(DQMStore::IBooker &, const GEMStation *, TString, TString)
MonitorElement * theStrip_zr[2][3][2]
return(e1-e2)*(e1-e2)+dp *dp
MonitorElement * theStrip_xy[2][3][2]