CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
GEMRecHitValidation Class Reference

#include <GEMRecHitValidation.h>

Inheritance diagram for GEMRecHitValidation:
GEMBaseValidation DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 GEMRecHitValidation (const edm::ParameterSet &)
 
 ~GEMRecHitValidation () override
 
- Public Member Functions inherited from GEMBaseValidation
 GEMBaseValidation (const edm::ParameterSet &, std::string)
 
 ~GEMBaseValidation () override=0
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Member Functions

Bool_t matchRecHitAgainstSimHit (GEMRecHitCollection::const_iterator, Int_t)
 

Private Attributes

edm::EDGetTokenT< edm::DetSetVector< GEMDigiSimLink > > digisimlink_token_
 
edm::ESGetToken< GEMGeometry, MuonGeometryRecordgeomToken_
 
edm::ESGetToken< GEMGeometry, MuonGeometryRecordgeomTokenBeginRun_
 
MonitorElementme_cls_
 
MEMap2Ids me_cls_roll_
 
MEMap4Ids me_detail_cls_
 
MEMap3Ids me_detail_occ_polar_
 
MEMap3Ids me_detail_occ_xy_
 
MEMap1Ids me_detail_occ_zr_
 
MEMap2Ids me_detail_pull_x_
 
MEMap4Ids me_detail_pull_x_la_
 
MEMap2Ids me_detail_pull_y_
 
MEMap4Ids me_detail_pull_y_la_
 
MEMap2Ids me_detail_rechit_occ_det_
 
MEMap4Ids me_detail_residual_rphi_
 
MEMap4Ids me_detail_residual_x_
 
MEMap4Ids me_detail_residual_y_
 
MEMap3Ids me_occ_ieta_
 
MEMap3Ids me_occ_phi_
 
MEMap3Ids me_occ_pid_
 
MEMap3Ids me_rechit_occ_eta_
 
MEMap3Ids me_rechit_occ_phi_
 
MEMap2Ids me_residual_rphi_
 
MEMap2Ids me_residual_x_
 
MEMap2Ids me_residual_y_
 
MEMap3Ids me_total_rechit_
 
edm::EDGetTokenT< GEMRecHitCollectionrechit_token_
 
edm::EDGetTokenT< edm::PSimHitContainersimhit_token_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from GEMBaseValidation
template<typename T >
dqm::impl::MonitorElementbookDetectorOccupancy (DQMStore::IBooker &booker, const T &key, const GEMStation *station, const char *name_prfix, const char *title_prefix)
 
template<typename T >
dqm::impl::MonitorElementbookHist1D (DQMStore::IBooker &booker, const T &key, const char *name, const char *title, Int_t nbinsx, Double_t xlow, Double_t xup, const char *x_title="", const char *y_title="Entries")
 
template<typename T >
dqm::impl::MonitorElementbookHist2D (DQMStore::IBooker &booker, const T &key, const char *name, const char *title, Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy, Double_t ylow, Double_t yup, const char *x_title="", const char *y_title="")
 
template<typename T >
dqm::impl::MonitorElementbookPIDHist (DQMStore::IBooker &booker, const T &key, const char *name, const char *title)
 
template<typename T >
dqm::impl::MonitorElementbookPolarOccupancy (DQMStore::IBooker &booker, const T &key, const char *name_prefix, const char *title_prefix)
 
template<typename T >
dqm::impl::MonitorElementbookXYOccupancy (DQMStore::IBooker &booker, const T &key, const char *name_prefix, const char *title_prefix)
 
template<typename T >
dqm::impl::MonitorElementbookZROccupancy (DQMStore::IBooker &booker, const T &key, const char *name_prfix, const char *title_prefix)
 
dqm::impl::MonitorElementbookZROccupancy (DQMStore::IBooker &booker, Int_t region_id, const char *name_prfix, const char *title_prefix)
 
Int_t getDetOccBinX (Int_t num_layers, Int_t chamber_id, Int_t layer_id)
 
Int_t getPidIdx (Int_t pid)
 
Bool_t isMuonSimHit (const PSimHit &)
 
Float_t toDegree (Float_t radian)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from GEMBaseValidation
Bool_t detail_plot_
 
std::vector< Double_t > eta_range_
 
edm::ESGetToken< GEMGeometry, MuonGeometryRecordgeomToken_
 
edm::ESGetToken< GEMGeometry, MuonGeometryRecordgeomTokenBeginRun_
 
const std::string kLogCategory_
 
const Int_t kMuonPDGId_ = 13
 
std::vector< Int_t > pid_list_
 
Int_t xy_occ_num_bins_
 
std::vector< Int_t > zr_occ_num_bins_
 
std::vector< Double_t > zr_occ_range_
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 10 of file GEMRecHitValidation.h.

Constructor & Destructor Documentation

◆ GEMRecHitValidation()

GEMRecHitValidation::GEMRecHitValidation ( const edm::ParameterSet pset)
explicit

Definition at line 6 of file GEMRecHitValidation.cc.

7  : GEMBaseValidation(pset, "GEMRecHitsValidation") {
8  const auto& rechit_pset = pset.getParameterSet("gemRecHit");
9  const auto& rechit_tag = rechit_pset.getParameter<edm::InputTag>("inputTag");
10  rechit_token_ = consumes<GEMRecHitCollection>(rechit_tag);
11 
12  const auto& simhit_pset = pset.getParameterSet("gemSimHit");
13  const auto& simhit_tag = simhit_pset.getParameter<edm::InputTag>("inputTag");
14 
15  const auto& digisimlink_tag = pset.getParameter<edm::InputTag>("gemDigiSimLink");
16  digisimlink_token_ = consumes<edm::DetSetVector<GEMDigiSimLink>>(digisimlink_tag);
17 
18  simhit_token_ = consumes<edm::PSimHitContainer>(simhit_tag);
19  geomToken_ = esConsumes<GEMGeometry, MuonGeometryRecord>();
20  geomTokenBeginRun_ = esConsumes<GEMGeometry, MuonGeometryRecord, edm::Transition::BeginRun>();
21 }

References digisimlink_token_, geomToken_, geomTokenBeginRun_, muonDTDigis_cfi::pset, rechit_token_, and simhit_token_.

◆ ~GEMRecHitValidation()

GEMRecHitValidation::~GEMRecHitValidation ( )
override

Definition at line 23 of file GEMRecHitValidation.cc.

23 {}

Member Function Documentation

◆ analyze()

void GEMRecHitValidation::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
overridevirtual

Implements GEMBaseValidation.

Definition at line 266 of file GEMRecHitValidation.cc.

266  {
267  const GEMGeometry* gem = &setup.getData(geomToken_);
268 
270  event.getByToken(digisimlink_token_, digiSimLink);
271  if (not digiSimLink.isValid()) {
272  edm::LogError(kLogCategory_) << "Failed to get GEMDigiSimLink." << std::endl;
273  return;
274  }
275 
276  edm::Handle<edm::PSimHitContainer> simhit_container;
277  event.getByToken(simhit_token_, simhit_container);
278  if (not simhit_container.isValid()) {
279  edm::LogError(kLogCategory_) << "Failed to get PSimHitContainer." << std::endl;
280  return;
281  }
282 
283  edm::Handle<GEMRecHitCollection> rechit_collection;
284  event.getByToken(rechit_token_, rechit_collection);
285  if (not rechit_collection.isValid()) {
286  edm::LogError(kLogCategory_) << "Failed to get GEMRecHitCollection" << std::endl;
287  return;
288  }
289 
290  std::map<ME3IdsKey, Int_t> total_rechit;
291  for (const auto& rechit : *rechit_collection) {
292  GEMDetId gem_id{rechit.gemId()};
293  Int_t region_id = gem_id.region();
294  Int_t station_id = gem_id.station();
295  Int_t layer_id = gem_id.layer();
296  Int_t ieta = gem_id.ieta();
297  ME4IdsKey key4{region_id, station_id, layer_id, ieta};
298 
299  ME2IdsKey key{station_id, ieta};
300  ME2IdsKey key2{region_id, station_id};
301  ME3IdsKey key3{region_id, station_id, layer_id};
302 
303  const BoundPlane& surface = gem->idToDet(gem_id)->surface();
304  GlobalPoint&& rechit_global_pos = surface.toGlobal(rechit.localPosition());
305 
306  Float_t rechit_g_x = rechit_global_pos.x();
307  Float_t rechit_g_y = rechit_global_pos.y();
308  Float_t rechit_g_abs_z = std::fabs(rechit_global_pos.z());
309  Float_t rechit_g_r = rechit_global_pos.perp();
310  Float_t rechit_g_phi = toDegree(rechit_global_pos.phi());
311 
312  Int_t first_strip = rechit.firstClusterStrip();
313  Int_t cls = rechit.clusterSize();
314  cls = cls > 10 ? 10 : cls;
315 
316  me_cls_roll_[key]->Fill(cls);
317  me_occ_ieta_[key3]->Fill(ieta);
318  me_occ_phi_[key3]->Fill(rechit_g_phi);
319  total_rechit[key3]++;
320 
321  me_cls_->Fill(cls);
322 
323  if (detail_plot_) {
324  me_detail_cls_[key4]->Fill(cls);
325  me_detail_occ_zr_[region_id]->Fill(rechit_g_abs_z, rechit_g_r);
326  me_detail_occ_xy_[key3]->Fill(rechit_g_x, rechit_g_y);
327  me_detail_occ_polar_[key3]->Fill(rechit_g_phi, rechit_g_r);
328  } // detail plot
329 
330  auto links = digiSimLink->find(gem_id);
331 
332  if (links == digiSimLink->end())
333  continue;
334  std::map<Int_t, Int_t> pid_count;
335 
336  for (Int_t strip = first_strip; strip < first_strip + cls; strip++) {
337  for (const auto& link : *links) {
338  Int_t link_strip = link.getStrip();
339  if (link_strip == strip) {
340  Int_t pid = link.getParticleType();
341  pid_count[pid]++;
342  break;
343  }
344  }
345  }
346  Int_t max_pid = 0;
347  Int_t max_count = 0;
348  for (auto& [pid, count] : pid_count) {
349  if (max_count < count) {
350  max_pid = pid;
351  max_count = count;
352  }
353  }
354  Int_t pid_idx = getPidIdx(max_pid);
355  me_occ_pid_[key3]->Fill(pid_idx);
356  }
357 
358  for (auto [key, num_total_rechit] : total_rechit) {
359  me_total_rechit_[key]->Fill(num_total_rechit);
360  }
361 
362  // NOTE
363  for (const auto& simhit : *simhit_container.product()) {
364  if (gem->idToDet(simhit.detUnitId()) == nullptr) {
365  edm::LogError(kLogCategory_) << "MuonGEMHit didn't matched with GEMGeometry." << std::endl;
366  continue;
367  }
368 
369  GEMDetId simhit_gemid{simhit.detUnitId()};
370  const BoundPlane& surface = gem->idToDet(simhit_gemid)->surface();
371 
372  Int_t region_id = simhit_gemid.region();
373  Int_t station_id = simhit_gemid.station();
374  Int_t layer_id = simhit_gemid.layer();
375  Int_t chamber_id = simhit_gemid.chamber();
376  Int_t ieta = simhit_gemid.ieta();
377  Int_t num_layers = simhit_gemid.nlayers();
378 
379  ME2IdsKey key{station_id, ieta};
380  ME2IdsKey key2{region_id, station_id};
381  ME3IdsKey key3{region_id, station_id, layer_id};
382  ME4IdsKey key4{region_id, station_id, layer_id, ieta};
383 
384  const LocalPoint& simhit_local_pos = simhit.localPosition();
385  const GlobalPoint& simhit_global_pos = surface.toGlobal(simhit_local_pos);
386 
387  Float_t simhit_g_abs_eta = std::fabs(simhit_global_pos.eta());
388  Float_t simhit_g_phi = toDegree(simhit_global_pos.phi());
389 
390  Int_t det_occ_bin_x = getDetOccBinX(num_layers, chamber_id, layer_id);
391 
392  auto simhit_trackId = simhit.trackId();
393 
394  auto links = digiSimLink->find(simhit_gemid);
395  if (links == digiSimLink->end())
396  continue;
397 
398  Int_t simhit_strip = -1;
399  for (const auto& link : *links) {
400  if (simhit_trackId == link.getTrackId()) {
401  simhit_strip = link.getStrip();
402  break;
403  }
404  }
405 
406  GEMRecHitCollection::range range = rechit_collection->get(simhit_gemid);
407  for (auto rechit = range.first; rechit != range.second; ++rechit) {
408  if (gem->idToDet(rechit->gemId()) == nullptr) {
409  edm::LogError(kLogCategory_) << "GEMRecHit didn't matched with GEMGeometry." << std::endl;
410  continue;
411  }
412 
413  if (not isMuonSimHit(simhit))
414  continue;
415 
416  if (matchRecHitAgainstSimHit(rechit, simhit_strip)) {
417  const LocalPoint& rechit_local_pos = rechit->localPosition();
418 
419  Float_t resolution_x = std::sqrt(rechit->localPositionError().xx());
420  Float_t resolution_y = std::sqrt(rechit->localPositionError().yy());
421 
422  Float_t residual_x = rechit_local_pos.x() - simhit_local_pos.x();
423  Float_t residual_y = rechit_local_pos.y() - simhit_local_pos.y();
424  Float_t residual_r = sqrt(pow(residual_x, 2) + pow(residual_y, 2));
425  Float_t residual_phi = rechit_local_pos.phi() - simhit_local_pos.phi();
426  Float_t residual_rphi = residual_r * residual_phi;
427 
428  Float_t pull_x = residual_x / resolution_x;
429  Float_t pull_y = residual_y / resolution_y;
430 
431  me_residual_x_[key]->Fill(residual_x);
432  me_residual_y_[key]->Fill(residual_y);
433  me_residual_rphi_[key]->Fill(residual_rphi);
434 
435  me_rechit_occ_eta_[key3]->Fill(simhit_g_abs_eta);
436  me_rechit_occ_phi_[key3]->Fill(simhit_g_phi);
437 
438  if (detail_plot_) {
439  me_detail_rechit_occ_det_[key2]->Fill(det_occ_bin_x, ieta);
440 
441  me_detail_residual_x_[key4]->Fill(residual_x);
442  me_detail_residual_y_[key4]->Fill(residual_y);
443  me_detail_residual_rphi_[key4]->Fill(residual_rphi);
444 
445  me_detail_pull_x_[key]->Fill(pull_x);
446  me_detail_pull_y_[key]->Fill(pull_y);
447  me_detail_pull_x_la_[key4]->Fill(pull_x);
448  me_detail_pull_y_la_[key4]->Fill(pull_y);
449  } // detail_plot
450 
451  // If we find GEMRecHit that matches PSimHit, then exit
452  // GEMRecHitCollection loop.
453  break;
454 
455  } // if rechit matches against simhit
456  } // rechit loop
457  } // simhit loop
458 }

References submitPVResolutionJobs::count, GEMBaseValidation::detail_plot_, digisimlink_token_, PV3DBase< T, PVType, FrameType >::eta(), dqm::impl::MonitorElement::Fill(), geomToken_, GEMBaseValidation::getDetOccBinX(), GEMBaseValidation::getPidIdx(), LEDCalibrationChannels::ieta, GEMBaseValidation::isMuonSimHit(), edm::HandleBase::isValid(), crabWrapper::key, GEMBaseValidation::kLogCategory_, MainPageGenerator::link, electronStore::links, matchRecHitAgainstSimHit(), me_cls_, me_cls_roll_, me_detail_cls_, me_detail_occ_polar_, me_detail_occ_xy_, me_detail_occ_zr_, me_detail_pull_x_, me_detail_pull_x_la_, me_detail_pull_y_, me_detail_pull_y_la_, me_detail_rechit_occ_det_, me_detail_residual_rphi_, me_detail_residual_x_, me_detail_residual_y_, me_occ_ieta_, me_occ_phi_, me_occ_pid_, me_rechit_occ_eta_, me_rechit_occ_phi_, me_residual_rphi_, me_residual_x_, me_residual_y_, me_total_rechit_, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), funct::pow(), edm::Handle< T >::product(), FastTimerService_cff::range, rechit_token_, GEMDetId::region(), singleTopDQM_cfi::setup, simhit_token_, mathSSE::sqrt(), digitizers_cfi::strip, GEMBaseValidation::toDegree(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

◆ bookHistograms()

void GEMRecHitValidation::bookHistograms ( DQMStore::IBooker booker,
edm::Run const &  run,
edm::EventSetup const &  setup 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 25 of file GEMRecHitValidation.cc.

25  {
26  const GEMGeometry* gem = &setup.getData(geomTokenBeginRun_);
27 
28  // NOTE Cluster Size
29  booker.setCurrentFolder("MuonGEMRecHitsV/GEMRecHitsTask/ClusterSize");
30 
31  TString cls_title = "Cluster Size Distribution";
32  TString cls_x_title = "Cluster size";
33 
34  me_cls_ = booker.book1D("cls", cls_title + ";" + cls_x_title + ";" + "Entries", 10, 0.5, 10.5);
35 
36  for (const auto& station : gem->regions()[0]->stations()) {
37  Int_t station_id = station->station();
38  for (const auto& roll : station->superChambers()[0]->chambers()[0]->etaPartitions()) {
39  Int_t ieta = roll->id().ieta();
40  ME2IdsKey key{station_id, ieta};
41  me_cls_roll_[key] = booker.book1D(Form("cls_GE%d1_iEta%d", station_id, ieta),
42  Form("Cluster Size Distribution : GE%d1 iEta %d", station_id, ieta),
43  10,
44  0.5,
45  10.5);
46  }
47  }
48 
49  if (detail_plot_) {
50  for (const auto& region : gem->regions()) {
51  Int_t region_id = region->region();
52 
53  for (const auto& station : region->stations()) {
54  Int_t station_id = station->station();
55 
56  const auto& superChamberVec = station->superChambers();
57  if (superChamberVec.empty() || superChamberVec[0] == nullptr) {
58  edm::LogError(kLogCategory_) << "Super chambers missing or null for region = " << region_id
59  << " and station = " << station_id;
60  } else {
61  for (const auto& chamber : superChamberVec[0]->chambers()) {
62  Int_t layer_id = chamber->id().layer();
63 
64  for (const auto& roll : chamber->etaPartitions()) {
65  Int_t ieta = roll->id().ieta();
66  ME4IdsKey key4{region_id, station_id, layer_id, ieta};
67 
68  me_detail_cls_[key4] = bookHist1D(booker, key4, "cls", "Cluster Size Distribution", 11, -0.5, 10.5);
69  } // roll loop
70  } // chamber loop
71  } // end else
72  } // station loop
73  } // region loop
74  } // detail plot
75 
76  // NOTE Residual
77  booker.setCurrentFolder("MuonGEMRecHitsV/GEMRecHitsTask/Residual");
78 
79  for (const auto& station : gem->regions()[0]->stations()) {
80  Int_t station_id = station->station();
81  for (const auto& roll : station->superChambers()[0]->chambers()[0]->etaPartitions()) {
82  Int_t ieta = roll->id().ieta();
83  ME2IdsKey key{station_id, ieta};
84 
85  me_residual_x_[key] = booker.book1D(Form("residual_x_GE%d1_R%d", station_id, ieta),
86  Form("Residual in X : GE%d1 iEta %d; Residual in X [cm]", station_id, ieta),
87  60,
88  -2,
89  2);
90 
91  me_residual_y_[key] = booker.book1D(Form("residual_y_GE%d1_iEta%d", station_id, ieta),
92  Form("Residual in Y : GE%d1 iEta %d; Residual in Y [cm]", station_id, ieta),
93  60,
94  -15,
95  15);
96 
97  me_residual_rphi_[key] = booker.book1D(
98  Form("residual_rphi_GE%d1_iEta%d", station_id, ieta),
99  Form("Residual in R #times #phi : GE%d1 iEta %d; Residual in r #times #phi [cm]", station_id, ieta),
100  60,
101  -15,
102  15);
103  }
104  }
105 
106  if (detail_plot_) {
107  for (const auto& region : gem->regions()) {
108  Int_t region_id = region->region();
109 
110  for (const auto& station : region->stations()) {
111  Int_t station_id = station->station();
112 
113  const auto& superChamberVec = station->superChambers();
114  if (!superChamberVec.empty() && superChamberVec[0] != nullptr) {
115  for (const auto& chamber : superChamberVec[0]->chambers()) {
116  Int_t layer_id = chamber->id().layer();
117 
118  for (const auto& roll : chamber->etaPartitions()) {
119  Int_t ieta = roll->id().ieta();
120  ME4IdsKey key4{region_id, station_id, layer_id, ieta};
121 
122  me_detail_residual_x_[key4] =
123  bookHist1D(booker, key4, "residual_x", "Residual in x", 60, -2, 2, "Residual in x [cm]");
124 
125  me_detail_residual_y_[key4] =
126  bookHist1D(booker, key4, "residual_y", "Residual in y", 60, -15, 15, "Residual in y [cm]");
127 
128  me_detail_residual_rphi_[key4] = bookHist1D(booker,
129  key4,
130  "residual_rphi",
131  "Residual in r #times #phi",
132  60,
133  -15,
134  15,
135  "Residual in r #times #phi [cm]");
136  } // roll loop
137  } // chamber loop
138  } // end if
139  } // station loop
140  } // region loop
141  } // detail plot
142 
143  // NOTE Pull
144  booker.setCurrentFolder("MuonGEMRecHitsV/GEMRecHitsTask/Pull");
145 
146  if (detail_plot_) {
147  for (const auto& station : gem->regions()[0]->stations()) {
148  Int_t station_id = station->station();
149  for (const auto& roll : station->superChambers()[0]->chambers()[0]->etaPartitions()) {
150  Int_t ieta = roll->id().ieta();
151  ME2IdsKey key{station_id, ieta};
152 
153  me_detail_pull_x_[key] = booker.book1D(Form("pull_x_GE%d1_iEta%d", station_id, ieta),
154  Form("Pull in X : GE%d1 iEta %d", station_id, ieta),
155  60,
156  -3,
157  3);
158 
159  me_detail_pull_y_[key] = booker.book1D(Form("pull_y_GE%d1_iEta%d", station_id, ieta),
160  Form("Pull in Y : GE%d1 iEta %d", station_id, ieta),
161  60,
162  -3,
163  3);
164  }
165  }
166 
167  for (const auto& region : gem->regions()) {
168  Int_t region_id = region->region();
169 
170  for (const auto& station : region->stations()) {
171  Int_t station_id = station->station();
172 
173  const auto& superChamberVec = station->superChambers();
174  if (!superChamberVec.empty() && superChamberVec[0] != nullptr) {
175  for (const auto& chamber : superChamberVec[0]->chambers()) {
176  Int_t layer_id = chamber->id().layer();
177 
178  for (const auto& roll : chamber->etaPartitions()) {
179  Int_t ieta = roll->id().ieta();
180  ME4IdsKey key4{region_id, station_id, layer_id, ieta};
181 
182  me_detail_pull_x_la_[key4] = bookHist1D(booker, key4, "pull_x", "Pull in x", 60, -3, 3);
183 
184  me_detail_pull_y_la_[key4] = bookHist1D(booker, key4, "pull_y", "Pull in y", 60, -3, 3);
185  } // roll loop
186  } // chamber loop
187  } // end if
188  } // station loop
189  } // region loop
190  } // detail plot
191 
192  // NOTE Occupancy
193  booker.setCurrentFolder("MuonGEMRecHitsV/GEMRecHitsTask/Occupancy");
194  for (const auto& region : gem->regions()) {
195  Int_t region_id = region->region();
196 
197  if (detail_plot_)
198  me_detail_occ_zr_[region_id] = bookZROccupancy(booker, region_id, "rechit", "RecHit");
199 
200  for (const auto& station : region->stations()) {
201  Int_t station_id = station->station();
202  ME2IdsKey key2{region_id, station_id};
203 
204  if (detail_plot_)
206  bookDetectorOccupancy(booker, key2, station, "matched_rechit", "Matched RecHit");
207 
208  const auto& superChamberVec = station->superChambers();
209  if (!superChamberVec.empty() && superChamberVec[0] != nullptr) {
210  for (const auto& chamber : superChamberVec[0]->chambers()) {
211  Int_t layer_id = chamber->id().layer();
212  ME3IdsKey key3{region_id, station_id, layer_id};
213 
214  Int_t num_eta_partitions = chamber->nEtaPartitions();
215 
216  me_total_rechit_[key3] =
217  bookHist1D(booker, key3, "total_rechit", "Number of rec hits per event", 25, -0.5, 24.5);
218 
219  me_occ_pid_[key3] = bookPIDHist(booker, key3, "rechit_occ_pid", "Number of entreis for each particle");
220 
221  me_occ_ieta_[key3] = bookHist1D(booker,
222  key3,
223  "rechit_occ_ieta",
224  "Rechit Occupancy per eta partition",
225  num_eta_partitions,
226  0.5,
227  num_eta_partitions + 0.5);
228 
229  me_occ_phi_[key3] = bookHist1D(booker, key3, "rechit_occ_phi", "Rechit Phi Occupancy", 108, -5, 355);
230 
231  me_rechit_occ_eta_[key3] = bookHist1D(booker,
232  key3,
233  "matched_rechit_occ_eta",
234  "Matched RecHit Eta Occupancy",
235  16,
236  eta_range_[station_id * 2 + 0],
237  eta_range_[station_id * 2 + 1],
238  "|#eta|");
239 
240  me_rechit_occ_phi_[key3] =
241  bookHist1D(booker, key3, "matched_rechit_occ_phi", "Matched RecHit Phi Occupancy", 36, -5, 355, "#phi");
242 
243  if (detail_plot_) {
244  me_detail_occ_xy_[key3] = bookXYOccupancy(booker, key3, "rechit", "RecHit");
245 
246  me_detail_occ_polar_[key3] = bookPolarOccupancy(booker, key3, "rechit", "RecHit");
247  }
248  } // chamber loop
249  } // end if
250  } // station loop
251  } // region_loop
252 }

References dqm::implementation::IBooker::book1D(), GEMBaseValidation::bookDetectorOccupancy(), GEMBaseValidation::bookHist1D(), GEMBaseValidation::bookPIDHist(), GEMBaseValidation::bookPolarOccupancy(), GEMBaseValidation::bookXYOccupancy(), GEMBaseValidation::bookZROccupancy(), relativeConstraints::chamber, chambers, GEMBaseValidation::detail_plot_, GEMBaseValidation::eta_range_, geomTokenBeginRun_, LEDCalibrationChannels::ieta, crabWrapper::key, GEMBaseValidation::kLogCategory_, me_cls_, me_cls_roll_, me_detail_cls_, me_detail_occ_polar_, me_detail_occ_xy_, me_detail_occ_zr_, me_detail_pull_x_, me_detail_pull_x_la_, me_detail_pull_y_, me_detail_pull_y_la_, me_detail_rechit_occ_det_, me_detail_residual_rphi_, me_detail_residual_x_, me_detail_residual_y_, me_occ_ieta_, me_occ_phi_, me_occ_pid_, me_rechit_occ_eta_, me_rechit_occ_phi_, me_residual_rphi_, me_residual_x_, me_residual_y_, me_total_rechit_, HLT_FULL_cff::region, dqm::implementation::NavigatorBase::setCurrentFolder(), singleTopDQM_cfi::setup, and relativeConstraints::station.

◆ matchRecHitAgainstSimHit()

Bool_t GEMRecHitValidation::matchRecHitAgainstSimHit ( GEMRecHitCollection::const_iterator  rechit,
Int_t  simhit_strip 
)
private

Definition at line 254 of file GEMRecHitValidation.cc.

254  {
255  Int_t cls = rechit->clusterSize();
256  Int_t rechit_first_strip = rechit->firstClusterStrip();
257 
258  if (cls == 1) {
259  return simhit_strip == rechit_first_strip;
260  } else {
261  Int_t rechit_last_strip = rechit_first_strip + cls - 1;
262  return (simhit_strip >= rechit_first_strip) and (simhit_strip <= rechit_last_strip);
263  }
264 }

Referenced by analyze().

Member Data Documentation

◆ digisimlink_token_

edm::EDGetTokenT<edm::DetSetVector<GEMDigiSimLink> > GEMRecHitValidation::digisimlink_token_
private

Definition at line 23 of file GEMRecHitValidation.h.

Referenced by analyze(), and GEMRecHitValidation().

◆ geomToken_

edm::ESGetToken<GEMGeometry, MuonGeometryRecord> GEMRecHitValidation::geomToken_
private

Definition at line 24 of file GEMRecHitValidation.h.

Referenced by analyze(), and GEMRecHitValidation().

◆ geomTokenBeginRun_

edm::ESGetToken<GEMGeometry, MuonGeometryRecord> GEMRecHitValidation::geomTokenBeginRun_
private

Definition at line 25 of file GEMRecHitValidation.h.

Referenced by bookHistograms(), and GEMRecHitValidation().

◆ me_cls_

MonitorElement* GEMRecHitValidation::me_cls_
private

Definition at line 28 of file GEMRecHitValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_cls_roll_

MEMap2Ids GEMRecHitValidation::me_cls_roll_
private

Definition at line 29 of file GEMRecHitValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_detail_cls_

MEMap4Ids GEMRecHitValidation::me_detail_cls_
private

Definition at line 30 of file GEMRecHitValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_detail_occ_polar_

MEMap3Ids GEMRecHitValidation::me_detail_occ_polar_
private

Definition at line 52 of file GEMRecHitValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_detail_occ_xy_

MEMap3Ids GEMRecHitValidation::me_detail_occ_xy_
private

Definition at line 51 of file GEMRecHitValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_detail_occ_zr_

MEMap1Ids GEMRecHitValidation::me_detail_occ_zr_
private

Definition at line 50 of file GEMRecHitValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_detail_pull_x_

MEMap2Ids GEMRecHitValidation::me_detail_pull_x_
private

Definition at line 40 of file GEMRecHitValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_detail_pull_x_la_

MEMap4Ids GEMRecHitValidation::me_detail_pull_x_la_
private

Definition at line 42 of file GEMRecHitValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_detail_pull_y_

MEMap2Ids GEMRecHitValidation::me_detail_pull_y_
private

Definition at line 41 of file GEMRecHitValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_detail_pull_y_la_

MEMap4Ids GEMRecHitValidation::me_detail_pull_y_la_
private

Definition at line 43 of file GEMRecHitValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_detail_rechit_occ_det_

MEMap2Ids GEMRecHitValidation::me_detail_rechit_occ_det_
private

Definition at line 57 of file GEMRecHitValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_detail_residual_rphi_

MEMap4Ids GEMRecHitValidation::me_detail_residual_rphi_
private

Definition at line 38 of file GEMRecHitValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_detail_residual_x_

MEMap4Ids GEMRecHitValidation::me_detail_residual_x_
private

Definition at line 36 of file GEMRecHitValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_detail_residual_y_

MEMap4Ids GEMRecHitValidation::me_detail_residual_y_
private

Definition at line 37 of file GEMRecHitValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_occ_ieta_

MEMap3Ids GEMRecHitValidation::me_occ_ieta_
private

Definition at line 48 of file GEMRecHitValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_occ_phi_

MEMap3Ids GEMRecHitValidation::me_occ_phi_
private

Definition at line 49 of file GEMRecHitValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_occ_pid_

MEMap3Ids GEMRecHitValidation::me_occ_pid_
private

Definition at line 47 of file GEMRecHitValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_rechit_occ_eta_

MEMap3Ids GEMRecHitValidation::me_rechit_occ_eta_
private

Definition at line 55 of file GEMRecHitValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_rechit_occ_phi_

MEMap3Ids GEMRecHitValidation::me_rechit_occ_phi_
private

Definition at line 56 of file GEMRecHitValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_residual_rphi_

MEMap2Ids GEMRecHitValidation::me_residual_rphi_
private

Definition at line 35 of file GEMRecHitValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_residual_x_

MEMap2Ids GEMRecHitValidation::me_residual_x_
private

Definition at line 33 of file GEMRecHitValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_residual_y_

MEMap2Ids GEMRecHitValidation::me_residual_y_
private

Definition at line 34 of file GEMRecHitValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_total_rechit_

MEMap3Ids GEMRecHitValidation::me_total_rechit_
private

Definition at line 46 of file GEMRecHitValidation.h.

Referenced by analyze(), and bookHistograms().

◆ rechit_token_

edm::EDGetTokenT<GEMRecHitCollection> GEMRecHitValidation::rechit_token_
private

Definition at line 21 of file GEMRecHitValidation.h.

Referenced by analyze(), and GEMRecHitValidation().

◆ simhit_token_

edm::EDGetTokenT<edm::PSimHitContainer> GEMRecHitValidation::simhit_token_
private

Definition at line 22 of file GEMRecHitValidation.h.

Referenced by analyze(), and GEMRecHitValidation().

ME2IdsKey
std::tuple< Int_t, Int_t > ME2IdsKey
Definition: GEMValidationUtils.h:16
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
GEMRecHitValidation::rechit_token_
edm::EDGetTokenT< GEMRecHitCollection > rechit_token_
Definition: GEMRecHitValidation.h:21
GEMRecHitValidation::me_detail_residual_rphi_
MEMap4Ids me_detail_residual_rphi_
Definition: GEMRecHitValidation.h:38
GEMBaseValidation::bookHist1D
dqm::impl::MonitorElement * bookHist1D(DQMStore::IBooker &booker, const T &key, const char *name, const char *title, Int_t nbinsx, Double_t xlow, Double_t xup, const char *x_title="", const char *y_title="Entries")
Definition: GEMBaseValidation.h:240
edm::Handle::product
T const * product() const
Definition: Handle.h:70
MainPageGenerator.link
link
Definition: MainPageGenerator.py:271
GEMBaseValidation::detail_plot_
Bool_t detail_plot_
Definition: GEMBaseValidation.h:95
GEMRecHitValidation::me_rechit_occ_eta_
MEMap3Ids me_rechit_occ_eta_
Definition: GEMRecHitValidation.h:55
GEMRecHitValidation::me_detail_occ_polar_
MEMap3Ids me_detail_occ_polar_
Definition: GEMRecHitValidation.h:52
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
GEMDetId::region
constexpr int region() const
Definition: GEMDetId.h:171
GEMBaseValidation::bookDetectorOccupancy
dqm::impl::MonitorElement * bookDetectorOccupancy(DQMStore::IBooker &booker, const T &key, const GEMStation *station, const char *name_prfix, const char *title_prefix)
Definition: GEMBaseValidation.h:168
relativeConstraints.station
station
Definition: relativeConstraints.py:67
GEMRecHitValidation::me_rechit_occ_phi_
MEMap3Ids me_rechit_occ_phi_
Definition: GEMRecHitValidation.h:56
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
GEMRecHitValidation::me_detail_rechit_occ_det_
MEMap2Ids me_detail_rechit_occ_det_
Definition: GEMRecHitValidation.h:57
ME4IdsKey
std::tuple< Int_t, Int_t, Int_t, Int_t > ME4IdsKey
Definition: GEMValidationUtils.h:20
GEMRecHitValidation::me_detail_pull_y_la_
MEMap4Ids me_detail_pull_y_la_
Definition: GEMRecHitValidation.h:43
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
GEMRecHitValidation::me_occ_pid_
MEMap3Ids me_occ_pid_
Definition: GEMRecHitValidation.h:47
GEMRecHitValidation::me_residual_x_
MEMap2Ids me_residual_x_
Definition: GEMRecHitValidation.h:33
GEMRecHitValidation::me_detail_pull_x_la_
MEMap4Ids me_detail_pull_x_la_
Definition: GEMRecHitValidation.h:42
edm::Handle
Definition: AssociativeIterator.h:50
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
GEMRecHitValidation::me_detail_residual_x_
MEMap4Ids me_detail_residual_x_
Definition: GEMRecHitValidation.h:36
GEMBaseValidation::isMuonSimHit
Bool_t isMuonSimHit(const PSimHit &)
Definition: GEMBaseValidation.cc:28
GEMBaseValidation::bookZROccupancy
dqm::impl::MonitorElement * bookZROccupancy(DQMStore::IBooker &booker, Int_t region_id, const char *name_prfix, const char *title_prefix)
Definition: GEMBaseValidation.cc:42
GEMRecHitValidation::me_detail_occ_xy_
MEMap3Ids me_detail_occ_xy_
Definition: GEMRecHitValidation.h:51
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
GEMBaseValidation::bookXYOccupancy
dqm::impl::MonitorElement * bookXYOccupancy(DQMStore::IBooker &booker, const T &key, const char *name_prefix, const char *title_prefix)
Definition: GEMBaseValidation.h:141
Point3DBase< float, GlobalTag >
GEMRecHitValidation::me_occ_ieta_
MEMap3Ids me_occ_ieta_
Definition: GEMRecHitValidation.h:48
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
GEMBaseValidation::GEMBaseValidation
GEMBaseValidation(const edm::ParameterSet &, std::string)
Definition: GEMBaseValidation.cc:10
GEMRecHitValidation::matchRecHitAgainstSimHit
Bool_t matchRecHitAgainstSimHit(GEMRecHitCollection::const_iterator, Int_t)
Definition: GEMRecHitValidation.cc:254
GEMBaseValidation::eta_range_
std::vector< Double_t > eta_range_
Definition: GEMBaseValidation.h:94
GEMDetId
Definition: GEMDetId.h:18
GEMRecHitValidation::me_residual_rphi_
MEMap2Ids me_residual_rphi_
Definition: GEMRecHitValidation.h:35
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88271
GEMRecHitValidation::simhit_token_
edm::EDGetTokenT< edm::PSimHitContainer > simhit_token_
Definition: GEMRecHitValidation.h:22
chambers
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
GEMBaseValidation::getPidIdx
Int_t getPidIdx(Int_t pid)
Definition: GEMBaseValidation.cc:38
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
GEMRecHitValidation::me_residual_y_
MEMap2Ids me_residual_y_
Definition: GEMRecHitValidation.h:34
gem
Definition: AMC13Event.h:6
GEMRecHitValidation::me_detail_residual_y_
MEMap4Ids me_detail_residual_y_
Definition: GEMRecHitValidation.h:37
GEMRecHitValidation::me_cls_
MonitorElement * me_cls_
Definition: GEMRecHitValidation.h:28
edm::RangeMap::range
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:50
GEMRecHitValidation::geomTokenBeginRun_
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geomTokenBeginRun_
Definition: GEMRecHitValidation.h:25
GEMBaseValidation::bookPIDHist
dqm::impl::MonitorElement * bookPIDHist(DQMStore::IBooker &booker, const T &key, const char *name, const char *title)
Definition: GEMBaseValidation.h:217
GEMRecHitValidation::geomToken_
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geomToken_
Definition: GEMRecHitValidation.h:24
GEMBaseValidation::bookPolarOccupancy
dqm::impl::MonitorElement * bookPolarOccupancy(DQMStore::IBooker &booker, const T &key, const char *name_prefix, const char *title_prefix)
Definition: GEMBaseValidation.h:153
GEMRecHitValidation::me_detail_pull_y_
MEMap2Ids me_detail_pull_y_
Definition: GEMRecHitValidation.h:41
GEMBaseValidation::toDegree
Float_t toDegree(Float_t radian)
Definition: GEMBaseValidation.cc:30
BoundPlane
electronStore.links
links
Definition: electronStore.py:149
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
ME3IdsKey
std::tuple< Int_t, Int_t, Int_t > ME3IdsKey
Definition: GEMValidationUtils.h:19
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
GEMGeometry
Definition: GEMGeometry.h:24
GEMRecHitValidation::me_total_rechit_
MEMap3Ids me_total_rechit_
Definition: GEMRecHitValidation.h:46
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
GEMRecHitValidation::me_cls_roll_
MEMap2Ids me_cls_roll_
Definition: GEMRecHitValidation.h:29
GEMRecHitValidation::digisimlink_token_
edm::EDGetTokenT< edm::DetSetVector< GEMDigiSimLink > > digisimlink_token_
Definition: GEMRecHitValidation.h:23
crabWrapper.key
key
Definition: crabWrapper.py:19
GEMRecHitValidation::me_detail_occ_zr_
MEMap1Ids me_detail_occ_zr_
Definition: GEMRecHitValidation.h:50
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
edm::InputTag
Definition: InputTag.h:15
GEMBaseValidation::getDetOccBinX
Int_t getDetOccBinX(Int_t num_layers, Int_t chamber_id, Int_t layer_id)
Definition: GEMBaseValidation.cc:24
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
GEMRecHitValidation::me_detail_pull_x_
MEMap2Ids me_detail_pull_x_
Definition: GEMRecHitValidation.h:40
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
GEMRecHitValidation::me_detail_cls_
MEMap4Ids me_detail_cls_
Definition: GEMRecHitValidation.h:30
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
GEMRecHitValidation::me_occ_phi_
MEMap3Ids me_occ_phi_
Definition: GEMRecHitValidation.h:49
GEMBaseValidation::kLogCategory_
const std::string kLogCategory_
Definition: GEMBaseValidation.h:99