CMS 3D CMS Logo

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

#include <GEMPadDigiClusterValidation.h>

Inheritance diagram for GEMPadDigiClusterValidation:
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
 
 GEMPadDigiClusterValidation (const edm::ParameterSet &)
 
 ~GEMPadDigiClusterValidation () 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 hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Attributes

MEMap3Ids me_detail_bx_
 
MEMap3Ids me_detail_occ_pad_
 
MEMap3Ids me_detail_occ_phi_pad_
 
MEMap3Ids me_detail_occ_xy_
 
MEMap2Ids me_occ_det_
 
MEMap1Ids me_occ_zr_
 
edm::EDGetTokenT< GEMPadDigiClusterCollectionpad_cluster_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::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 chamber_id, Int_t layer_id)
 
const GEMGeometryinitGeometry (const edm::EventSetup &)
 
Bool_t isMuonSimHit (const PSimHit &)
 
- 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_
 
const std::string kLogCategory_
 
const Int_t kMuonPDGId_ = 13
 
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 7 of file GEMPadDigiClusterValidation.h.

Constructor & Destructor Documentation

◆ GEMPadDigiClusterValidation()

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

Definition at line 4 of file GEMPadDigiClusterValidation.cc.

5  : GEMBaseValidation(pset, "GEMPadDigiClusterValidation") {
6  const auto& pad_cluster_pset = pset.getParameterSet("gemPadCluster");
7  const auto& pad_cluster_tag = pad_cluster_pset.getParameter<edm::InputTag>("inputTag");
8  pad_cluster_token_ = consumes<GEMPadDigiClusterCollection>(pad_cluster_tag);
9 }

References pad_cluster_token_, and muonDTDigis_cfi::pset.

◆ ~GEMPadDigiClusterValidation()

GEMPadDigiClusterValidation::~GEMPadDigiClusterValidation ( )
override

Definition at line 109 of file GEMPadDigiClusterValidation.cc.

109 {}

Member Function Documentation

◆ analyze()

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

Implements GEMBaseValidation.

Definition at line 111 of file GEMPadDigiClusterValidation.cc.

111  {
112  const GEMGeometry* gem = initGeometry(setup);
113 
115  event.getByToken(pad_cluster_token_, collection);
116  if (not collection.isValid()) {
117  edm::LogError(kLogCategory_) << "Cannot get pads by label GEMPadToken.";
118  return;
119  }
120 
121  for (auto range_iter = collection->begin(); range_iter != collection->end(); range_iter++) {
122  GEMDetId gemid = (*range_iter).first;
123  const auto& range = (*range_iter).second;
124 
125  if (gem->idToDet(gemid) == nullptr) {
126  edm::LogError(kLogCategory_) << "Getting DetId failed. Discard this gem pad hit. "
127  << "Maybe it comes from unmatched geometry." << std::endl;
128  continue;
129  }
130 
131  const GEMEtaPartition* roll = gem->etaPartition(gemid);
132  const BoundPlane& surface = roll->surface();
133 
134  Int_t region_id = gemid.region();
135  Int_t station_id = gemid.station();
136  Int_t layer_id = gemid.layer();
137  Int_t chamber_id = gemid.chamber();
138  Int_t roll_id = gemid.roll();
139 
140  ME2IdsKey key2(region_id, station_id);
141  ME3IdsKey key3(region_id, station_id, layer_id);
142 
143  for (auto digi = range.first; digi != range.second; ++digi) {
144  const auto& padsVec = digi->pads();
145  if (padsVec.empty()) {
146  edm::LogError(kLogCategory_) << "Pads missing for digi from GEM ID = " << gemid;
147  continue;
148  }
149  Int_t pad = padsVec[0];
150 
151  // bunch crossing
152  Int_t bx = digi->bx();
153 
154  const LocalPoint& local_pos = roll->centreOfPad(pad);
155  const GlobalPoint& global_pos = surface.toGlobal(local_pos);
156 
157  Float_t g_r = global_pos.perp();
158  Float_t g_phi = global_pos.phi();
159  Float_t g_x = global_pos.x();
160  Float_t g_y = global_pos.y();
161  Float_t g_abs_z = std::fabs(global_pos.z());
162 
163  me_occ_zr_[region_id]->Fill(g_abs_z, g_r);
164 
165  Int_t bin_x = getDetOccBinX(chamber_id, layer_id);
166  me_occ_det_[key2]->Fill(bin_x, roll_id);
167 
168  if (detail_plot_) {
169  me_detail_occ_xy_[key3]->Fill(g_x, g_y);
170  me_detail_occ_phi_pad_[key3]->Fill(g_phi, pad);
171  me_detail_occ_pad_[key3]->Fill(pad);
172  me_detail_bx_[key3]->Fill(bx);
173  } // detail_plot_
174  }
175  } // end loop over range iters
176 }

References l1GtPatternGenerator_cfi::bx, GEMEtaPartition::centreOfPad(), GEMDetId::chamber(), universalConfigTemplate::collection, GEMBaseValidation::detail_plot_, GEMBaseValidation::getDetOccBinX(), GEMBaseValidation::initGeometry(), GEMBaseValidation::kLogCategory_, GEMDetId::layer(), me_detail_bx_, me_detail_occ_pad_, me_detail_occ_phi_pad_, me_detail_occ_xy_, me_occ_det_, me_occ_zr_, pad_cluster_token_, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), FastTimerService_cff::range, GEMDetId::region(), GEMDetId::roll(), singleTopDQM_cfi::setup, GEMDetId::station(), GeomDet::surface(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

◆ bookHistograms()

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

Implements DQMEDAnalyzer.

Definition at line 11 of file GEMPadDigiClusterValidation.cc.

13  {
15 
16  // NOTE Occupancy
17  booker.setCurrentFolder("MuonGEMDigisV/GEMDigisTask/PadCluster/Occupancy");
18  for (const auto& region : gem->regions()) {
19  Int_t region_id = region->region();
20 
21  me_occ_zr_.emplace(region_id, bookZROccupancy(booker, region_id, "pad", "Pad Cluster"));
22 
23  for (const auto& station : region->stations()) {
24  Int_t station_id = station->station();
25  ME2IdsKey key2{region_id, station_id};
26 
27  me_occ_det_[key2] = bookDetectorOccupancy(booker, key2, station, "pad", "Pad Cluster");
28 
29  const auto& superChamberVec = station->superChambers();
30  if (superChamberVec.empty()) {
31  edm::LogError(kLogCategory_) << "Super chambers missing for region = " << region_id
32  << " and station = " << station_id;
33  continue;
34  }
35  const GEMSuperChamber* super_chamber = superChamberVec.front();
36  if (super_chamber == nullptr) {
37  edm::LogError(kLogCategory_) << "Failed to find super chamber for region = " << region_id
38  << " and station = " << station_id;
39  continue;
40  }
41  for (const auto& chamber : super_chamber->chambers()) {
42  Int_t layer_id = chamber->id().layer();
43  ME3IdsKey key3{region_id, station_id, layer_id};
44 
45  const auto& etaPartitionVec = chamber->etaPartitions();
46  if (etaPartitionVec.empty() || etaPartitionVec.front() == nullptr) {
48  << "Eta partition missing or null for region, station, super chamber, chamber = (" << region_id << ", "
49  << station_id << ", " << super_chamber->id() << ", " << chamber->id() << ")";
50  continue;
51  }
52  Int_t num_pads = etaPartitionVec.front()->npads();
53 
54  if (detail_plot_) {
55  me_detail_occ_xy_[key3] = bookXYOccupancy(booker, key3, "pad", "Pad Cluster");
56 
57  me_detail_occ_phi_pad_[key3] = bookHist2D(booker,
58  key3,
59  "occ_phi_pad",
60  "Pad Cluster Occupancy",
61  280,
62  -M_PI,
63  M_PI,
64  num_pads / 2,
65  0,
66  num_pads,
67  "#phi [rad]",
68  "Pad number");
69 
70  me_detail_occ_pad_[key3] =
71  bookHist1D(booker, key3, "occ_pad", "Pad Cluster Occupancy", num_pads, 0.5, num_pads + 0.5, "Pad number");
72  }
73  } // end loop over layer ids
74  } // end loop over station ids
75  } // end loop over region ids
76 
77  // NOTE Bunch Crossing
78  if (detail_plot_) {
79  booker.setCurrentFolder("MuonGEMDigisV/GEMDigisTask/PadCluster/BunchCrossing");
80 
81  for (const auto& region : gem->regions()) {
82  Int_t region_id = region->region();
83  for (const auto& station : region->stations()) {
84  Int_t station_id = station->station();
85 
86  const auto& superChamberVec = station->superChambers();
87  if (superChamberVec.empty()) {
88  edm::LogError(kLogCategory_) << "Super chambers missing for region = " << region_id
89  << " and station = " << station_id;
90  continue;
91  }
92  const GEMSuperChamber* super_chamber = superChamberVec.front();
93  if (super_chamber == nullptr) {
94  edm::LogError(kLogCategory_) << "Failed to find super chamber for region = " << region_id
95  << " and station = " << station_id;
96  continue;
97  }
98  for (const auto& chamber : super_chamber->chambers()) {
99  Int_t layer_id = chamber->id().layer();
100  ME3IdsKey key3(region_id, station_id, layer_id);
101  me_detail_bx_[key3] =
102  bookHist1D(booker, key3, "bx", "Pad Cluster Bunch Crossing", 5, -2.5, 2.5, "Bunch crossing");
103  } // chamber loop
104  } // station loop
105  } // region loop
106  } // detail plot
107 }

References GEMBaseValidation::bookDetectorOccupancy(), GEMBaseValidation::bookHist1D(), GEMBaseValidation::bookHist2D(), GEMBaseValidation::bookXYOccupancy(), GEMBaseValidation::bookZROccupancy(), relativeConstraints::chamber, GEMSuperChamber::chambers(), GEMBaseValidation::detail_plot_, GEMSuperChamber::id(), GEMBaseValidation::initGeometry(), GEMBaseValidation::kLogCategory_, M_PI, me_detail_bx_, me_detail_occ_pad_, me_detail_occ_phi_pad_, me_detail_occ_xy_, me_occ_det_, me_occ_zr_, HLT_2018_cff::region, dqm::implementation::NavigatorBase::setCurrentFolder(), singleTopDQM_cfi::setup, and relativeConstraints::station.

Member Data Documentation

◆ me_detail_bx_

MEMap3Ids GEMPadDigiClusterValidation::me_detail_bx_
private

Definition at line 21 of file GEMPadDigiClusterValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_detail_occ_pad_

MEMap3Ids GEMPadDigiClusterValidation::me_detail_occ_pad_
private

Definition at line 19 of file GEMPadDigiClusterValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_detail_occ_phi_pad_

MEMap3Ids GEMPadDigiClusterValidation::me_detail_occ_phi_pad_
private

Definition at line 18 of file GEMPadDigiClusterValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_detail_occ_xy_

MEMap3Ids GEMPadDigiClusterValidation::me_detail_occ_xy_
private

Definition at line 17 of file GEMPadDigiClusterValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_occ_det_

MEMap2Ids GEMPadDigiClusterValidation::me_occ_det_
private

Definition at line 15 of file GEMPadDigiClusterValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_occ_zr_

MEMap1Ids GEMPadDigiClusterValidation::me_occ_zr_
private

Definition at line 16 of file GEMPadDigiClusterValidation.h.

Referenced by analyze(), and bookHistograms().

◆ pad_cluster_token_

edm::EDGetTokenT<GEMPadDigiClusterCollection> GEMPadDigiClusterValidation::pad_cluster_token_
private

Definition at line 23 of file GEMPadDigiClusterValidation.h.

Referenced by analyze(), and GEMPadDigiClusterValidation().

ME2IdsKey
std::tuple< Int_t, Int_t > ME2IdsKey
Definition: GEMValidationUtils.h:16
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
GEMPadDigiClusterValidation::me_occ_det_
MEMap2Ids me_occ_det_
Definition: GEMPadDigiClusterValidation.h:15
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:210
GEMSuperChamber::chambers
const std::vector< const GEMChamber * > & chambers() const
Return the chambers in the super chamber.
Definition: GEMSuperChamber.cc:23
GEMBaseValidation::detail_plot_
Bool_t detail_plot_
Definition: GEMBaseValidation.h:90
GEMSuperChamber
Definition: GEMSuperChamber.h:19
GEMDetId::layer
constexpr int layer() const
Definition: GEMDetId.h:184
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
GEMDetId::region
constexpr int region() const
Definition: GEMDetId.h:165
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:161
relativeConstraints.station
station
Definition: relativeConstraints.py:67
GEMEtaPartition
Definition: GEMEtaPartition.h:12
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
edm::Handle< GEMPadDigiClusterCollection >
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
GEMPadDigiClusterValidation::pad_cluster_token_
edm::EDGetTokenT< GEMPadDigiClusterCollection > pad_cluster_token_
Definition: GEMPadDigiClusterValidation.h:23
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
GEMBaseValidation::bookZROccupancy
dqm::impl::MonitorElement * bookZROccupancy(DQMStore::IBooker &booker, Int_t region_id, const char *name_prfix, const char *title_prefix)
Definition: GEMBaseValidation.cc:34
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
GEMBaseValidation::initGeometry
const GEMGeometry * initGeometry(const edm::EventSetup &)
Definition: GEMBaseValidation.cc:23
GEMPadDigiClusterValidation::me_detail_bx_
MEMap3Ids me_detail_bx_
Definition: GEMPadDigiClusterValidation.h:21
GEMBaseValidation::bookXYOccupancy
dqm::impl::MonitorElement * bookXYOccupancy(DQMStore::IBooker &booker, const T &key, const char *name_prefix, const char *title_prefix)
Definition: GEMBaseValidation.h:134
GEMPadDigiClusterValidation::me_occ_zr_
MEMap1Ids me_occ_zr_
Definition: GEMPadDigiClusterValidation.h:16
Point3DBase< float, LocalTag >
GEMPadDigiClusterValidation::me_detail_occ_phi_pad_
MEMap3Ids me_detail_occ_phi_pad_
Definition: GEMPadDigiClusterValidation.h:18
GEMBaseValidation::bookHist2D
dqm::impl::MonitorElement * bookHist2D(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="")
Definition: GEMBaseValidation.h:227
GEMDetId::chamber
constexpr int chamber() const
Definition: GEMDetId.h:177
edm::LogError
Definition: MessageLogger.h:183
GEMBaseValidation::GEMBaseValidation
GEMBaseValidation(const edm::ParameterSet &, std::string)
Definition: GEMBaseValidation.cc:10
GEMDetId::roll
constexpr int roll() const
Definition: GEMDetId.h:188
GEMDetId
Definition: GEMDetId.h:17
GEMPadDigiClusterValidation::me_detail_occ_xy_
MEMap3Ids me_detail_occ_xy_
Definition: GEMPadDigiClusterValidation.h:17
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
universalConfigTemplate.collection
collection
Definition: universalConfigTemplate.py:81
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:50
gem
Definition: AMC13Event.h:6
GEMEtaPartition::centreOfPad
LocalPoint centreOfPad(int pad) const
Definition: GEMEtaPartition.cc:45
BoundPlane
HLT_2018_cff.region
region
Definition: HLT_2018_cff.py:81479
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
ME3IdsKey
std::tuple< Int_t, Int_t, Int_t > ME3IdsKey
Definition: GEMValidationUtils.h:19
GEMDetId::station
constexpr int station() const
Definition: GEMDetId.h:173
GEMGeometry
Definition: GEMGeometry.h:24
GEMPadDigiClusterValidation::me_detail_occ_pad_
MEMap3Ids me_detail_occ_pad_
Definition: GEMPadDigiClusterValidation.h:19
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
edm::InputTag
Definition: InputTag.h:15
GEMSuperChamber::id
GEMDetId id() const
Return the GEMDetId of this super chamber.
Definition: GEMSuperChamber.cc:11
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
GEMBaseValidation::getDetOccBinX
Int_t getDetOccBinX(Int_t chamber_id, Int_t layer_id)
Definition: GEMBaseValidation.cc:30
GEMBaseValidation::kLogCategory_
const std::string kLogCategory_
Definition: GEMBaseValidation.h:94