CMS 3D CMS Logo

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

#include <GEMPadDigiValidation.h>

Inheritance diagram for GEMPadDigiValidation:
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
 
 GEMPadDigiValidation (const edm::ParameterSet &)
 
 ~GEMPadDigiValidation () 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< GEMPadDigiCollectionpad_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 GEMPadDigiValidation.h.

Constructor & Destructor Documentation

◆ GEMPadDigiValidation()

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

Definition at line 3 of file GEMPadDigiValidation.cc.

4  : GEMBaseValidation(pset, "GEMPadDigiValidation") {
5  const auto& pad_pset = pset.getParameterSet("gemPadDigi");
6  const auto& pad_tag = pad_pset.getParameter<edm::InputTag>("inputTag");
7  pad_token_ = consumes<GEMPadDigiCollection>(pad_tag);
8 }

References pad_token_, and muonDTDigis_cfi::pset.

◆ ~GEMPadDigiValidation()

GEMPadDigiValidation::~GEMPadDigiValidation ( )
override

Definition at line 109 of file GEMPadDigiValidation.cc.

109 {}

Member Function Documentation

◆ analyze()

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

Implements GEMBaseValidation.

Definition at line 111 of file GEMPadDigiValidation.cc.

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

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_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 GEMPadDigiValidation::bookHistograms ( DQMStore::IBooker booker,
edm::Run const &  Run,
edm::EventSetup const &  setup 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 10 of file GEMPadDigiValidation.cc.

12  {
14 
15  // NOTE Occupancy
16  booker.setCurrentFolder("MuonGEMDigisV/GEMDigisTask/Pad/Occupancy");
17 
18  for (const auto& region : gem->regions()) {
19  Int_t region_id = region->region();
20 
21  me_occ_zr_[region_id] = bookZROccupancy(booker, region_id, "pad", "Pad");
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");
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");
56 
57  me_detail_occ_phi_pad_[key3] = bookHist2D(booker,
58  key3,
59  "occ_phi_pad",
60  "Pad 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 Occupancy", num_pads, 0.5, num_pads + 0.5, "Pad number");
72  }
73  } // layer loop
74  } // station loop
75  } // region loop
76 
77  // NOTE Bunch Crossing
78  if (detail_plot_) {
79  booker.setCurrentFolder("MuonGEMDigisV/GEMDigisTask/Pad/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 
102  me_detail_bx_[key3] = bookHist1D(booker, key3, "bx", "Pad 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 GEMPadDigiValidation::me_detail_bx_
private

Definition at line 24 of file GEMPadDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_detail_occ_pad_

MEMap3Ids GEMPadDigiValidation::me_detail_occ_pad_
private

Definition at line 23 of file GEMPadDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_detail_occ_phi_pad_

MEMap3Ids GEMPadDigiValidation::me_detail_occ_phi_pad_
private

Definition at line 22 of file GEMPadDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_detail_occ_xy_

MEMap3Ids GEMPadDigiValidation::me_detail_occ_xy_
private

Definition at line 21 of file GEMPadDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_occ_det_

MEMap2Ids GEMPadDigiValidation::me_occ_det_
private

Definition at line 19 of file GEMPadDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me_occ_zr_

MEMap1Ids GEMPadDigiValidation::me_occ_zr_
private

Definition at line 20 of file GEMPadDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ pad_token_

edm::EDGetTokenT<GEMPadDigiCollection> GEMPadDigiValidation::pad_token_
private

Definition at line 16 of file GEMPadDigiValidation.h.

Referenced by analyze(), and GEMPadDigiValidation().

ME2IdsKey
std::tuple< Int_t, Int_t > ME2IdsKey
Definition: GEMValidationUtils.h:16
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
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< GEMPadDigiCollection >
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
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
GEMPadDigiValidation::me_detail_occ_xy_
MEMap3Ids me_detail_occ_xy_
Definition: GEMPadDigiValidation.h:21
GEMPadDigiValidation::me_detail_occ_pad_
MEMap3Ids me_detail_occ_pad_
Definition: GEMPadDigiValidation.h:23
GEMBaseValidation::bookXYOccupancy
dqm::impl::MonitorElement * bookXYOccupancy(DQMStore::IBooker &booker, const T &key, const char *name_prefix, const char *title_prefix)
Definition: GEMBaseValidation.h:134
GEMPadDigiValidation::me_occ_zr_
MEMap1Ids me_occ_zr_
Definition: GEMPadDigiValidation.h:20
Point3DBase< float, LocalTag >
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
GEMPadDigiValidation::pad_token_
edm::EDGetTokenT< GEMPadDigiCollection > pad_token_
Definition: GEMPadDigiValidation.h:16
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
GEMPadDigiValidation::me_detail_occ_phi_pad_
MEMap3Ids me_detail_occ_phi_pad_
Definition: GEMPadDigiValidation.h:22
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
GEMPadDigiValidation::me_detail_bx_
MEMap3Ids me_detail_bx_
Definition: GEMPadDigiValidation.h:24
GEMDetId::station
constexpr int station() const
Definition: GEMDetId.h:173
GEMGeometry
Definition: GEMGeometry.h:24
GEMPadDigiValidation::me_occ_det_
MEMap2Ids me_occ_det_
Definition: GEMPadDigiValidation.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