CMS 3D CMS Logo

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

#include <GEMEfficiencyHarvester.h>

Inheritance diagram for GEMEfficiencyHarvester:
DQMEDHarvester edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
 GEMEfficiencyHarvester (const edm::ParameterSet &)
 
 ~GEMEfficiencyHarvester () override
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginJob () override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &) override
 
virtual void dqmAnalyze (DQMStore::IBooker &, DQMStore::IGetter &, edm::Event const &, edm::EventSetup const &)
 
 DQMEDHarvester ()
 
 DQMEDHarvester (edm::ParameterSet const &iConfig)
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (DQMStore::IBooker &, DQMStore::IGetter &, edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &es) final
 
void endProcessBlockProduce (edm::ProcessBlock &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &es) final
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

TProfile * computeEfficiency (const TH1F *, const TH1F *, const char *, const char *, const double confidence_level=0.683)
 
TH2F * computeEfficiency (const TH2F *, const TH2F *, const char *, const char *)
 
void doEfficiency (DQMStore::IBooker &, DQMStore::IGetter &)
 
void doResolution (DQMStore::IBooker &, DQMStore::IGetter &, const std::string)
 
std::tuple< std::string, int, bool, int > parseResidualName (std::string, const std::string)
 
std::vector< std::string > splitString (std::string, const std::string)
 

Private Attributes

std::string folder_
 
std::string log_category_
 

Additional Inherited Members

- Public Types inherited from DQMEDHarvester
typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
- Protected Attributes inherited from DQMEDHarvester
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenjobmegetter_
 
edm::EDPutTokenT< DQMTokenjobToken_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 11 of file GEMEfficiencyHarvester.h.

Constructor & Destructor Documentation

◆ GEMEfficiencyHarvester()

GEMEfficiencyHarvester::GEMEfficiencyHarvester ( const edm::ParameterSet pset)

Definition at line 7 of file GEMEfficiencyHarvester.cc.

7  {
8  folder_ = pset.getUntrackedParameter<std::string>("folder");
9  log_category_ = pset.getUntrackedParameter<std::string>("logCategory");
10 }

References folder_, log_category_, muonDTDigis_cfi::pset, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~GEMEfficiencyHarvester()

GEMEfficiencyHarvester::~GEMEfficiencyHarvester ( )
override

Definition at line 12 of file GEMEfficiencyHarvester.cc.

12 {}

Member Function Documentation

◆ computeEfficiency() [1/2]

TProfile * GEMEfficiencyHarvester::computeEfficiency ( const TH1F *  passed,
const TH1F *  total,
const char *  name,
const char *  title,
const double  confidence_level = 0.683 
)
private

Definition at line 14 of file GEMEfficiencyHarvester.cc.

15  {
16  if (not TEfficiency::CheckConsistency(*passed, *total)) {
17  edm::LogError(log_category_) << "failed to pass TEfficiency::CheckConsistency. " << name << std::endl;
18  return nullptr;
19  }
20 
21  const TAxis* total_x = total->GetXaxis();
22 
23  TProfile* eff_profile = new TProfile(name, title, total_x->GetNbins(), total_x->GetXmin(), total_x->GetXmax());
24  eff_profile->GetXaxis()->SetTitle(total_x->GetTitle());
25  eff_profile->GetYaxis()->SetTitle("#epsilon");
26 
27  for (int bin = 1; bin < total->GetNbinsX(); bin++) {
28  double num_passed = passed->GetBinContent(bin);
29  double num_total = total->GetBinContent(bin);
30 
31  if (num_total < 1) {
32  eff_profile->SetBinEntries(bin, 0);
33  continue;
34  }
35 
36  double efficiency = num_passed / num_total;
37 
38  double lower_bound = TEfficiency::ClopperPearson(num_total, num_passed, confidence_level, false);
39  double upper_bound = TEfficiency::ClopperPearson(num_total, num_passed, confidence_level, true);
40 
42  double error = std::hypot(efficiency, width);
43 
44  eff_profile->SetBinContent(bin, efficiency);
45  eff_profile->SetBinError(bin, error);
46  eff_profile->SetBinEntries(bin, 1);
47  }
48 
49  return eff_profile;
50 }

References newFWLiteAna::bin, L1TObjectsTimingClient_cff::efficiency, relativeConstraints::error, log_category_, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, SiStripPI::max, Skims_PA_cff::name, TriggerAnalyzer::passed, runGCPTkAlMap::title, dqmMemoryStats::total, pfDeepBoostedJetPreprocessParams_cfi::upper_bound, and ApeEstimator_cff::width.

Referenced by doEfficiency().

◆ computeEfficiency() [2/2]

TH2F * GEMEfficiencyHarvester::computeEfficiency ( const TH2F *  passed,
const TH2F *  total,
const char *  name,
const char *  title 
)
private

Definition at line 52 of file GEMEfficiencyHarvester.cc.

55  {
56  if (not TEfficiency::CheckConsistency(*passed, *total)) {
57  edm::LogError(log_category_) << "failed to pass TEfficiency::CheckConsistency. " << name << std::endl;
58  return nullptr;
59  }
60 
61  TEfficiency eff(*passed, *total);
62  TH2F* eff_hist = dynamic_cast<TH2F*>(eff.CreateHistogram());
63  eff_hist->SetName(name);
64  eff_hist->SetTitle(title);
65 
66  const TAxis* total_x = total->GetXaxis();
67  TAxis* eff_hist_x = eff_hist->GetXaxis();
68  eff_hist_x->SetTitle(total_x->GetTitle());
69  for (int bin = 1; bin <= total->GetNbinsX(); bin++) {
70  const char* label = total_x->GetBinLabel(bin);
71  eff_hist_x->SetBinLabel(bin, label);
72  }
73 
74  const TAxis* total_y = total->GetYaxis();
75  TAxis* eff_hist_y = eff_hist->GetYaxis();
76  eff_hist_y->SetTitle(total_y->GetTitle());
77  for (int bin = 1; bin <= total->GetNbinsY(); bin++) {
78  const char* label = total_y->GetBinLabel(bin);
79  eff_hist_y->SetBinLabel(bin, label);
80  }
81 
82  return eff_hist;
83 }

References newFWLiteAna::bin, label, log_category_, Skims_PA_cff::name, TriggerAnalyzer::passed, runGCPTkAlMap::title, and dqmMemoryStats::total.

◆ doEfficiency()

void GEMEfficiencyHarvester::doEfficiency ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
private

Definition at line 85 of file GEMEfficiencyHarvester.cc.

85  {
86  const std::string efficiency_folder = folder_ + "/Efficiency/";
87  ibooker.setCurrentFolder(efficiency_folder);
88  igetter.setCurrentFolder(efficiency_folder);
89 
90  std::map<std::string, std::pair<const MonitorElement*, const MonitorElement*> > me_pairs;
91 
92  const std::string matched = "_matched";
93 
94  for (const std::string& name : igetter.getMEs()) {
95  const std::string fullpath = efficiency_folder + name;
96  const MonitorElement* me = igetter.get(fullpath);
97  if (me == nullptr) {
98  edm::LogError(log_category_) << "failed to get " << fullpath << std::endl;
99  continue;
100  }
101 
102  const bool is_matched = name.find(matched) != std::string::npos;
103 
104  std::string key = name;
105  if (is_matched)
106  key.erase(key.find(matched), matched.length());
107 
108  if (me_pairs.find(key) == me_pairs.end()) {
109  me_pairs[key] = {nullptr, nullptr};
110  }
111 
112  if (is_matched)
113  me_pairs[key].first = me;
114  else
115  me_pairs[key].second = me;
116  }
117 
118  for (auto&& [key, value] : me_pairs) {
119  const auto& [me_passed, me_total] = value;
120  if (me_passed == nullptr) {
121  edm::LogError(log_category_) << "numerator is missing. " << key << std::endl;
122  }
123 
124  if (me_total == nullptr) {
125  edm::LogError(log_category_) << "denominator is missing. " << key << std::endl;
126  continue;
127  }
128 
129  if (me_passed->kind() != me_total->kind()) {
130  edm::LogError(log_category_) << "inconsistency between kinds of passed and total" << key << std::endl;
131  continue;
132  }
133 
134  const std::string name = "eff_" + me_total->getName();
135  const std::string title = me_passed->getTitle();
136 
137  if (me_passed->kind() == MonitorElement::Kind::TH1F) {
138  TH1F* h_passed = me_passed->getTH1F();
139  if (h_passed == nullptr) {
140  edm::LogError(log_category_) << "failed to get TH1F from passed " << key << std::endl;
141  continue;
142  }
143  h_passed->Sumw2();
144 
145  TH1F* h_total = me_total->getTH1F();
146  if (h_total == nullptr) {
147  edm::LogError(log_category_) << "failed to get TH1F from total" << key << std::endl;
148  continue;
149  }
150  h_total->Sumw2();
151 
152  TProfile* eff = computeEfficiency(h_passed, h_total, name.c_str(), title.c_str());
153  if (eff == nullptr) {
154  edm::LogError(log_category_) << "failed to compute the efficiency " << key << std::endl;
155  continue;
156  }
157 
158  ibooker.bookProfile(name, eff);
159 
160  } else if (me_passed->kind() == MonitorElement::Kind::TH2F) {
161  TH2F* h_passed = me_passed->getTH2F();
162  if (h_passed == nullptr) {
163  edm::LogError(log_category_) << "failed to get TH1F from passed " << key << std::endl;
164  continue;
165  }
166  h_passed->Sumw2();
167 
168  TH2F* h_total = me_total->getTH2F();
169  if (h_total == nullptr) {
170  edm::LogError(log_category_) << "failed to get TH1F from total" << key << std::endl;
171  continue;
172  }
173  h_total->Sumw2();
174 
175  TH2F* eff = computeEfficiency(h_passed, h_total, name.c_str(), title.c_str());
176  if (eff == nullptr) {
177  edm::LogError(log_category_) << "failed to compute the efficiency " << key << std::endl;
178  continue;
179  }
180 
181  ibooker.book2D(name, eff);
182 
183  } else {
184  edm::LogError(log_category_) << "not implemented" << std::endl;
185  continue;
186  }
187  } // me_pairs
188 }

References dqm::implementation::IBooker::book2D(), dqm::implementation::IBooker::bookProfile(), computeEfficiency(), folder_, reco_skim_cfg_mod::fullpath, dqm::implementation::IGetter::get(), dqm::implementation::IGetter::getMEs(), dqm::legacy::MonitorElement::getTH2F(), crabWrapper::key, log_category_, muonTagProbeFilters_cff::matched, hlt_dqm_clientPB-live_cfg::me, Skims_PA_cff::name, dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, MonitorElementData::TH1F, MonitorElementData::TH2F, runGCPTkAlMap::title, and relativeConstraints::value.

Referenced by dqmEndJob().

◆ doResolution()

void GEMEfficiencyHarvester::doResolution ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
const std::string  prefix 
)
private

Definition at line 243 of file GEMEfficiencyHarvester.cc.

245  {
246  const std::string resolution_folder = folder_ + "/Resolution/";
247 
248  igetter.setCurrentFolder(resolution_folder);
249  ibooker.setCurrentFolder(resolution_folder);
250 
251  std::map<std::tuple<std::string, int, bool>, std::vector<std::pair<int, TH1F*> > > res_data;
252 
253  for (const std::string& name : igetter.getMEs()) {
254  if (name.find(prefix) == std::string::npos)
255  continue;
256 
257  const std::string fullpath = resolution_folder + name;
258  const MonitorElement* me = igetter.get(fullpath);
259  if (me == nullptr) {
260  edm::LogError(log_category_) << "failed to get " << fullpath << std::endl;
261  continue;
262  }
263 
264  TH1F* hist = me->getTH1F();
265  if (hist == nullptr) {
266  edm::LogError(log_category_) << "failed to get TH1F" << std::endl;
267  continue;
268  }
269 
270  auto&& [region_sign, station, is_odd, ieta] = parseResidualName(name, prefix);
271  if (region_sign.empty() or station < 0 or ieta < 0) {
272  edm::LogError(log_category_) << "failed to parse the name of the residual histogram: " << name << std::endl;
273  continue;
274  }
275 
276  const std::tuple<std::string, int, bool> key{region_sign, station, is_odd};
277 
278  if (res_data.find(key) == res_data.end()) {
279  res_data.insert({key, std::vector<std::pair<int, TH1F*> >()});
280  }
281  res_data[key].emplace_back(ieta, hist);
282  } // MonitorElement
283 
285  // NOTE
287  for (auto [key, ieta_data] : res_data) {
288  if (ieta_data.empty()) {
289  continue;
290  }
291 
292  TString tmp_title{ieta_data.front().second->GetTitle()};
293  const TObjArray* tokens = tmp_title.Tokenize(":");
294  TString title = dynamic_cast<TObjString*>(tokens->At(0))->GetString();
295 
296  auto&& [region_sign, station, is_odd] = key;
297  TString&& name = TString::Format("%s_ge%s%d1", prefix.data(), region_sign.c_str(), station);
298  title += TString::Format("GE %s%d/1", region_sign.c_str(), station);
299  if (station == 1) {
300  name += (is_odd ? "_odd" : "_even");
301  title += (is_odd ? ", Odd Superchambers" : ", Even Superchambers");
302  }
303 
304  const int num_etas = ieta_data.size();
305 
306  TH2F* profile = new TH2F(name, title, num_etas, 0.5, num_etas + 0.5, 2, -0.5, 1.5);
307  auto x_axis = profile->GetXaxis();
308 
309  x_axis->SetTitle("i#eta");
310  for (int ieta = 1; ieta <= num_etas; ieta++) {
311  const std::string&& label = std::to_string(ieta);
312  x_axis->SetBinLabel(ieta, label.c_str());
313  }
314 
315  profile->GetYaxis()->SetBinLabel(1, "Mean");
316  profile->GetYaxis()->SetBinLabel(2, "Std. Dev.");
317 
318  for (auto [ieta, hist] : ieta_data) {
319  profile->SetBinContent(ieta, 1, hist->GetMean());
320  profile->SetBinContent(ieta, 2, hist->GetStdDev());
321 
322  profile->SetBinError(ieta, 1, hist->GetMeanError());
323  profile->SetBinError(ieta, 2, hist->GetStdDevError());
324  }
325 
326  ibooker.book2D(name, profile);
327  }
328 }

References dqm::implementation::IBooker::book2D(), folder_, reco_skim_cfg_mod::fullpath, dqm::implementation::IGetter::get(), dqm::implementation::IGetter::getMEs(), compare::hist, LEDCalibrationChannels::ieta, crabWrapper::key, label, log_category_, hlt_dqm_clientPB-live_cfg::me, Skims_PA_cff::name, or, parseResidualName(), ZMuMuAnalysisNtupler_cff::prefix, PostProcessor_cff::profile, dqm::implementation::NavigatorBase::setCurrentFolder(), relativeConstraints::station, AlCaHLTBitMon_QueryRunRegistry::string, and runGCPTkAlMap::title.

Referenced by dqmEndJob().

◆ dqmEndJob()

void GEMEfficiencyHarvester::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overridevirtual

Implements DQMEDHarvester.

Definition at line 330 of file GEMEfficiencyHarvester.cc.

330  {
331  doEfficiency(ibooker, igetter);
332  doResolution(ibooker, igetter, "residual_phi");
333 }

References doEfficiency(), and doResolution().

◆ parseResidualName()

std::tuple< std::string, int, bool, int > GEMEfficiencyHarvester::parseResidualName ( std::string  org_name,
const std::string  prefix 
)
private

Definition at line 202 of file GEMEfficiencyHarvester.cc.

203  {
204  std::string name = org_name;
205 
206  // residual_x_ge-11_odd_ieta4 or residdual_x_ge+21_ieta3
207  // residual_x: prefix
208  name.erase(name.find(prefix), prefix.length());
209  name.erase(name.find("_ge"), 3);
210 
211  const std::vector<std::string>&& tokens = splitString(name, "_");
212  const size_t num_tokens = tokens.size();
213 
214  if ((num_tokens != 2) and (num_tokens != 3)) {
215  return std::make_tuple("", -1, false, -1);
216  }
217 
218  // station != 1
219  std::string region_sign = tokens.front().substr(0, 1);
220 
221  TString station_str = tokens.front().substr(1, 1);
222  TString ieta_str = tokens.back().substr(4, 1);
223  TString superchamber_str = (num_tokens == 3) ? tokens[1] : "";
224 
225  int station = station_str.IsDigit() ? station_str.Atoi() : -1;
226  int ieta = ieta_str.IsDigit() ? ieta_str.Atoi() : -1;
227 
228  bool is_odd;
229  if (station == 1) {
230  if (superchamber_str.EqualTo("odd"))
231  is_odd = true;
232  else if (superchamber_str.EqualTo("even"))
233  is_odd = false;
234  else
235  return std::make_tuple("", -1, false, -1);
236  } else {
237  is_odd = false;
238  }
239 
240  return std::make_tuple(region_sign, station, is_odd, ieta);
241 }

References LEDCalibrationChannels::ieta, Skims_PA_cff::name, ZMuMuAnalysisNtupler_cff::prefix, splitString(), relativeConstraints::station, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by doResolution().

◆ splitString()

std::vector< std::string > GEMEfficiencyHarvester::splitString ( std::string  name,
const std::string  delimiter 
)
private

Definition at line 190 of file GEMEfficiencyHarvester.cc.

190  {
191  std::vector<std::string> tokens;
192  size_t delimiter_pos;
193  size_t delimiter_len = delimiter.length();
194  while ((delimiter_pos = name.find('_')) != std::string::npos) {
195  tokens.push_back(name.substr(0, delimiter_pos));
196  name.erase(0, delimiter_pos + delimiter_len);
197  }
198  tokens.push_back(name);
199  return tokens;
200 }

References makeHLTPrescaleTable::delimiter, and Skims_PA_cff::name.

Referenced by parseResidualName().

Member Data Documentation

◆ folder_

std::string GEMEfficiencyHarvester::folder_
private

Definition at line 28 of file GEMEfficiencyHarvester.h.

Referenced by doEfficiency(), doResolution(), and GEMEfficiencyHarvester().

◆ log_category_

std::string GEMEfficiencyHarvester::log_category_
private
muonTagProbeFilters_cff.matched
matched
Definition: muonTagProbeFilters_cff.py:62
pfDeepBoostedJetPreprocessParams_cfi.upper_bound
upper_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:16
ApeEstimator_cff.width
width
Definition: ApeEstimator_cff.py:24
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
reco_skim_cfg_mod.fullpath
fullpath
Definition: reco_skim_cfg_mod.py:202
GEMEfficiencyHarvester::folder_
std::string folder_
Definition: GEMEfficiencyHarvester.h:28
makeHLTPrescaleTable.delimiter
delimiter
Definition: makeHLTPrescaleTable.py:181
GEMEfficiencyHarvester::parseResidualName
std::tuple< std::string, int, bool, int > parseResidualName(std::string, const std::string)
Definition: GEMEfficiencyHarvester.cc:202
relativeConstraints.station
station
Definition: relativeConstraints.py:67
MonitorElementData::Kind::TH1F
dqm::implementation::IGetter::getMEs
virtual std::vector< std::string > getMEs() const
Definition: DQMStore.cc:698
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
L1TObjectsTimingClient_cff.efficiency
efficiency
Definition: L1TObjectsTimingClient_cff.py:10
GEMEfficiencyHarvester::log_category_
std::string log_category_
Definition: GEMEfficiencyHarvester.h:29
relativeConstraints.error
error
Definition: relativeConstraints.py:53
MonitorElementData::Kind::TH2F
compare.hist
hist
Definition: compare.py:376
dqm::implementation::IBooker::bookProfile
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:322
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PostProcessor_cff.profile
profile
Definition: PostProcessor_cff.py:38
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
GEMEfficiencyHarvester::splitString
std::vector< std::string > splitString(std::string, const std::string)
Definition: GEMEfficiencyHarvester.cc:190
value
Definition: value.py:1
GEMEfficiencyHarvester::doResolution
void doResolution(DQMStore::IBooker &, DQMStore::IGetter &, const std::string)
Definition: GEMEfficiencyHarvester.cc:243
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
GEMEfficiencyHarvester::computeEfficiency
TProfile * computeEfficiency(const TH1F *, const TH1F *, const char *, const char *, const double confidence_level=0.683)
Definition: GEMEfficiencyHarvester.cc:14
relativeConstraints.value
value
Definition: relativeConstraints.py:53
dqm::implementation::IBooker::book2D
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:177
TriggerAnalyzer.passed
passed
Definition: TriggerAnalyzer.py:62
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:651
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
or
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
dqmMemoryStats.total
total
Definition: dqmMemoryStats.py:152
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
crabWrapper.key
key
Definition: crabWrapper.py:19
GEMEfficiencyHarvester::doEfficiency
void doEfficiency(DQMStore::IBooker &, DQMStore::IGetter &)
Definition: GEMEfficiencyHarvester.cc:85
label
const char * label
Definition: PFTauDecayModeTools.cc:11
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
ZMuMuAnalysisNtupler_cff.prefix
prefix
Definition: ZMuMuAnalysisNtupler_cff.py:14
dqm::legacy::MonitorElement::getTH2F
virtual TH2F * getTH2F() const
Definition: MonitorElement.h:490