CMS 3D CMS Logo

GEMCheckGeometry.cc
Go to the documentation of this file.
9 
10 #include <iomanip>
11 
13  GE11PhiBegin_ = gc.getUntrackedParameter<double>("GE11PhiBegin", -5.);
14  GE11PhiStep_ = gc.getUntrackedParameter<double>("GE11PhiStep", 10);
15  minPhi_ = gc.getUntrackedParameter<double>("minPhi", -180.);
16  maxPhi_ = gc.getUntrackedParameter<double>("maxPhi", +180.);
17  detailPlot_ = gc.getParameter<bool>("detailPlot");
18 }
19 
21  if (!detailPlot_)
22  return;
23  const GEMGeometry *GEMGeometry_;
24 
25  try {
27  iSetup.get<MuonGeometryRecord>().get(hGeom);
28  GEMGeometry_ = &*hGeom;
30  edm::LogError("MuonGEMGeometry") << "+++ Error : GEM geometry is unavailable on event loop. +++\n";
31  return;
32  }
33 
34  ibooker.setCurrentFolder("MuonGEMDigisV/GEMDigisTask");
35  LogDebug("GEMCheckGeometry") << "ibooker set current folder\n";
36 
37  for (auto region : GEMGeometry_->regions()) {
38  TString title = TString::Format("Geometry's phi distribution on Region %d ; #phi(degree); ;", region->region());
39  TString name = TString::Format("geo_phi_r%d", region->region());
40  auto temp_me = ibooker.book2D(name.Data(), title.Data(), 360000, -180., 180, 12, 1, 13);
41  temp_me->setBinLabel(1, "St1,La1_even", 2);
42  temp_me->setBinLabel(2, "St1,La1_odd", 2);
43  temp_me->setBinLabel(3, "St1,La2_even", 2);
44  temp_me->setBinLabel(4, "St1,La2_odd", 2);
45  temp_me->setBinLabel(5, "St2,La1_even", 2);
46  temp_me->setBinLabel(6, "St2,La1_odd", 2);
47  temp_me->setBinLabel(7, "St2,La2_even", 2);
48  temp_me->setBinLabel(8, "St2,La2_odd", 2);
49  theStdPlots.insert(std::map<UInt_t, MonitorElement *>::value_type(name.Hash(), temp_me));
50  }
51 
52  for (auto region : GEMGeometry_->regions())
53  for (auto station : region->stations())
54  for (auto ring : station->rings())
55  for (auto sch : ring->superChambers())
56  for (auto ch : sch->chambers())
57  for (auto roll : ch->etaPartitions()) {
58  const StripTopology *topology(&(roll->specificTopology()));
59  auto parameters(roll->specs()->parameters());
60  float nStrips(parameters[3]);
61  for (int strip = 0; strip <= nStrips; strip++) {
62  LocalPoint lEdge(topology->localPosition(strip));
63  // double x = roll->toGlobal(lEdge).x();
64 
65  // double y = roll->toGlobal(lEdge).y();
66  // double z = roll->toGlobal(lEdge).z();
67  // double eta = roll->toGlobal(lEdge).eta();
68  double phi = roll->toGlobal(lEdge).phi().degrees();
69 
70  GEMDetId id(roll->id());
71  int region_idx = id.region();
72  int station_idx = id.station();
73  int chamber_idx = id.chamber();
74  int layer_idx = id.layer();
75  // int roll_idx = id.roll();
76  int value = (station_idx - 1) * 4 + (layer_idx - 1) * 2 + (chamber_idx % 2) + 1;
77 
78  if (region_idx == 1) {
79  UInt_t hash = TString("geo_phi_r1").Hash();
80  theStdPlots[hash]->Fill(phi, value);
81  } else {
82  UInt_t hash = TString("geo_phi_r-1").Hash();
83  theStdPlots[hash]->Fill(phi, value);
84  }
85  }
86  }
87 }
88 
90 
#define LogDebug(id)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
CaloTopology const * topology(0)
~GEMCheckGeometry() override
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
void analyze(const edm::Event &e, const edm::EventSetup &) override
GEMCheckGeometry(const edm::ParameterSet &gc)
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
virtual LocalPoint localPosition(float strip) const =0
const std::vector< const GEMRegion * > & regions() const
Return a vector of all GEM regions.
Definition: GEMGeometry.cc:43
Definition: value.py:1
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
T get() const
Definition: EventSetup.h:71
std::map< UInt_t, MonitorElement * > theStdPlots
Definition: Run.h:45