CMS 3D CMS Logo

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

#include <GEMEfficiencyHarvester.h>

Inheritance diagram for GEMEfficiencyHarvester:
GEMDQMEfficiencyClientBase 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 GEMDQMEfficiencyClientBase
void bookEfficiencyAuto (DQMStore::IBooker &, DQMStore::IGetter &, const std::string &)
 
bool checkConsistency (const TH1 &, const TH1 &)
 
 GEMDQMEfficiencyClientBase (const edm::ParameterSet &)
 
TH1F * makeEfficiency (const TH1F *, const TH1F *, const char *name=nullptr, const char *title=nullptr)
 
TH2F * makeEfficiency (const TH2F *, const TH2F *, const char *name=nullptr, const char *title=nullptr)
 
std::map< std::string, MEPairmakeEfficiencySourcePair (DQMStore::IBooker &, DQMStore::IGetter &, const std::string &, const std::string prefix="")
 
std::tuple< bool, std::string, std::string, bool > parseEfficiencySourceName (std::string)
 
GEMDetId parseGEMLabel (const std::string, const std::string delimiter="-")
 
TH1F * projectHistogram (const TH2F *, const unsigned int)
 
void setBins (TH1F *, const TAxis *)
 
- 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 (edm::ParameterSet const &iConfig)
 
 DQMEDHarvester ()
 
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
 
 EDProducer (const EDProducer &)=delete
 
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
 
const EDProduceroperator= (const EDProducer &)=delete
 
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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void bookDetector1DEfficiency (DQMStore::IBooker &, DQMStore::IGetter &, const std::string &)
 

Private Attributes

const std::vector< std::string > kFolders_
 

Additional Inherited Members

- Public Types inherited from GEMDQMEfficiencyClientBase
using MEPair = std::pair< const MonitorElement *, const MonitorElement * >
 
- 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
 
- Public Attributes inherited from GEMDQMEfficiencyClientBase
const double kConfidenceLevel_
 
const std::string kLogCategory_
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
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)
 
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 ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
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<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 
- 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

DQM monitoring client for GEM efficiency and resolution based on Validation/MuonGEMHits/MuonGEMBaseHarvestor

TODO bookSummaryPlot

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

Definition at line 17 of file GEMEfficiencyHarvester.h.

Constructor & Destructor Documentation

◆ GEMEfficiencyHarvester()

GEMEfficiencyHarvester::GEMEfficiencyHarvester ( const edm::ParameterSet ps)

Definition at line 6 of file GEMEfficiencyHarvester.cc.

7  : GEMDQMEfficiencyClientBase(ps), kFolders_(ps.getUntrackedParameter<std::vector<std::string> >("folders")) {}
GEMDQMEfficiencyClientBase(const edm::ParameterSet &)
T getUntrackedParameter(std::string const &, T const &) const
const std::vector< std::string > kFolders_

◆ ~GEMEfficiencyHarvester()

GEMEfficiencyHarvester::~GEMEfficiencyHarvester ( )
override

Definition at line 9 of file GEMEfficiencyHarvester.cc.

9 {}

Member Function Documentation

◆ bookDetector1DEfficiency()

void GEMEfficiencyHarvester::bookDetector1DEfficiency ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
const std::string &  folder 
)
private

Definition at line 27 of file GEMEfficiencyHarvester.cc.

References dqm::implementation::IBooker::book1D(), printsummarytable::folder, crabWrapper::key, GEMDQMEfficiencyClientBase::kLogCategory_, GEMDQMEfficiencyClientBase::makeEfficiency(), GEMDQMEfficiencyClientBase::makeEfficiencySourcePair(), GEMDQMEfficiencyClientBase::parseEfficiencySourceName(), GEMDQMEfficiencyClientBase::projectHistogram(), MonitorElementData::TH2F, and relativeConstraints::value.

Referenced by dqmEndJob().

29  {
30  const std::map<std::string, MEPair> me_pairs = makeEfficiencySourcePair(ibooker, igetter, folder, "chamber_ieta_");
31 
32  for (const auto& [key, value] : me_pairs) {
33  // numerator and denominator
34  const auto& [me_num, me_den] = value;
35 
36  if (me_num->kind() != MonitorElement::Kind::TH2F) {
37  edm::LogError(kLogCategory_) << key << "expected TH2F but got "; // TODO
38  continue;
39  }
40 
41  const TH2F* h_num = me_num->getTH2F();
42  if (h_num == nullptr) {
43  edm::LogError(kLogCategory_) << "numerator: failed to get TH2F from MonitorElement" << key;
44  continue;
45  }
46 
47  const TH2F* h_den = me_den->getTH2F();
48  if (h_den == nullptr) {
49  edm::LogError(kLogCategory_) << "denominator: failed to get TH2F from MonitorElement" << key;
50  continue;
51  }
52 
53  const auto [parsing_success, var_name, gem_name, is_matched] = parseEfficiencySourceName(me_den->getName());
54  if (not parsing_success) {
55  edm::LogError(kLogCategory_) << "failed to parse " << me_den->getName();
56  continue;
57  }
58 
59  // TODO sanity-check
60  const TH1F* h_chamber_num = projectHistogram(h_num, TH1::kXaxis);
61  const TH1F* h_chamber_den = projectHistogram(h_den, TH1::kXaxis);
62  const char* eff_chamber_name = Form("eff_chamber_%s", gem_name.c_str());
63  if (TH1F* eff = makeEfficiency(h_chamber_num, h_chamber_den, eff_chamber_name)) {
64  ibooker.book1D(eff_chamber_name, eff);
65  }
66 
67  const TH1F* h_ieta_num = projectHistogram(h_num, TH1::kYaxis);
68  const TH1F* h_ieta_den = projectHistogram(h_den, TH1::kYaxis);
69  const char* eff_ieta_name = Form("eff_ieta_%s", gem_name.c_str());
70  if (TH1F* eff = makeEfficiency(h_ieta_num, h_ieta_den, eff_ieta_name)) {
71  ibooker.book1D(eff_ieta_name, eff);
72  }
73  } // pairs
74 }
TH1F * makeEfficiency(const TH1F *, const TH1F *, const char *name=nullptr, const char *title=nullptr)
Log< level::Error, false > LogError
TH1F * projectHistogram(const TH2F *, const unsigned int)
Definition: value.py:1
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
std::tuple< bool, std::string, std::string, bool > parseEfficiencySourceName(std::string)
std::map< std::string, MEPair > makeEfficiencySourcePair(DQMStore::IBooker &, DQMStore::IGetter &, const std::string &, const std::string prefix="")

◆ dqmEndJob()

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

Implements DQMEDHarvester.

Definition at line 76 of file GEMEfficiencyHarvester.cc.

References bookDetector1DEfficiency(), GEMDQMEfficiencyClientBase::bookEfficiencyAuto(), printsummarytable::folder, kFolders_, and AlCaHLTBitMon_QueryRunRegistry::string.

76  {
77  for (const std::string& folder : kFolders_) {
78  bookEfficiencyAuto(ibooker, igetter, folder);
79  bookDetector1DEfficiency(ibooker, igetter, folder);
80  }
81 }
void bookDetector1DEfficiency(DQMStore::IBooker &, DQMStore::IGetter &, const std::string &)
void bookEfficiencyAuto(DQMStore::IBooker &, DQMStore::IGetter &, const std::string &)
const std::vector< std::string > kFolders_

◆ fillDescriptions()

void GEMEfficiencyHarvester::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 11 of file GEMEfficiencyHarvester.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

11  {
13 
14  // GEMDQMEfficiencyClientBase
15  desc.addUntracked<double>("confidenceLevel", 0.683); // 1-sigma
16  desc.addUntracked<std::string>("logCategory", "GEMEfficiencyHarvester");
17 
18  // GEMEfficiencyHarvester
19  desc.addUntracked<std::vector<std::string> >("folders", {"GEM/Efficiency/muonSTA"});
20  descriptions.add("gemEfficiencyHarvester", desc);
21 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ kFolders_

const std::vector<std::string> GEMEfficiencyHarvester::kFolders_
private

Definition at line 27 of file GEMEfficiencyHarvester.h.

Referenced by dqmEndJob().