CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes
Primary4DVertexHarvester Class Reference
Inheritance diagram for Primary4DVertexHarvester:
DQMEDHarvester edm::one::EDProducer< T > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 Primary4DVertexHarvester (const edm::ParameterSet &iConfig)
 
 ~Primary4DVertexHarvester () 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 (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< T >
 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
 
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)
 
 ~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 &descriptions)
 
- 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

void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
- Protected Member Functions inherited from edm::ProducerBase
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< B > consumes (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 () noexcept
 
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...
 
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)
 

Private Attributes

const std::string folder_
 
MonitorElementmeMVAEtaMatchEff_
 
MonitorElementmeMVAEtaSelEff_
 
MonitorElementmeMVAPtMatchEff_
 
MonitorElementmeMVAPtSelEff_
 

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
 
- 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 13 of file Primary4DVertexHarvester.cc.

Constructor & Destructor Documentation

Primary4DVertexHarvester::Primary4DVertexHarvester ( const edm::ParameterSet iConfig)
explicit

Definition at line 34 of file Primary4DVertexHarvester.cc.

35  : folder_(iConfig.getParameter<std::string>("folder")) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
Primary4DVertexHarvester::~Primary4DVertexHarvester ( )
override

Definition at line 37 of file Primary4DVertexHarvester.cc.

37 {}

Member Function Documentation

void Primary4DVertexHarvester::dqmEndJob ( DQMStore::IBooker ibook,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 40 of file Primary4DVertexHarvester.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::NavigatorBase::cd(), generateEDF::cont, folder_, dqm::implementation::IGetter::get(), dqm::impl::MonitorElement::getBinContent(), dqm::impl::MonitorElement::getBinError(), dqm::impl::MonitorElement::getEntries(), dqm::impl::MonitorElement::getNbinsX(), dqm::legacy::MonitorElement::getTH1(), meMVAEtaMatchEff_, meMVAEtaSelEff_, meMVAPtMatchEff_, meMVAPtSelEff_, funct::pow(), dqm::impl::MonitorElement::setBinContent(), dqm::impl::MonitorElement::setBinError(), dqm::impl::MonitorElement::setEntries(), and mathSSE::sqrt().

40  {
41  // --- Get the monitoring histograms
42  MonitorElement* meMVATrackEffPtTot = igetter.get(folder_ + "MVAEffPtTot");
43  MonitorElement* meMVATrackMatchedEffPtTot = igetter.get(folder_ + "MVAMatchedEffPtTot");
44  MonitorElement* meMVATrackMatchedEffPtMtd = igetter.get(folder_ + "MVAMatchedEffPtMtd");
45  MonitorElement* meMVATrackEffEtaTot = igetter.get(folder_ + "MVAEffEtaTot");
46  MonitorElement* meMVATrackMatchedEffEtaTot = igetter.get(folder_ + "MVAMatchedEffEtaTot");
47  MonitorElement* meMVATrackMatchedEffEtaMtd = igetter.get(folder_ + "MVAMatchedEffEtaMtd");
48  MonitorElement* meRecoVtxVsLineDensity = igetter.get(folder_ + "RecoVtxVsLineDensity");
49  MonitorElement* meRecVerNumber = igetter.get(folder_ + "RecVerNumber");
50 
51  if (!meMVATrackEffPtTot || !meMVATrackMatchedEffPtTot || !meMVATrackMatchedEffPtMtd || !meMVATrackEffEtaTot ||
52  !meMVATrackMatchedEffEtaTot || !meMVATrackMatchedEffEtaMtd || !meRecoVtxVsLineDensity || !meRecVerNumber) {
53  edm::LogError("Primary4DVertexHarvester") << "Monitoring histograms not found!" << std::endl;
54  return;
55  }
56 
57  // Normalize line density plot
58  double nEvt = meRecVerNumber->getEntries();
59  if (nEvt > 0.) {
60  nEvt = 1. / nEvt;
61  double nEntries = meRecoVtxVsLineDensity->getEntries();
62  for (int ibin = 1; ibin <= meRecoVtxVsLineDensity->getNbinsX(); ibin++) {
63  double cont = meRecoVtxVsLineDensity->getBinContent(ibin) * nEvt;
64  double bin_err = meRecoVtxVsLineDensity->getBinError(ibin) * nEvt;
65  meRecoVtxVsLineDensity->setBinContent(ibin, cont);
66  meRecoVtxVsLineDensity->setBinError(ibin, bin_err);
67  }
68  meRecoVtxVsLineDensity->setEntries(nEntries);
69  }
70 
71  // --- Book histograms
72  ibook.cd(folder_);
73  meMVAPtSelEff_ = ibook.book1D("MVAPtSelEff",
74  "Track selected efficiency VS Pt;Pt [GeV];Efficiency",
75  meMVATrackEffPtTot->getNbinsX(),
76  meMVATrackEffPtTot->getTH1()->GetXaxis()->GetXmin(),
77  meMVATrackEffPtTot->getTH1()->GetXaxis()->GetXmax());
78  meMVAEtaSelEff_ = ibook.book1D("MVAEtaSelEff",
79  "Track selected efficiency VS Eta;Eta;Efficiency",
80  meMVATrackEffEtaTot->getNbinsX(),
81  meMVATrackEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
82  meMVATrackEffEtaTot->getTH1()->GetXaxis()->GetXmax());
83  meMVAPtMatchEff_ = ibook.book1D("MVAPtMatchEff",
84  "Track matched to GEN efficiency VS Pt;Pt [GeV];Efficiency",
85  meMVATrackMatchedEffPtTot->getNbinsX(),
86  meMVATrackMatchedEffPtTot->getTH1()->GetXaxis()->GetXmin(),
87  meMVATrackMatchedEffPtTot->getTH1()->GetXaxis()->GetXmax());
88  meMVAEtaMatchEff_ = ibook.book1D("MVAEtaMatchEff",
89  "Track matched to GEN efficiency VS Eta;Eta;Efficiency",
90  meMVATrackMatchedEffEtaTot->getNbinsX(),
91  meMVATrackMatchedEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
92  meMVATrackMatchedEffEtaTot->getTH1()->GetXaxis()->GetXmax());
93 
94  meMVAPtSelEff_->getTH1()->SetMinimum(0.);
95  meMVAEtaSelEff_->getTH1()->SetMinimum(0.);
96  meMVAPtMatchEff_->getTH1()->SetMinimum(0.);
97  meMVAEtaMatchEff_->getTH1()->SetMinimum(0.);
98 
99  for (int ibin = 1; ibin <= meMVATrackEffPtTot->getNbinsX(); ibin++) {
100  double eff = meMVATrackMatchedEffPtTot->getBinContent(ibin) / meMVATrackEffPtTot->getBinContent(ibin);
101  double bin_err = sqrt((meMVATrackMatchedEffPtTot->getBinContent(ibin) *
102  (meMVATrackEffPtTot->getBinContent(ibin) - meMVATrackMatchedEffPtTot->getBinContent(ibin))) /
103  pow(meMVATrackEffPtTot->getBinContent(ibin), 3));
104  if (meMVATrackEffPtTot->getBinContent(ibin) == 0) {
105  eff = 0;
106  bin_err = 0;
107  }
108  meMVAPtSelEff_->setBinContent(ibin, eff);
109  meMVAPtSelEff_->setBinError(ibin, bin_err);
110  }
111 
112  for (int ibin = 1; ibin <= meMVATrackEffEtaTot->getNbinsX(); ibin++) {
113  double eff = meMVATrackMatchedEffEtaTot->getBinContent(ibin) / meMVATrackEffEtaTot->getBinContent(ibin);
114  double bin_err =
115  sqrt((meMVATrackMatchedEffEtaTot->getBinContent(ibin) *
116  (meMVATrackEffEtaTot->getBinContent(ibin) - meMVATrackMatchedEffEtaTot->getBinContent(ibin))) /
117  pow(meMVATrackEffEtaTot->getBinContent(ibin), 3));
118  if (meMVATrackEffEtaTot->getBinContent(ibin) == 0) {
119  eff = 0;
120  bin_err = 0;
121  }
122  meMVAEtaSelEff_->setBinContent(ibin, eff);
123  meMVAEtaSelEff_->setBinError(ibin, bin_err);
124  }
125 
126  for (int ibin = 1; ibin <= meMVATrackMatchedEffPtTot->getNbinsX(); ibin++) {
127  double eff = meMVATrackMatchedEffPtMtd->getBinContent(ibin) / meMVATrackMatchedEffPtTot->getBinContent(ibin);
128  double bin_err =
129  sqrt((meMVATrackMatchedEffPtMtd->getBinContent(ibin) *
130  (meMVATrackMatchedEffPtTot->getBinContent(ibin) - meMVATrackMatchedEffPtMtd->getBinContent(ibin))) /
131  pow(meMVATrackMatchedEffPtTot->getBinContent(ibin), 3));
132  if (meMVATrackMatchedEffPtTot->getBinContent(ibin) == 0) {
133  eff = 0;
134  bin_err = 0;
135  }
136  meMVAPtMatchEff_->setBinContent(ibin, eff);
137  meMVAPtMatchEff_->setBinError(ibin, bin_err);
138  }
139 
140  for (int ibin = 1; ibin <= meMVATrackMatchedEffEtaTot->getNbinsX(); ibin++) {
141  double eff = meMVATrackMatchedEffEtaMtd->getBinContent(ibin) / meMVATrackMatchedEffEtaTot->getBinContent(ibin);
142  double bin_err =
143  sqrt((meMVATrackMatchedEffEtaMtd->getBinContent(ibin) *
144  (meMVATrackMatchedEffEtaTot->getBinContent(ibin) - meMVATrackMatchedEffEtaMtd->getBinContent(ibin))) /
145  pow(meMVATrackMatchedEffEtaTot->getBinContent(ibin), 3));
146  if (meMVATrackMatchedEffEtaTot->getBinContent(ibin) == 0) {
147  eff = 0;
148  bin_err = 0;
149  }
150  meMVAEtaMatchEff_->setBinContent(ibin, eff);
151  meMVAEtaMatchEff_->setBinError(ibin, bin_err);
152  }
153 }
tuple cont
load Luminosity info ##
Definition: generateEDF.py:628
virtual void setEntries(double nentries)
set # of entries
virtual double getBinError(int binx) const
get uncertainty on content of bin (1-D) - See TH1::GetBinError for details
Log< level::Error, false > LogError
virtual int getNbinsX() const
get # of bins in X-axis
virtual double getEntries() const
get # of entries
T sqrt(T t)
Definition: SSEVec.h:19
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
virtual double getBinContent(int binx) const
get content of bin (1-D)
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
virtual void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
virtual TH1 * getTH1() const
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
void Primary4DVertexHarvester::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 156 of file Primary4DVertexHarvester.cc.

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

156  {
158 
159  desc.add<std::string>("folder", "MTD/Vertices/");
160 
161  descriptions.add("Primary4DVertexPostProcessor", desc);
162 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

const std::string Primary4DVertexHarvester::folder_
private

Definition at line 24 of file Primary4DVertexHarvester.cc.

Referenced by dqmEndJob().

MonitorElement* Primary4DVertexHarvester::meMVAEtaMatchEff_
private

Definition at line 30 of file Primary4DVertexHarvester.cc.

Referenced by dqmEndJob().

MonitorElement* Primary4DVertexHarvester::meMVAEtaSelEff_
private

Definition at line 28 of file Primary4DVertexHarvester.cc.

Referenced by dqmEndJob().

MonitorElement* Primary4DVertexHarvester::meMVAPtMatchEff_
private

Definition at line 29 of file Primary4DVertexHarvester.cc.

Referenced by dqmEndJob().

MonitorElement* Primary4DVertexHarvester::meMVAPtSelEff_
private

Definition at line 27 of file Primary4DVertexHarvester.cc.

Referenced by dqmEndJob().