CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
GEMStripDigiValidation Class Reference

#include <GEMStripDigiValidation.h>

Inheritance diagram for GEMStripDigiValidation:
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
 
 GEMStripDigiValidation (const edm::ParameterSet &)
 
 ~GEMStripDigiValidation () 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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Attributes

edm::EDGetTokenT
< edm::DetSetVector
< GEMDigiSimLink > > 
digisimlink_token_
 
edm::ESGetToken< GEMGeometry,
MuonGeometryRecord
geomToken_
 
edm::ESGetToken< GEMGeometry,
MuonGeometryRecord
geomTokenBeginRun_
 
MonitorElementme_detail_bx_
 
MEMap3Ids me_detail_bx_layer_
 
MEMap2Ids me_detail_occ_det_
 
MEMap3Ids me_detail_occ_strip_
 
MEMap3Ids me_detail_occ_xy_
 
MEMap1Ids me_detail_occ_zr_
 
MEMap2Ids me_detail_strip_occ_det_
 
MEMap3Ids me_detail_strip_occ_eta_
 
MEMap3Ids me_detail_strip_occ_phi_
 
MEMap2Ids me_detail_total_strip_
 
MonitorElementme_detail_total_strip_all_
 
MEMap2Ids me_occ_pid_
 
MEMap3Ids me_occ_pid_eta_
 
edm::EDGetTokenT
< edm::PSimHitContainer
simhit_token_
 
edm::EDGetTokenT
< GEMDigiCollection
strip_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 >
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::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
< DQMEDAnalyzerGlobalCache
initializeGlobalCache (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::MonitorElementbookPIDHist (DQMStore::IBooker &booker, const T &key, Int_t ieta, 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)
 
dqm::impl::MonitorElementbookZROccupancy (DQMStore::IBooker &booker, Int_t region_id, const char *name_prfix, const char *title_prefix)
 
template<typename T >
dqm::impl::MonitorElementbookZROccupancy (DQMStore::IBooker &booker, const T &key, 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,
MuonGeometryRecord
geomToken_
 
edm::ESGetToken< GEMGeometry,
MuonGeometryRecord
geomTokenBeginRun_
 
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 GEMStripDigiValidation.h.

Constructor & Destructor Documentation

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

Definition at line 4 of file GEMStripDigiValidation.cc.

References digisimlink_token_, geomToken_, geomTokenBeginRun_, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterSet(), simhit_token_, and strip_token_.

5  : GEMBaseValidation(pset, "GEMStripDigiValidation") {
6  const auto& strip_pset = pset.getParameterSet("gemStripDigi");
7  const auto& strip_tag = strip_pset.getParameter<edm::InputTag>("inputTag");
8  strip_token_ = consumes<GEMDigiCollection>(strip_tag);
9 
10  const auto& simhit_pset = pset.getParameterSet("gemSimHit");
11  const auto& simhit_tag = simhit_pset.getParameter<edm::InputTag>("inputTag");
12  simhit_token_ = consumes<edm::PSimHitContainer>(simhit_tag);
13 
14  const auto& digisimlink_tag = pset.getParameter<edm::InputTag>("gemDigiSimLink");
15  digisimlink_token_ = consumes<edm::DetSetVector<GEMDigiSimLink>>(digisimlink_tag);
16 
17  geomToken_ = esConsumes<GEMGeometry, MuonGeometryRecord>();
18  geomTokenBeginRun_ = esConsumes<GEMGeometry, MuonGeometryRecord, edm::Transition::BeginRun>();
19 }
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geomTokenBeginRun_
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geomToken_
edm::EDGetTokenT< edm::DetSetVector< GEMDigiSimLink > > digisimlink_token_
edm::EDGetTokenT< GEMDigiCollection > strip_token_
ParameterSet const & getParameterSet(std::string const &) const
GEMBaseValidation(const edm::ParameterSet &, std::string)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< edm::PSimHitContainer > simhit_token_
GEMStripDigiValidation::~GEMStripDigiValidation ( )
override

Definition at line 158 of file GEMStripDigiValidation.cc.

158 {}

Member Function Documentation

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

Implements GEMBaseValidation.

Definition at line 160 of file GEMStripDigiValidation.cc.

References funct::abs(), makePileupJSON::bx, GEMEtaPartition::centreOfStrip(), GEMBaseValidation::detail_plot_, digisimlink_token_, GEMGeometry::etaPartition(), dqm::impl::MonitorElement::Fill(), geomToken_, edm::EventSetup::getData(), GEMBaseValidation::getDetOccBinX(), GEMBaseValidation::getPidIdx(), GEMGeometry::idToDet(), GEMBaseValidation::isMuonSimHit(), edm::HandleBase::isValid(), submitPVResolutionJobs::key, GEMBaseValidation::kLogCategory_, MainPageGenerator::link, electronStore::links, me_detail_bx_, me_detail_bx_layer_, me_detail_occ_det_, me_detail_occ_strip_, me_detail_occ_xy_, me_detail_occ_zr_, me_detail_strip_occ_det_, me_detail_strip_occ_eta_, me_detail_strip_occ_phi_, me_detail_total_strip_, me_detail_total_strip_all_, me_occ_pid_, me_occ_pid_eta_, PV3DBase< T, PVType, FrameType >::perp(), edm::Handle< T >::product(), sistrip::SpyUtilities::range(), GEMDetId::region(), HLT_FULL_cff::region, GEMGeometry::regions(), simhit_token_, relativeConstraints::station, digitizers_cfi::strip, strip_token_, GeomDet::surface(), GEMBaseValidation::toDegree(), Surface::toGlobal(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

160  {
161  const GEMGeometry* gem = &setup.getData(geomToken_);
162  if (gem == nullptr) {
163  edm::LogError(kLogCategory_) << "Failed to initialize GEM geometry.";
164  return;
165  }
166 
168  event.getByToken(digisimlink_token_, digiSimLink);
169  if (not digiSimLink.isValid()) {
170  edm::LogError(kLogCategory_) << "Failed to get GEMDigiSimLink." << std::endl;
171  return;
172  }
173 
174  edm::Handle<edm::PSimHitContainer> simhit_container;
175  event.getByToken(simhit_token_, simhit_container);
176  if (not simhit_container.isValid()) {
177  edm::LogError(kLogCategory_) << "Failed to get PSimHitContainer." << std::endl;
178  return;
179  }
180 
181  edm::Handle<GEMDigiCollection> digi_collection;
182  event.getByToken(strip_token_, digi_collection);
183  if (not digi_collection.isValid()) {
184  edm::LogError(kLogCategory_) << "Cannot get strips by Token stripToken." << std::endl;
185  return;
186  }
187 
188  // NOTE
189  Int_t total_strip = 0;
190  std::map<ME2IdsKey, Int_t> total_strip_2IdsMap;
191  for (const auto digi_pair : *digi_collection) {
192  GEMDetId id = digi_pair.first;
193  if (gem->idToDet(id) == nullptr) {
194  edm::LogError(kLogCategory_) << "Getting DetId failed. Discard this gem strip hit. Maybe it comes "
195  << "from unmatched geometry." << std::endl;
196  continue;
197  }
198 
199  Int_t region_id = id.region();
200  Int_t layer_id = id.layer();
201  Int_t station_id = id.station();
202  Int_t chamber_id = id.chamber();
203  Int_t ieta = id.ieta();
204  Int_t num_layers = id.nlayers();
205 
206  ME2IdsKey key2{region_id, station_id};
207  ME3IdsKey key3{region_id, station_id, layer_id};
208  Int_t bin_x = getDetOccBinX(num_layers, chamber_id, layer_id);
209 
210  const BoundPlane& surface = gem->idToDet(id)->surface();
211  const GEMEtaPartition* roll = gem->etaPartition(id);
212 
213  const GEMDigiCollection::Range& range = digi_pair.second;
214  auto links = digiSimLink->find(id);
215  if (links == digiSimLink->end())
216  continue;
217 
218  for (auto digi = range.first; digi != range.second; ++digi) {
219  total_strip++;
220  total_strip_2IdsMap[key2]++;
221  Int_t strip = digi->strip();
222  Int_t bx = digi->bx();
223  bx = bx < -10 ? -10 : bx;
224  bx = bx > 10 ? 10 : bx;
225 
226  GlobalPoint strip_global_pos = surface.toGlobal(roll->centreOfStrip(strip));
227 
228  Float_t digi_g_x = strip_global_pos.x();
229  Float_t digi_g_y = strip_global_pos.y();
230  Float_t digi_g_r = strip_global_pos.perp();
231  Float_t digi_g_abs_z = std::abs(strip_global_pos.z());
232 
233  if (detail_plot_) {
234  me_detail_bx_->Fill(bx);
235  me_detail_bx_layer_[key3]->Fill(bx);
236 
237  me_detail_occ_zr_[region_id]->Fill(digi_g_abs_z, digi_g_r);
238  me_detail_occ_det_[key2]->Fill(bin_x, ieta);
239  me_detail_occ_xy_[key3]->Fill(digi_g_x, digi_g_y);
240  me_detail_occ_strip_[key3]->Fill(strip);
241  }
242  }
243  } // range loop
244  if (detail_plot_) {
245  me_detail_total_strip_all_->Fill(total_strip);
246  for (const auto& region : gem->regions()) {
247  Int_t region_id = region->region();
248  for (const auto& station : region->stations()) {
249  Int_t station_id = station->station();
250  ME2IdsKey key2{region_id, station_id};
251  me_detail_total_strip_[key2]->Fill(total_strip_2IdsMap[key2]);
252  }
253  }
254  }
255 
256  // NOTE
257  for (const auto& simhit : *simhit_container.product()) {
258  if (gem->idToDet(simhit.detUnitId()) == nullptr) {
259  edm::LogError(kLogCategory_) << "SimHit did not match with GEMGeometry." << std::endl;
260  continue;
261  }
262 
263  GEMDetId simhit_gemid(simhit.detUnitId());
264 
265  Int_t region_id = simhit_gemid.region();
266  Int_t station_id = simhit_gemid.station();
267  Int_t layer_id = simhit_gemid.layer();
268  Int_t chamber_id = simhit_gemid.chamber();
269  Int_t ieta = simhit_gemid.ieta();
270  Int_t num_layers = simhit_gemid.nlayers();
271 
272  ME3IdsKey key{region_id, station_id, ieta};
273  ME2IdsKey key2{region_id, station_id};
274  ME3IdsKey key3{region_id, station_id, layer_id};
275 
276  const GEMEtaPartition* roll = gem->etaPartition(simhit_gemid);
277 
278  const auto& simhit_local_pos = simhit.localPosition();
279  const auto& simhit_global_pos = roll->surface().toGlobal(simhit_local_pos);
280 
281  Float_t simhit_g_eta = std::abs(simhit_global_pos.eta());
282  Float_t simhit_g_phi = toDegree(simhit_global_pos.phi());
283 
284  auto simhit_trackId = simhit.trackId();
285 
286  Int_t bin_x = getDetOccBinX(num_layers, chamber_id, layer_id);
287 
288  auto links = digiSimLink->find(simhit_gemid);
289  if (links == digiSimLink->end())
290  continue;
291 
292  for (const auto& link : *links) {
293  if (simhit_trackId == link.getTrackId()) {
294  Int_t pid = simhit.particleType();
295  Int_t pid_idx = getPidIdx(pid);
296 
297  me_occ_pid_[key2]->Fill(pid_idx);
298  me_occ_pid_eta_[key]->Fill(pid_idx);
299 
300  if (detail_plot_) {
301  if (isMuonSimHit(simhit)) {
302  me_detail_strip_occ_eta_[key3]->Fill(simhit_g_eta);
303  me_detail_strip_occ_phi_[key3]->Fill(simhit_g_phi);
304  me_detail_strip_occ_det_[key2]->Fill(bin_x, ieta);
305  }
306  }
307  break;
308  }
309  }
310  } // simhit_container loop
311 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
T perp() const
Definition: PV3DBase.h:69
Bool_t isMuonSimHit(const PSimHit &)
const GeomDet * idToDet(DetId) const override
Definition: GEMGeometry.cc:25
T y() const
Definition: PV3DBase.h:60
MonitorElement * me_detail_total_strip_all_
Log< level::Error, false > LogError
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
const GEMEtaPartition * etaPartition(GEMDetId id) const
Return a GEMEtaPartition given its id.
Definition: GEMGeometry.cc:77
LocalPoint centreOfStrip(int strip) const
const uint16_t range(const Frame &aFrame)
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geomToken_
void Fill(long long x)
bool getData(T &iHolder) const
Definition: EventSetup.h:128
edm::EDGetTokenT< edm::DetSetVector< GEMDigiSimLink > > digisimlink_token_
constexpr int region() const
Definition: GEMDetId.h:171
const std::vector< const GEMRegion * > & regions() const
Return a vector of all GEM regions.
Definition: GEMGeometry.cc:30
T z() const
Definition: PV3DBase.h:61
Int_t getPidIdx(Int_t pid)
tuple key
prepare the HTCondor submission files and eventually submit them
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< GEMDigiCollection > strip_token_
T const * product() const
Definition: Handle.h:70
std::pair< const_iterator, const_iterator > Range
edm::EDGetTokenT< edm::PSimHitContainer > simhit_token_
std::tuple< Int_t, Int_t > ME2IdsKey
Float_t toDegree(Float_t radian)
std::tuple< Int_t, Int_t, Int_t > ME3IdsKey
Int_t getDetOccBinX(Int_t num_layers, Int_t chamber_id, Int_t layer_id)
T x() const
Definition: PV3DBase.h:59
const std::string kLogCategory_
void GEMStripDigiValidation::bookHistograms ( DQMStore::IBooker booker,
edm::Run const &  run,
edm::EventSetup const &  setup 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 21 of file GEMStripDigiValidation.cc.

References dqm::implementation::IBooker::book1D(), GEMBaseValidation::bookDetectorOccupancy(), GEMBaseValidation::bookHist1D(), GEMBaseValidation::bookPIDHist(), GEMBaseValidation::bookXYOccupancy(), GEMBaseValidation::bookZROccupancy(), GEMSuperChamber::chambers(), chambers, GEMBaseValidation::detail_plot_, GEMBaseValidation::eta_range_, geomTokenBeginRun_, edm::EventSetup::getData(), submitPVResolutionJobs::key, GEMBaseValidation::kLogCategory_, me_detail_bx_, me_detail_bx_layer_, me_detail_occ_det_, me_detail_occ_strip_, me_detail_occ_xy_, me_detail_occ_zr_, me_detail_strip_occ_det_, me_detail_strip_occ_eta_, me_detail_strip_occ_phi_, me_detail_total_strip_, me_detail_total_strip_all_, me_occ_pid_, me_occ_pid_eta_, HLT_FULL_cff::region, GEMGeometry::regions(), dqm::implementation::NavigatorBase::setCurrentFolder(), and relativeConstraints::station.

23  {
24  const GEMGeometry* gem = &setup.getData(geomTokenBeginRun_);
25  if (gem == nullptr) {
26  edm::LogError(kLogCategory_) << "Failed to initialize GEM geometry.";
27  return;
28  }
29 
30  // NOTE Bunch Crossing
31  booker.setCurrentFolder("GEM/Digis");
32 
33  if (detail_plot_) {
34  me_detail_bx_ = booker.book1D("bx", "Strip Digi Bunch Crossing", 5, -2.5, 2.5);
35 
36  for (const auto& region : gem->regions()) {
37  if (region == nullptr) {
38  edm::LogError(kLogCategory_) << "Null region";
39  continue;
40  }
41  Int_t region_id = region->region();
42  for (const auto& station : region->stations()) {
43  if (station == nullptr) {
44  edm::LogError(kLogCategory_) << "Null station for region = " << region_id;
45  continue;
46  }
47  Int_t station_id = station->station();
48 
49  const auto& superChamberVec = station->superChambers();
50  if (superChamberVec.empty()) {
51  edm::LogError(kLogCategory_) << "Super chambers missing for region = " << region_id
52  << " and station = " << station_id;
53  continue;
54  }
55  const GEMSuperChamber* super_chamber = superChamberVec.front();
56  if (super_chamber == nullptr) {
57  edm::LogError(kLogCategory_) << "Failed to find super chamber for region = " << region_id
58  << " and station = " << station_id;
59  continue;
60  }
61  for (const auto& chamber : super_chamber->chambers()) {
62  Int_t layer_id = chamber->id().layer();
63  ME3IdsKey key3(region_id, station_id, layer_id);
64 
65  me_detail_bx_layer_[key3] =
66  bookHist1D(booker, key3, "bx", "Strip Digi Bunch Crossing", 5, -2.5, 2.5, "Bunch crossing");
67  } // chamber loop
68  } // station loop
69  } // region loop
70  }
71 
72  // NOTE Occupancy
73  if (detail_plot_)
75  booker.book1D("total_strips_per_event", "Number of strip digi per event", 50, -0.5, 395.5);
76 
77  for (const auto& region : gem->regions()) {
78  Int_t region_id = region->region();
79 
80  if (detail_plot_)
81  me_detail_occ_zr_[region_id] = bookZROccupancy(booker, region_id, "strip", "Strip Digi");
82 
83  for (const auto& station : region->stations()) {
84  Int_t station_id = station->station();
85  ME2IdsKey key2{region_id, station_id};
86 
87  me_occ_pid_[key2] = bookPIDHist(booker, key2, "sim_occ_pid", "Particle population");
88 
89  if (detail_plot_) {
91  bookHist1D(booker, key2, "total_strips_per_event", "Number of strip digs per event", 50, -0.5, 99.5);
92 
93  me_detail_occ_det_[key2] = bookDetectorOccupancy(booker, key2, station, "strip", "Strip Digi");
94 
96  bookDetectorOccupancy(booker, key2, station, "sim_matched_strip", "Matched Strip Digi");
97  }
98 
99  const auto& superChamberVec = station->superChambers();
100  if (superChamberVec.empty() || superChamberVec[0] == nullptr) {
101  edm::LogError(kLogCategory_) << "Super chambers missing or null for region = " << region_id
102  << " and station = " << station_id;
103  } else {
104  for (const auto& etaPart : superChamberVec[0]->chambers()[0]->etaPartitions()) {
105  Int_t ieta = etaPart->id().ieta();
106  ME3IdsKey key{region_id, station_id, ieta};
107  me_occ_pid_eta_[key] = bookPIDHist(booker, key2, ieta, "sim_occ_pid", "Particle population");
108  }
109  for (const auto& chamber : superChamberVec[0]->chambers()) {
110  if (chamber == nullptr) {
111  edm::LogError(kLogCategory_) << "Null chamber for region, station, super chamber = (" << region_id << ", "
112  << station_id << ", " << superChamberVec[0]->id() << ")";
113  continue;
114  }
115  Int_t layer_id = chamber->id().layer();
116  ME3IdsKey key3{region_id, station_id, layer_id};
117 
118  const auto& etaPartitionsVec = chamber->etaPartitions();
119  if (etaPartitionsVec.empty() || etaPartitionsVec.front() == nullptr) {
121  << "Eta partition missing or null for region, station, super chamber, chamber = (" << region_id << ", "
122  << station_id << ", " << superChamberVec[0]->id() << ", " << chamber->id() << ")";
123  continue;
124  }
125 
126  if (detail_plot_) {
127  Int_t num_strips = etaPartitionsVec.front()->nstrips();
128 
129  me_detail_strip_occ_eta_[key3] = bookHist1D(booker,
130  key3,
131  "sim_matched_occ_eta",
132  "Matched Strip Eta Occupancy",
133  16,
134  eta_range_[station_id * 2 + 0],
135  eta_range_[station_id * 2 + 1],
136  "#eta");
137 
139  booker, key3, "sim_matched_occ_phi", "Matched Strip Phi Occupancy", 36, -5, 355, "#phi [degrees]");
140 
141  me_detail_occ_xy_[key3] = bookXYOccupancy(booker, key3, "strip", "Strip Digi");
142 
143  me_detail_occ_strip_[key3] = bookHist1D(booker,
144  key3,
145  "occ_strip",
146  "Strip Digi Occupancy per strip number",
147  num_strips,
148  0.5,
149  num_strips + 0.5,
150  "strip number");
151  }
152  } // chamber
153  } // end else
154  } // station looop
155  } // region loop
156 }
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")
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geomTokenBeginRun_
MonitorElement * me_detail_total_strip_all_
Log< level::Error, false > LogError
dqm::impl::MonitorElement * bookZROccupancy(DQMStore::IBooker &booker, Int_t region_id, const char *name_prfix, const char *title_prefix)
dqm::impl::MonitorElement * bookXYOccupancy(DQMStore::IBooker &booker, const T &key, const char *name_prefix, const char *title_prefix)
const std::vector< const GEMRegion * > & regions() const
Return a vector of all GEM regions.
Definition: GEMGeometry.cc:30
tuple key
prepare the HTCondor submission files and eventually submit them
std::vector< Double_t > eta_range_
const std::vector< const GEMChamber * > & chambers() const
Return the chambers in the super chamber.
std::tuple< Int_t, Int_t > ME2IdsKey
std::tuple< Int_t, Int_t, Int_t > ME3IdsKey
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
dqm::impl::MonitorElement * bookPIDHist(DQMStore::IBooker &booker, const T &key, const char *name, const char *title)
const std::string kLogCategory_
dqm::impl::MonitorElement * bookDetectorOccupancy(DQMStore::IBooker &booker, const T &key, const GEMStation *station, const char *name_prfix, const char *title_prefix)

Member Data Documentation

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

Definition at line 21 of file GEMStripDigiValidation.h.

Referenced by analyze(), and GEMStripDigiValidation().

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

Definition at line 22 of file GEMStripDigiValidation.h.

Referenced by analyze(), and GEMStripDigiValidation().

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

Definition at line 23 of file GEMStripDigiValidation.h.

Referenced by bookHistograms(), and GEMStripDigiValidation().

MonitorElement* GEMStripDigiValidation::me_detail_bx_
private

Definition at line 36 of file GEMStripDigiValidation.h.

Referenced by analyze(), and bookHistograms().

MEMap3Ids GEMStripDigiValidation::me_detail_bx_layer_
private

Definition at line 37 of file GEMStripDigiValidation.h.

Referenced by analyze(), and bookHistograms().

MEMap2Ids GEMStripDigiValidation::me_detail_occ_det_
private

Definition at line 31 of file GEMStripDigiValidation.h.

Referenced by analyze(), and bookHistograms().

MEMap3Ids GEMStripDigiValidation::me_detail_occ_strip_
private

Definition at line 33 of file GEMStripDigiValidation.h.

Referenced by analyze(), and bookHistograms().

MEMap3Ids GEMStripDigiValidation::me_detail_occ_xy_
private

Definition at line 32 of file GEMStripDigiValidation.h.

Referenced by analyze(), and bookHistograms().

MEMap1Ids GEMStripDigiValidation::me_detail_occ_zr_
private

Definition at line 30 of file GEMStripDigiValidation.h.

Referenced by analyze(), and bookHistograms().

MEMap2Ids GEMStripDigiValidation::me_detail_strip_occ_det_
private

Definition at line 44 of file GEMStripDigiValidation.h.

Referenced by analyze(), and bookHistograms().

MEMap3Ids GEMStripDigiValidation::me_detail_strip_occ_eta_
private

Definition at line 42 of file GEMStripDigiValidation.h.

Referenced by analyze(), and bookHistograms().

MEMap3Ids GEMStripDigiValidation::me_detail_strip_occ_phi_
private

Definition at line 43 of file GEMStripDigiValidation.h.

Referenced by analyze(), and bookHistograms().

MEMap2Ids GEMStripDigiValidation::me_detail_total_strip_
private

Definition at line 29 of file GEMStripDigiValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GEMStripDigiValidation::me_detail_total_strip_all_
private

Definition at line 28 of file GEMStripDigiValidation.h.

Referenced by analyze(), and bookHistograms().

MEMap2Ids GEMStripDigiValidation::me_occ_pid_
private

Definition at line 40 of file GEMStripDigiValidation.h.

Referenced by analyze(), and bookHistograms().

MEMap3Ids GEMStripDigiValidation::me_occ_pid_eta_
private

Definition at line 41 of file GEMStripDigiValidation.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 20 of file GEMStripDigiValidation.h.

Referenced by analyze(), and GEMStripDigiValidation().

edm::EDGetTokenT<GEMDigiCollection> GEMStripDigiValidation::strip_token_
private

Definition at line 19 of file GEMStripDigiValidation.h.

Referenced by analyze(), and GEMStripDigiValidation().