CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Public Attributes
GEMDQMEfficiencySourceBase Class Reference

#include <GEMDQMEfficiencySourceBase.h>

Inheritance diagram for GEMDQMEfficiencySourceBase:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator > GEMEffByGEMCSCSegmentSource GEMEfficiencyAnalyzer

Public Types

using MEMap = std::map< GEMDetId, MonitorElement * >
 
- 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
 

Public Member Functions

MonitorElementbookChamber (DQMStore::IBooker &, const TString &, const TString &, const GEMStation *)
 
MonitorElementbookChamberEtaPartition (DQMStore::IBooker &, const TString &, const TString &, const GEMStation *)
 
MonitorElementbookNumerator1D (DQMStore::IBooker &, MonitorElement *)
 
MonitorElementbookNumerator2D (DQMStore::IBooker &, MonitorElement *)
 
template<typename T >
bool checkRefs (const std::vector< T *> &)
 
double clampWithAxis (const double, const TAxis *axis)
 
void fillME (MEMap &, const GEMDetId &, const double)
 
void fillME (MEMap &, const GEMDetId &, const double, const double)
 
void fillMEWithinLimits (MonitorElement *, const double)
 
void fillMEWithinLimits (MonitorElement *, const double, const double)
 
void fillMEWithinLimits (MEMap &, const GEMDetId &, const double)
 
void fillMEWithinLimits (MEMap &, const GEMDetId &, const double, const double)
 
 GEMDQMEfficiencySourceBase (const edm::ParameterSet &)
 
std::tuple< bool, int, int > getChamberRange (const GEMStation *)
 
std::tuple< bool, int, int > getEtaPartitionRange (const GEMStation *)
 
GEMDetId getKey (const GEMDetId &)
 
GEMDetId getReStEtKey (const GEMDetId &)
 
GEMDetId getReStKey (const int, const int)
 
GEMDetId getReStKey (const GEMDetId &)
 
GEMDetId getReStLaChKey (const GEMDetId &)
 
GEMDetId getReStLaKey (const GEMDetId &)
 
bool hasMEKey (const MEMap &, const GEMDetId &)
 
bool maskChamberWithError (const GEMDetId &chamber_id, const GEMOHStatusCollection *, const GEMVFATStatusCollection *)
 
std::string nameNumerator (const std::string &)
 
bool skipGEMStation (const int)
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
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 bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)=0
 
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
 

Public Attributes

const edm::EDGetTokenT< GEMOHStatusCollectionkGEMOHStatusCollectionToken_
 
const edm::EDGetTokenT< GEMVFATStatusCollectionkGEMVFATStatusCollectionToken_
 
const std::string kLogCategory_
 
const bool kMaskChamberWithError_
 
const bool kMonitorGE0_
 
const bool kMonitorGE11_
 
const bool kMonitorGE21_
 

Additional Inherited Members

- 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 DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Author
Seungjin Yang seung.nosp@m.jin..nosp@m.yang@.nosp@m.cern.nosp@m..ch

Definition at line 18 of file GEMDQMEfficiencySourceBase.h.

Member Typedef Documentation

◆ MEMap

Definition at line 20 of file GEMDQMEfficiencySourceBase.h.

Constructor & Destructor Documentation

◆ GEMDQMEfficiencySourceBase()

GEMDQMEfficiencySourceBase::GEMDQMEfficiencySourceBase ( const edm::ParameterSet ps)
explicit

Definition at line 7 of file GEMDQMEfficiencySourceBase.cc.

9  consumes<GEMOHStatusCollection>(ps.getUntrackedParameter<edm::InputTag>("ohStatusTag"))),
11  consumes<GEMVFATStatusCollection>(ps.getUntrackedParameter<edm::InputTag>("vfatStatusTag"))),
12  kMonitorGE11_(ps.getUntrackedParameter<bool>("monitorGE11")),
13  kMonitorGE21_(ps.getUntrackedParameter<bool>("monitorGE21")),
14  kMonitorGE0_(ps.getUntrackedParameter<bool>("monitorGE0")),
15  kMaskChamberWithError_(ps.getUntrackedParameter<bool>("maskChamberWithError")),
16  kLogCategory_(ps.getUntrackedParameter<std::string>("logCategory")) {}
const edm::EDGetTokenT< GEMVFATStatusCollection > kGEMVFATStatusCollectionToken_
T getUntrackedParameter(std::string const &, T const &) const
const edm::EDGetTokenT< GEMOHStatusCollection > kGEMOHStatusCollectionToken_

Member Function Documentation

◆ bookChamber()

dqm::impl::MonitorElement * GEMDQMEfficiencySourceBase::bookChamber ( DQMStore::IBooker ibooker,
const TString &  name,
const TString &  title,
const GEMStation station 
)

Definition at line 140 of file GEMDQMEfficiencySourceBase.cc.

References dqm::implementation::IBooker::book1D(), relativeConstraints::chamber, getChamberRange(), kLogCategory_, label, hlt_dqm_clientPB-live_cfg::me, Skims_PA_cff::name, totemT2DQMSource_cfi::nbinsx, relativeConstraints::station, AlCaHLTBitMon_QueryRunRegistry::string, summarizeEdmComparisonLogfiles::success, runGCPTkAlMap::title, and to_string().

Referenced by GEMEffByGEMCSCSegmentSource::bookHistograms().

143  {
144  if (station == nullptr) {
145  edm::LogError(kLogCategory_) << ""; // TODO
146  return nullptr;
147  }
148 
149  auto [success, first_chamber, last_chamber] = getChamberRange(station);
150  if (not success) {
151  edm::LogError(kLogCategory_) << "failed to get chambers: " << station->getName();
152  return nullptr;
153  }
154 
155  const double xlow = first_chamber - 0.5;
156  const double xup = last_chamber + 0.5;
157  const int nbinsx = last_chamber - first_chamber + 1;
158 
159  MonitorElement* me = ibooker.book1D(name, title, nbinsx, xlow, xup);
160  me->setAxisTitle("Chamber", 1);
161 
162  for (int chamber = first_chamber; chamber <= last_chamber; chamber++) {
164  me->setBinLabel(chamber, label, 1);
165  }
166 
167  return me;
168 }
Log< level::Error, false > LogError
static std::string to_string(const XMLCh *ch)
char const * label
std::tuple< bool, int, int > getChamberRange(const GEMStation *)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ bookChamberEtaPartition()

dqm::impl::MonitorElement * GEMDQMEfficiencySourceBase::bookChamberEtaPartition ( DQMStore::IBooker ibooker,
const TString &  name,
const TString &  title,
const GEMStation station 
)

Definition at line 171 of file GEMDQMEfficiencySourceBase.cc.

References dqm::implementation::IBooker::book2D(), relativeConstraints::chamber, getChamberRange(), getEtaPartitionRange(), hcalRecHitTable_cff::ieta, kLogCategory_, label, hlt_dqm_clientPB-live_cfg::me, Skims_PA_cff::name, totemT2DQMSource_cfi::nbinsx, totemT2DQMSource_cfi::nbinsy, relativeConstraints::station, AlCaHLTBitMon_QueryRunRegistry::string, runGCPTkAlMap::title, and to_string().

Referenced by GEMEfficiencyAnalyzer::bookHistograms().

174  {
175  if (station == nullptr) {
176  edm::LogError(kLogCategory_) << "station is nullptr";
177  return nullptr;
178  }
179 
180  auto [chamber_success, first_chamber, last_chamber] = getChamberRange(station);
181  if (not chamber_success) {
182  edm::LogError(kLogCategory_) << "getChamberRange failed";
183  return nullptr;
184  }
185 
186  auto [ieta_success, first_ieta, last_ieta] = getEtaPartitionRange(station);
187  if (not ieta_success) {
188  edm::LogError(kLogCategory_) << "getEtaPartitionRange failed";
189  return nullptr;
190  }
191 
192  const double xlow = first_chamber - 0.5;
193  const double xup = last_chamber + 0.5;
194  const int nbinsx = last_chamber - first_chamber + 1;
195 
196  const double ylow = first_ieta - 0.5;
197  const double yup = last_ieta + 0.5;
198  const int nbinsy = last_ieta - first_ieta + 1;
199 
200  MonitorElement* me = ibooker.book2D(name, title, nbinsx, xlow, xup, nbinsy, ylow, yup);
201  me->setAxisTitle("Chamber", 1);
202  me->setAxisTitle("i#eta", 2);
203 
204  for (int chamber = first_chamber; chamber <= last_chamber; chamber++) {
206  me->setBinLabel(chamber, label, 1);
207  }
208 
209  for (int ieta = first_ieta; ieta <= last_ieta; ieta++) {
211  me->setBinLabel(ieta, label, 2);
212  }
213 
214  return me;
215 }
std::tuple< bool, int, int > getEtaPartitionRange(const GEMStation *)
Log< level::Error, false > LogError
static std::string to_string(const XMLCh *ch)
char const * label
std::tuple< bool, int, int > getChamberRange(const GEMStation *)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212

◆ bookNumerator1D()

dqm::impl::MonitorElement * GEMDQMEfficiencySourceBase::bookNumerator1D ( DQMStore::IBooker ibooker,
MonitorElement denominator 
)

Definition at line 39 of file GEMDQMEfficiencySourceBase.cc.

References dqm::implementation::IBooker::book1D(), bTagMiniDQMDeepCSV::denominator, compareTotals::hist, kLogCategory_, Skims_PA_cff::name, nameNumerator(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by GEMEffByGEMCSCSegmentSource::bookHistograms(), and GEMEfficiencyAnalyzer::bookHistograms().

40  {
41  if (denominator == nullptr) {
42  edm::LogError(kLogCategory_) << "denominator is nullptr";
43  return nullptr;
44  }
45 
46  const std::string name = nameNumerator(denominator->getName());
47  if (name.empty()) {
48  edm::LogError(kLogCategory_) << "denominator's name is " << denominator->getName()
49  << " but nameNumerator returns an empty string";
50  return nullptr;
51  }
52  TH1F* hist = dynamic_cast<TH1F*>(denominator->getTH1F()->Clone(name.c_str()));
53  return ibooker.book1D(name, hist);
54 }
Log< level::Error, false > LogError
std::string nameNumerator(const std::string &)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ bookNumerator2D()

dqm::impl::MonitorElement * GEMDQMEfficiencySourceBase::bookNumerator2D ( DQMStore::IBooker ibooker,
MonitorElement denominator 
)

Definition at line 57 of file GEMDQMEfficiencySourceBase.cc.

References dqm::implementation::IBooker::book2D(), bTagMiniDQMDeepCSV::denominator, compareTotals::hist, kLogCategory_, Skims_PA_cff::name, nameNumerator(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by GEMEfficiencyAnalyzer::bookHistograms().

58  {
59  if (denominator == nullptr) {
60  edm::LogError(kLogCategory_) << "denominator is nullptr";
61  return nullptr;
62  }
63 
64  const std::string name = nameNumerator(denominator->getName());
65  if (name.empty()) {
66  edm::LogError(kLogCategory_) << "denominator's name is " << denominator->getName()
67  << " but nameNumerator returns an empty string";
68  return nullptr;
69  }
70 
71  // TODO check if getTH2F is not None
72  TH2F* hist = dynamic_cast<TH2F*>(denominator->getTH2F()->Clone(name.c_str()));
73  return ibooker.book2D(name, hist);
74 }
Log< level::Error, false > LogError
std::string nameNumerator(const std::string &)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212

◆ checkRefs()

template<typename T >
bool GEMDQMEfficiencySourceBase::checkRefs ( const std::vector< T *> &  refs)

Definition at line 71 of file GEMDQMEfficiencySourceBase.h.

Referenced by GEMEffByGEMCSCSegmentSource::bookHistograms(), GEMEfficiencyAnalyzer::bookHistograms(), getChamberRange(), and getEtaPartitionRange().

71  {
72  if (refs.empty())
73  return false;
74  for (T* each : refs) {
75  if (each == nullptr) {
76  return false;
77  }
78  }
79  return true;
80 }
long double T

◆ clampWithAxis()

double GEMDQMEfficiencySourceBase::clampWithAxis ( const double  value,
const TAxis *  axis 
)

Definition at line 295 of file GEMDQMEfficiencySourceBase.cc.

Referenced by fillMEWithinLimits().

295  {
296  const double first_bin_center = axis->GetBinCenter(1);
297  const double last_bin_center = axis->GetBinCenter(axis->GetNbins());
298  return std::clamp(value, first_bin_center, last_bin_center);
299 }
Definition: value.py:1

◆ fillME() [1/2]

void GEMDQMEfficiencySourceBase::fillME ( MEMap me_map,
const GEMDetId key,
const double  x 
)

Definition at line 283 of file GEMDQMEfficiencySourceBase.cc.

References hasMEKey(), submitPVResolutionJobs::key, and x.

Referenced by GEMEfficiencyAnalyzer::analyze(), and GEMEffByGEMCSCSegmentSource::checkCoincidenceGE11().

283  {
284  if (hasMEKey(me_map, key)) {
285  me_map[key]->Fill(x);
286  }
287 }
key
prepare the HTCondor submission files and eventually submit them
bool hasMEKey(const MEMap &, const GEMDetId &)

◆ fillME() [2/2]

void GEMDQMEfficiencySourceBase::fillME ( MEMap me_map,
const GEMDetId key,
const double  x,
const double  y 
)

Definition at line 289 of file GEMDQMEfficiencySourceBase.cc.

References hasMEKey(), submitPVResolutionJobs::key, x, and y.

289  {
290  if (hasMEKey(me_map, key)) {
291  me_map[key]->Fill(x, y);
292  }
293 }
key
prepare the HTCondor submission files and eventually submit them
bool hasMEKey(const MEMap &, const GEMDetId &)

◆ fillMEWithinLimits() [1/4]

void GEMDQMEfficiencySourceBase::fillMEWithinLimits ( MonitorElement me,
const double  x 
)

Definition at line 302 of file GEMDQMEfficiencySourceBase.cc.

References clampWithAxis(), kLogCategory_, hlt_dqm_clientPB-live_cfg::me, and x.

Referenced by GEMEfficiencyAnalyzer::analyze(), GEMEffByGEMCSCSegmentSource::checkCoincidenceGE11(), and fillMEWithinLimits().

302  {
303  if (me == nullptr) {
304  edm::LogError(kLogCategory_) << "MonitorElement is nullptr";
305  return;
306  }
307  // FIXME assume that GEMDQMEfficiencySourceBase uses only TH1F fo 1d histograms
308  const TAxis* x_axis = me->getTH1F()->GetXaxis();
309  me->Fill(clampWithAxis(x, x_axis));
310 }
Log< level::Error, false > LogError
double clampWithAxis(const double, const TAxis *axis)

◆ fillMEWithinLimits() [2/4]

void GEMDQMEfficiencySourceBase::fillMEWithinLimits ( MonitorElement me,
const double  x,
const double  y 
)

Definition at line 313 of file GEMDQMEfficiencySourceBase.cc.

References clampWithAxis(), compareTotals::hist, kLogCategory_, hlt_dqm_clientPB-live_cfg::me, x, and y.

313  {
314  if (me == nullptr) {
315  edm::LogError(kLogCategory_) << "MonitorElement is nullptr";
316  return;
317  }
318  // FIXME assume that GEMDQMEfficiencySourceBase uses only TH2F fo 2d histograms
319  const TH2F* hist = me->getTH2F();
320  const TAxis* x_axis = hist->GetXaxis();
321  const TAxis* y_axis = hist->GetYaxis();
322 
323  me->Fill(clampWithAxis(x, x_axis), clampWithAxis(y, y_axis));
324 }
Log< level::Error, false > LogError
double clampWithAxis(const double, const TAxis *axis)

◆ fillMEWithinLimits() [3/4]

void GEMDQMEfficiencySourceBase::fillMEWithinLimits ( MEMap me_map,
const GEMDetId key,
const double  x 
)

Definition at line 326 of file GEMDQMEfficiencySourceBase.cc.

References fillMEWithinLimits(), hasMEKey(), submitPVResolutionJobs::key, and x.

326  {
327  if (hasMEKey(me_map, key)) {
328  fillMEWithinLimits(me_map[key], x);
329  }
330 }
void fillMEWithinLimits(MonitorElement *, const double)
key
prepare the HTCondor submission files and eventually submit them
bool hasMEKey(const MEMap &, const GEMDetId &)

◆ fillMEWithinLimits() [4/4]

void GEMDQMEfficiencySourceBase::fillMEWithinLimits ( MEMap me_map,
const GEMDetId key,
const double  x,
const double  y 
)

Definition at line 332 of file GEMDQMEfficiencySourceBase.cc.

References fillMEWithinLimits(), hasMEKey(), submitPVResolutionJobs::key, x, and y.

332  {
333  if (hasMEKey(me_map, key)) {
334  fillMEWithinLimits(me_map[key], x, y);
335  }
336 }
void fillMEWithinLimits(MonitorElement *, const double)
key
prepare the HTCondor submission files and eventually submit them
bool hasMEKey(const MEMap &, const GEMDetId &)

◆ getChamberRange()

std::tuple< bool, int, int > GEMDQMEfficiencySourceBase::getChamberRange ( const GEMStation station)

Definition at line 77 of file GEMDQMEfficiencySourceBase.cc.

References checkRefs(), kLogCategory_, or, relativeConstraints::station, and HcalDetIdTransform::transform().

Referenced by bookChamber(), and bookChamberEtaPartition().

77  {
78  if (station == nullptr) {
79  return std::make_tuple(false, 0, 0);
80  }
81 
82  const std::vector<const GEMSuperChamber*> superchamber_vec = station->superChambers();
83  if (not checkRefs(superchamber_vec)) {
84  edm::LogError(kLogCategory_) << "GEMStation::superChambers"; // FIXME
85  return std::make_tuple(false, 0, 0);
86  }
87 
88  std::vector<int> id_vec;
89  std::transform(superchamber_vec.begin(),
90  superchamber_vec.end(),
91  std::back_inserter(id_vec),
92  [](const GEMSuperChamber* superchamber) -> int { return superchamber->id().chamber(); });
93  const auto [first_chamber, last_chamber] = std::minmax_element(id_vec.begin(), id_vec.end());
94  if ((first_chamber == id_vec.end()) or (last_chamber == id_vec.end())) {
95  edm::LogError(kLogCategory_) << ""; // TODO
96  return std::make_tuple(false, 0, 0);
97  }
98 
99  return std::make_tuple(true, *first_chamber, *last_chamber);
100 }
Log< level::Error, false > LogError
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
bool checkRefs(const std::vector< T *> &)
unsigned transform(const HcalDetId &id, unsigned transformCode)

◆ getEtaPartitionRange()

std::tuple< bool, int, int > GEMDQMEfficiencySourceBase::getEtaPartitionRange ( const GEMStation station)

Definition at line 103 of file GEMDQMEfficiencySourceBase.cc.

References checkRefs(), kLogCategory_, or, relativeConstraints::station, and HcalDetIdTransform::transform().

Referenced by bookChamberEtaPartition().

103  {
104  if (station == nullptr) {
105  return std::make_tuple(false, 0, 0);
106  }
107 
108  const std::vector<const GEMSuperChamber*> superchamber_vec = station->superChambers();
109  if (not checkRefs(superchamber_vec)) {
110  edm::LogError(kLogCategory_) << "GEMStation::superChambers"; // FIXME
111  return std::make_tuple(false, 0, 0);
112  }
113 
114  const std::vector<const GEMChamber*> chamber_vec = superchamber_vec.front()->chambers();
115  if (not checkRefs(chamber_vec)) {
116  edm::LogError(kLogCategory_) << ""; // TODO
117  return std::make_tuple(false, 0, 0);
118  }
119  const std::vector<const GEMEtaPartition*> eta_partition_vec = chamber_vec.front()->etaPartitions();
120  if (not checkRefs(eta_partition_vec)) {
121  edm::LogError(kLogCategory_) << ""; // TODO
122  return std::make_tuple(false, 0, 0);
123  }
124 
125  std::vector<int> ieta_vec;
126  std::transform(eta_partition_vec.begin(),
127  eta_partition_vec.end(),
128  std::back_inserter(ieta_vec),
129  [](const GEMEtaPartition* each) -> int { return each->id().ieta(); });
130  const auto [first_ieta, last_ieta] = std::minmax_element(ieta_vec.begin(), ieta_vec.end());
131  if ((first_ieta == ieta_vec.end()) or (last_ieta == ieta_vec.end())) {
132  edm::LogError(kLogCategory_) << "failed to find minmax";
133  return std::make_tuple(false, 0, 0);
134  }
135 
136  return std::make_tuple(true, *first_ieta, *last_ieta);
137 }
Log< level::Error, false > LogError
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
bool checkRefs(const std::vector< T *> &)
unsigned transform(const HcalDetId &id, unsigned transformCode)

◆ getKey()

GEMDetId GEMDQMEfficiencySourceBase::getKey ( const GEMDetId id)
inline

Definition at line 103 of file GEMDQMEfficiencySourceBase.h.

References GEMDetId::region().

103  {
104  return GEMDetId{id.region(), 1, id.station(), id.layer(), id.chamber() % 2, id.ieta()};
105 }
constexpr int region() const
Definition: GEMDetId.h:171

◆ getReStEtKey()

GEMDetId GEMDQMEfficiencySourceBase::getReStEtKey ( const GEMDetId id)
inline

Definition at line 95 of file GEMDQMEfficiencySourceBase.h.

References GEMDetId::region().

Referenced by GEMEfficiencyAnalyzer::analyze(), and GEMEfficiencyAnalyzer::bookHistograms().

95  {
96  return GEMDetId{id.region(), 1, id.station(), 0, 0, id.ieta()};
97 }
constexpr int region() const
Definition: GEMDetId.h:171

◆ getReStKey() [1/2]

GEMDetId GEMDQMEfficiencySourceBase::getReStKey ( const int  region,
const int  station 
)
inline

Definition at line 82 of file GEMDQMEfficiencySourceBase.h.

References nano_mu_digi_cff::region, and relativeConstraints::station.

Referenced by GEMEfficiencyAnalyzer::analyze(), GEMEfficiencyAnalyzer::bookHistograms(), and getReStKey().

82  {
83  // region, ring, station, layer, chamber, ieta
84  return GEMDetId{region, 1, station, 0, 0, 0};
85 }

◆ getReStKey() [2/2]

GEMDetId GEMDQMEfficiencySourceBase::getReStKey ( const GEMDetId id)
inline

◆ getReStLaChKey()

GEMDetId GEMDQMEfficiencySourceBase::getReStLaChKey ( const GEMDetId id)
inline

Definition at line 99 of file GEMDQMEfficiencySourceBase.h.

References GEMDetId::region().

99  {
100  return GEMDetId{id.region(), 1, id.station(), id.layer(), id.chamber() % 2, 0};
101 }
constexpr int region() const
Definition: GEMDetId.h:171

◆ getReStLaKey()

GEMDetId GEMDQMEfficiencySourceBase::getReStLaKey ( const GEMDetId id)
inline

Definition at line 91 of file GEMDQMEfficiencySourceBase.h.

References GEMDetId::region().

Referenced by GEMEfficiencyAnalyzer::analyze(), GEMEffByGEMCSCSegmentSource::bookHistograms(), and GEMEfficiencyAnalyzer::bookHistograms().

91  {
92  return GEMDetId{id.region(), 1, id.station(), id.layer(), 0, 0};
93 }
constexpr int region() const
Definition: GEMDetId.h:171

◆ hasMEKey()

bool GEMDQMEfficiencySourceBase::hasMEKey ( const MEMap me_map,
const GEMDetId key 
)

Definition at line 273 of file GEMDQMEfficiencySourceBase.cc.

References submitPVResolutionJobs::key, kLogCategory_, AlCaHLTBitMon_QueryRunRegistry::string, and UNLIKELY.

Referenced by fillME(), and fillMEWithinLimits().

273  {
274  const bool has_key = me_map.find(key) != me_map.end();
275 
276  if UNLIKELY (not has_key) {
277  const std::string hint = me_map.empty() ? "empty" : me_map.begin()->second->getName();
278  edm::LogError(kLogCategory_) << "got an invalid key: " << key << ", hint=" << hint;
279  }
280  return has_key;
281 }
Log< level::Error, false > LogError
key
prepare the HTCondor submission files and eventually submit them
#define UNLIKELY(x)
Definition: Likely.h:21

◆ maskChamberWithError()

bool GEMDQMEfficiencySourceBase::maskChamberWithError ( const GEMDetId chamber_id,
const GEMOHStatusCollection oh_status_collection,
const GEMVFATStatusCollection vfat_status_collection 
)

Definition at line 238 of file GEMDQMEfficiencySourceBase.cc.

References MuonDigiCollection< IndexType, DigiType >::begin(), GEMDetId::chamberId(), MuonDigiCollection< IndexType, DigiType >::end(), ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering::pixelStatus::mask, and FastTimerService_cff::range.

Referenced by GEMEfficiencyAnalyzer::analyze(), and GEMEffByGEMCSCSegmentSource::analyzeGE11ME11Segment().

240  {
241  const bool mask = true;
242 
243  for (auto iter = oh_status_collection->begin(); iter != oh_status_collection->end(); iter++) {
244  const auto [oh_id, range] = (*iter);
245  if (chamber_id != oh_id) {
246  continue;
247  }
248 
249  for (auto oh_status = range.first; oh_status != range.second; oh_status++) {
250  if (oh_status->isBad()) {
251  // GEMOHStatus is bad. Mask this chamber.
252  return mask;
253  } // isBad
254  } // range
255  } // collection
256 
257  for (auto iter = vfat_status_collection->begin(); iter != vfat_status_collection->end(); iter++) {
258  const auto [vfat_id, range] = (*iter);
259  if (chamber_id != vfat_id.chamberId()) {
260  continue;
261  }
262  for (auto vfat_status = range.first; vfat_status != range.second; vfat_status++) {
263  if (vfat_status->isBad()) {
264  return mask;
265  }
266  } // range
267  } // collection
268 
269  return not mask;
270 }
DigiRangeIterator begin() const
DigiRangeIterator end() const

◆ nameNumerator()

std::string GEMDQMEfficiencySourceBase::nameNumerator ( const std::string &  denominator)

Definition at line 19 of file GEMDQMEfficiencySourceBase.cc.

References makeHLTPrescaleTable::delimiter, bTagMiniDQMDeepCSV::denominator, kLogCategory_, bTagMiniDQMDeepCSV::numerator, AlCaHLTBitMon_QueryRunRegistry::string, and summarizeEdmComparisonLogfiles::success.

Referenced by bookNumerator1D(), and bookNumerator2D().

19  {
20  const bool success = TPRegexp("\\w+_GE\\d1-(P|M)[0-9\\-]*").MatchB(denominator);
21  if (not success) {
22  edm::LogError(kLogCategory_) << "denominator name not understood: " << denominator;
23  return std::string{};
24  }
25 
26  const std::string delimiter = "_";
27  const std::string::size_type delimiter_pos = denominator.find_last_of(delimiter);
28  const std::string var_name = denominator.substr(0, delimiter_pos);
29  const std::string gem_name = denominator.substr(delimiter_pos + 1);
30 
31  const std::string numerator = var_name + "_match" + delimiter + gem_name;
32  // e.g. denominator_name = "prop_GE11-P-L1"
33  // tokens = {"prop", "11-P-L1"}
34 
35  return numerator;
36 }
Log< level::Error, false > LogError
uint16_t size_type

◆ skipGEMStation()

bool GEMDQMEfficiencySourceBase::skipGEMStation ( const int  station)

Definition at line 218 of file GEMDQMEfficiencySourceBase.cc.

References kLogCategory_, kMonitorGE0_, kMonitorGE11_, kMonitorGE21_, optionsL1T::skip, and relativeConstraints::station.

Referenced by GEMEffByGEMCSCSegmentSource::bookHistograms(), GEMEfficiencyAnalyzer::bookHistograms(), and GEMEfficiencyAnalyzer::buildGEMLayers().

218  {
219  bool skip = false;
220 
221  if (station == 0) {
222  skip = not kMonitorGE0_;
223 
224  } else if (station == 1) {
225  skip = not kMonitorGE11_;
226 
227  } else if (station == 2) {
228  skip = not kMonitorGE21_;
229 
230  } else {
231  edm::LogError(kLogCategory_) << "got an unexpected GEM station " << station << ". skip this station.";
232  skip = true;
233  }
234 
235  return skip;
236 }
Log< level::Error, false > LogError

Member Data Documentation

◆ kGEMOHStatusCollectionToken_

const edm::EDGetTokenT<GEMOHStatusCollection> GEMDQMEfficiencySourceBase::kGEMOHStatusCollectionToken_

◆ kGEMVFATStatusCollectionToken_

const edm::EDGetTokenT<GEMVFATStatusCollection> GEMDQMEfficiencySourceBase::kGEMVFATStatusCollectionToken_

◆ kLogCategory_

const std::string GEMDQMEfficiencySourceBase::kLogCategory_

◆ kMaskChamberWithError_

const bool GEMDQMEfficiencySourceBase::kMaskChamberWithError_

◆ kMonitorGE0_

const bool GEMDQMEfficiencySourceBase::kMonitorGE0_

Definition at line 65 of file GEMDQMEfficiencySourceBase.h.

Referenced by skipGEMStation().

◆ kMonitorGE11_

const bool GEMDQMEfficiencySourceBase::kMonitorGE11_

Definition at line 63 of file GEMDQMEfficiencySourceBase.h.

Referenced by skipGEMStation().

◆ kMonitorGE21_

const bool GEMDQMEfficiencySourceBase::kMonitorGE21_

Definition at line 64 of file GEMDQMEfficiencySourceBase.h.

Referenced by skipGEMStation().