CMS 3D CMS Logo

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

#include <MuonME0SegHarvestor.h>

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

Public Member Functions

TProfile * ComputeEff (TH1F *num, TH1F *denum, std::string nameHist)
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
 MuonME0SegHarvestor (const edm::ParameterSet &)
 constructor More...
 
void ProcessBooking (DQMStore::IBooker &, DQMStore::IGetter &, std::string nameHist, TH1F *num, TH1F *den)
 
 ~MuonME0SegHarvestor () override
 destructor More...
 
- 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 endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &es) 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::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () 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
 
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 Attributes

std::string dbe_path_
 

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>
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)
 
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< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 18 of file MuonME0SegHarvestor.h.

Constructor & Destructor Documentation

◆ MuonME0SegHarvestor()

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

constructor

Geometry.

Log messages

Definition at line 32 of file MuonME0SegHarvestor.cc.

32  {
33  dbe_path_ = std::string("MuonME0RecHitsV/ME0SegmentsTask/");
34 }

References dbe_path_, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~MuonME0SegHarvestor()

MuonME0SegHarvestor::~MuonME0SegHarvestor ( )
override

destructor

Definition at line 36 of file MuonME0SegHarvestor.cc.

36 {}

Member Function Documentation

◆ ComputeEff()

TProfile * MuonME0SegHarvestor::ComputeEff ( TH1F *  num,
TH1F *  denum,
std::string  nameHist 
)

Definition at line 38 of file MuonME0SegHarvestor.cc.

38  {
39  std::string name = "eff_" + nameHist;
40  std::string title = "Segment Efficiency" + std::string(num->GetTitle());
41  TProfile *efficHist = new TProfile(name.c_str(),
42  title.c_str(),
43  denum->GetXaxis()->GetNbins(),
44  denum->GetXaxis()->GetXmin(),
45  denum->GetXaxis()->GetXmax());
46 
47  for (int i = 1; i <= denum->GetNbinsX(); i++) {
48  double nNum = num->GetBinContent(i);
49  double nDenum = denum->GetBinContent(i);
50  if (nDenum == 0 || nNum == 0) {
51  continue;
52  }
53  if (nNum > nDenum) {
54  double temp = nDenum;
55  nDenum = nNum;
56  nNum = temp;
57  edm::LogWarning("MuonME0SegHarvestor")
58  << "Alert! specific bin's num is bigger than denum " << i << " " << nNum << " " << nDenum;
59  }
60  const double effVal = nNum / nDenum;
61  efficHist->SetBinContent(i, effVal);
62  efficHist->SetBinEntries(i, 1);
63  efficHist->SetBinError(i, 0);
64  const double errLo = TEfficiency::ClopperPearson((int)nDenum, (int)nNum, 0.683, false);
65  const double errUp = TEfficiency::ClopperPearson((int)nDenum, (int)nNum, 0.683, true);
66  const double errVal = (effVal - errLo > errUp - effVal) ? effVal - errLo : errUp - effVal;
67  efficHist->SetBinError(i, sqrt(effVal * effVal + errVal * errVal));
68  }
69  return efficHist;
70 }

References mps_fire::i, Skims_PA_cff::name, EgammaValidation_cff::num, mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, groupFilesInBlocks::temp, and overlapproblemtsosanalyzer_cfi::title.

Referenced by ProcessBooking().

◆ dqmEndJob()

void MuonME0SegHarvestor::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter ig 
)
overridevirtual

Implements DQMEDHarvester.

Definition at line 95 of file MuonME0SegHarvestor.cc.

95  {
96  ig.setCurrentFolder(dbe_path_);
97 
98  TString eta_label_den = TString(dbe_path_) + "me0_simsegment_eta";
99  TString eta_label_num = TString(dbe_path_) + "me0_matchedsimsegment_eta";
100  TString pt_label_den = TString(dbe_path_) + "me0_simsegment_pt";
101  TString pt_label_num = TString(dbe_path_) + "me0_matchedsimsegment_pt";
102  TString phi_label_den = TString(dbe_path_) + "me0_simsegment_phi";
103  TString phi_label_num = TString(dbe_path_) + "me0_matchedsimsegment_phi";
104 
105  if (ig.get(eta_label_num.Data()) != nullptr && ig.get(eta_label_den.Data()) != nullptr) {
106  TH1F *num_vs_eta = (TH1F *)ig.get(eta_label_num.Data())->getTH1F()->Clone();
107  num_vs_eta->Sumw2();
108  TH1F *den_vs_eta = (TH1F *)ig.get(eta_label_den.Data())->getTH1F()->Clone();
109  den_vs_eta->Sumw2();
110 
111  ProcessBooking(ibooker, ig, "me0segment_eff_vs_eta", num_vs_eta, den_vs_eta);
112 
113  delete num_vs_eta;
114  delete den_vs_eta;
115 
116  } else
117  edm::LogWarning("MuonME0SegHarvestor") << "Can not find histograms: " << eta_label_num << " or " << eta_label_den;
118 
119  if (ig.get(pt_label_num.Data()) != nullptr && ig.get(pt_label_den.Data()) != nullptr) {
120  TH1F *num_vs_pt = (TH1F *)ig.get(pt_label_num.Data())->getTH1F()->Clone();
121  num_vs_pt->Sumw2();
122  TH1F *den_vs_pt = (TH1F *)ig.get(pt_label_den.Data())->getTH1F()->Clone();
123  den_vs_pt->Sumw2();
124 
125  ProcessBooking(ibooker, ig, "me0segment_eff_vs_pt", num_vs_pt, den_vs_pt);
126 
127  delete num_vs_pt;
128  delete den_vs_pt;
129 
130  } else
131  edm::LogWarning("MuonME0SegHarvestor") << "Can not find histograms: " << pt_label_num << " or " << pt_label_den;
132 
133  if (ig.get(phi_label_num.Data()) != nullptr && ig.get(phi_label_den.Data()) != nullptr) {
134  TH1F *num_vs_phi = (TH1F *)ig.get(phi_label_num.Data())->getTH1F()->Clone();
135  num_vs_phi->Sumw2();
136  TH1F *den_vs_phi = (TH1F *)ig.get(phi_label_den.Data())->getTH1F()->Clone();
137  den_vs_phi->Sumw2();
138 
139  ProcessBooking(ibooker, ig, "me0segment_eff_vs_phi", num_vs_phi, den_vs_phi);
140 
141  delete num_vs_phi;
142  delete den_vs_phi;
143 
144  } else
145  edm::LogWarning("MuonME0SegHarvestor") << "Can not find histograms: " << phi_label_num << " or " << phi_label_den;
146 }

References dbe_path_, dqm::implementation::IGetter::get(), ProcessBooking(), and dqm::implementation::NavigatorBase::setCurrentFolder().

◆ ProcessBooking()

void MuonME0SegHarvestor::ProcessBooking ( DQMStore::IBooker ibooker,
DQMStore::IGetter ig,
std::string  nameHist,
TH1F *  num,
TH1F *  den 
)

Definition at line 72 of file MuonME0SegHarvestor.cc.

73  {
74  if (num != nullptr && den != nullptr) {
75  TProfile *profile = ComputeEff(num, den, nameHist);
76 
77  TString x_axis_title = TString(num->GetXaxis()->GetTitle());
78  TString title = TString::Format("Segment Efficiency;%s;Eff.", x_axis_title.Data());
79 
80  profile->SetTitle(title.Data());
81  ibooker.bookProfile(profile->GetName(), profile);
82 
83  delete profile;
84 
85  } else {
86  edm::LogWarning("MuonME0SegHarvestor") << "Can not find histograms";
87  if (num == nullptr)
88  edm::LogWarning("MuonME0SegHarvestor") << "num not found";
89  if (den == nullptr)
90  edm::LogWarning("MuonME0SegHarvestor") << "den not found";
91  }
92  return;
93 }

References dqm::implementation::IBooker::bookProfile(), ComputeEff(), EgammaValidation_cff::num, PostProcessor_cff::profile, and overlapproblemtsosanalyzer_cfi::title.

Referenced by dqmEndJob().

Member Data Documentation

◆ dbe_path_

std::string MuonME0SegHarvestor::dbe_path_
private

Definition at line 30 of file MuonME0SegHarvestor.h.

Referenced by dqmEndJob(), and MuonME0SegHarvestor().

mps_fire.i
i
Definition: mps_fire.py:355
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
MuonME0SegHarvestor::dbe_path_
std::string dbe_path_
Definition: MuonME0SegHarvestor.h:30
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PostProcessor_cff.profile
profile
Definition: PostProcessor_cff.py:38
edm::LogWarning
Definition: MessageLogger.h:141
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
overlapproblemtsosanalyzer_cfi.title
title
Definition: overlapproblemtsosanalyzer_cfi.py:7
MuonME0SegHarvestor::ProcessBooking
void ProcessBooking(DQMStore::IBooker &, DQMStore::IGetter &, std::string nameHist, TH1F *num, TH1F *den)
Definition: MuonME0SegHarvestor.cc:72
MuonME0SegHarvestor::ComputeEff
TProfile * ComputeEff(TH1F *num, TH1F *denum, std::string nameHist)
Definition: MuonME0SegHarvestor.cc:38
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17