16 int npadsGE11 = GEMGeometry_->
regions()[0]->stations()[0]->superChambers()[0]->chambers()[0]->etaPartitions()[0]->npads();
21 npadsGE21 = GEMGeometry_->
regions()[0]->stations()[1]->superChambers()[0]->chambers()[0]->etaPartitions()[0]->npads();
24 for(
auto& region : GEMGeometry_->
regions() ){
25 int re = region->region();
28 TString simpleZR_title = TString::Format(
"Copad ZR Occupancy%s; |Z|(cm) ; R(cm)",title_suffix.Data());
29 TString simpleZR_histname = TString::Format(
"copad_simple_zr%s",histname_suffix.Data());
31 auto* simpleZR =
getSimpleZR(ibooker, simpleZR_title, simpleZR_histname);
32 if ( simpleZR !=
nullptr) {
35 for(
auto&
station : region->stations()) {
40 TString dcEta_title = TString::Format(
"Copad's occupancy for detector component %s; # of sub-detector ;#eta-partition",title_suffix2.Data());
41 TString dcEta_histname = TString::Format(
"copad_dcEta%s",histname_suffix2.Data());
44 if ( dcEta !=
nullptr) {
50 for(
auto& region : GEMGeometry_->
regions() ) {
51 int re = region->region();
52 int region_num = (re+1)/2;
55 for(
auto&
station : region->stations() ) {
57 int station_num = st-1;
59 if ( st == 1 ) nPads = npadsGE11;
60 else nPads = npadsGE21;
63 theCSCCoPad_phipad[region_num][station_num] = ibooker.
book2D( (
"copad_dg_phipad"+name_prefix).c_str(), (
"Digi occupancy: "+label_prefix+
"; phi [rad]; Pad number").c_str(), 280,-PI,PI, nPads/2,0,nPads );
64 theCSCCoPad[region_num][station_num] = ibooker.
book1D( (
"copad_dg"+name_prefix).c_str(), (
"Digi occupancy per pad number: "+label_prefix+
";Pad number; entries").c_str(), nPads,0.5,nPads+0.5);
65 theCSCCoPad_bx[region_num][station_num] = ibooker.
book1D( (
"copad_dg_bx"+name_prefix).c_str(), (
"Bunch crossing: "+label_prefix+
"; bunch crossing ; entries").c_str(), 11,-5.5,5.5);
68 TString xy_name = TString::Format(
"copad_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(
"copad_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 theCSCCoPad_xy_ch[ xy_name.Hash()] = ibooker.
book2D(xy_name, xy_title, 360, -360,360, 360, -360, 360);
94 GEMGeometry_ = &*hGeom;
97 edm::LogError(
"GEMCoPadDigiValidation") <<
"+++ Error : GEM geometry is unavailable on event loop. +++\n";
103 edm::LogError(
"GEMCoPadDigiValidation") <<
"Cannot get pads by token.";
110 int st =
id.station();
115 for (digiItr = (*cItr ).second.first; digiItr != (*cItr ).second.second; ++digiItr)
118 Short_t nroll = roId.
roll();
119 LogDebug(
"GEMCoPadDigiValidation")<<
"roId : "<<roId;
121 if ( gdet ==
nullptr) {
122 edm::LogError(
"GEMCoPadDigiValidation")<<roId<<
" : This part can not load from GEMGeometry // Original"<<
id<<
" station : "<<st;
123 edm::LogError(
"GEMCoPadDigiValidation")<<
"Getting DetId failed. Discard this gem copad hit.Maybe it comes from unmatched geometry between GEN and DIGI.";
128 LogDebug(
"GEMCoPadDigiValidation")<<
" roll's n pad : "<<roll->
npads();
130 Short_t pad1 = (Short_t) digiItr->pad(1);
131 Short_t pad2 = (Short_t) digiItr->pad(2);
132 Short_t bx1 = (Short_t) digiItr->bx(1);
133 Short_t bx2 = (Short_t) digiItr->bx(2);
134 LogDebug(
"GEMCoPadDigiValidation")<<
" copad #1 pad : "<<pad1<<
" bx : "<<bx1;
135 LogDebug(
"GEMCoPadDigiValidation")<<
" copad #2 pad : "<<pad2<<
" bx : "<<bx2;
139 if ( bx2 < (Short_t)
minBXGEM_ || bx2 > (Short_t)maxBXGEM_)
continue;
146 Float_t g_r1 = (Float_t) gp1.
perp();
147 Float_t g_r2 = (Float_t) gp2.
perp();
148 Float_t g_z1 = (Float_t) gp1.
z();
149 Float_t g_z2 = (Float_t) gp2.
z();
151 Float_t g_phi = (Float_t) gp1.
phi();
152 Float_t g_x = (Float_t) gp1.
x();
153 Float_t g_y = (Float_t) gp1.
y();
156 if ( re == -1 ) region_num = 0 ;
157 else if (re == 1 ) region_num = 1;
159 edm::LogError(
"GEMCoPadDIGIValidation")<<
"region : "<<re<<std::endl;
161 int binX = (chamber-1)*2+(la-1);
163 int station_num = st-1;
167 TString simple_zr_histname = TString::Format(
"copad_simple_zr%s",histname_suffix.Data());
172 TString dcEta_histname = TString::Format(
"copad_dcEta%s",histname_suffix.Data());
187 if ( chamber %2 == 0 ) { hname = TString::Format(
"copad_dg_xy%s_even",name_prefix.c_str()); }
188 else { hname = TString::Format(
"copad_dg_xy%s_odd",name_prefix.c_str()); }
T getParameter(std::string const &) const
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)
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::unordered_map< UInt_t, MonitorElement * > theCSCCoPad_xy_ch
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)
GEMCoPadDigiValidation(const edm::ParameterSet &)
const std::vector< const GEMRegion * > & regions() const
Return a vector of all GEM regions.
std::unordered_map< UInt_t, MonitorElement * > theCoPad_dcEta
MonitorElement * book1D(Args &&...args)
int region() const
Region id: 0 for Barrel Not in use, +/-1 For +/- Endcap.
MonitorElement * theCSCCoPad_xy[2][3]
MonitorElement * theCSCCoPad[2][3]
~GEMCoPadDigiValidation()
MonitorElement * book2D(Args &&...args)
virtual const GeomDet * idToDet(DetId) const override
MonitorElement * theCSCCoPad_phipad[2][3]
MonitorElement * theCSCCoPad_bx[2][3]
std::vector< GEMCoPadDigi >::const_iterator const_iterator
MonitorElement * getDCEta(DQMStore::IBooker &, const GEMStation *, TString, TString)
return(e1-e2)*(e1-e2)+dp *dp
void analyze(const edm::Event &e, const edm::EventSetup &) override
std::unordered_map< UInt_t, MonitorElement * > theCoPad_simple_zr
edm::EDGetToken InputTagToken_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override