CMS 3D CMS Logo

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

#include <PFClient.h>

Inheritance diagram for PFClient:
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

 PFClient (const edm::ParameterSet &parameterSet)
 
- 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)
 

Private Member Functions

void createEfficiencyPlots (DQMStore::IBooker &, DQMStore::IGetter &, std::string &folder, std::string &name)
 
void createProfilePlots (DQMStore::IBooker &, DQMStore::IGetter &, std::string &folder, std::string &name)
 
void createProjectionPlots (DQMStore::IBooker &, DQMStore::IGetter &, std::string &folder, std::string &name)
 
void createResolutionPlots (DQMStore::IBooker &, DQMStore::IGetter &, std::string &folder, std::string &name)
 
void doEfficiency (DQMStore::IBooker &, DQMStore::IGetter &)
 
void doProfiles (DQMStore::IBooker &, DQMStore::IGetter &)
 
void doProjection (DQMStore::IBooker &, DQMStore::IGetter &)
 
void doSummaries (DQMStore::IBooker &, DQMStore::IGetter &)
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void getHistogramParameters (MonitorElement *me_slice, double &avarage, double &rms, double &mean, double &sigma)
 

Private Attributes

std::vector< std::string > effHistogramNames_
 
bool efficiencyFlag_
 
std::vector< std::string > folderNames_
 
std::vector< std::string > histogramNames_
 
bool profileFlag_
 
std::vector< std::string > profileHistogramNames_
 
std::vector< std::string > projectionHistogramNames_
 

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<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

Definition at line 11 of file PFClient.h.

Constructor & Destructor Documentation

◆ PFClient()

PFClient::PFClient ( const edm::ParameterSet parameterSet)

Definition at line 13 of file PFClient.cc.

References effHistogramNames_, efficiencyFlag_, folderNames_, edm::ParameterSet::getParameter(), histogramNames_, edm::parameterSet(), profileFlag_, profileHistogramNames_, and projectionHistogramNames_.

13  {
14  folderNames_ = parameterSet.getParameter<std::vector<std::string>>("FolderNames");
15  histogramNames_ = parameterSet.getParameter<std::vector<std::string>>("HistogramNames");
16  efficiencyFlag_ = parameterSet.getParameter<bool>("CreateEfficiencyPlots");
17  effHistogramNames_ = parameterSet.getParameter<std::vector<std::string>>("HistogramNamesForEfficiencyPlots");
18  projectionHistogramNames_ = parameterSet.getParameter<std::vector<std::string>>("HistogramNamesForProjectionPlots");
19  profileFlag_ = parameterSet.getParameter<bool>("CreateProfilePlots");
20  profileHistogramNames_ = parameterSet.getParameter<std::vector<std::string>>("HistogramNamesForProfilePlots");
21 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::vector< std::string > projectionHistogramNames_
Definition: PFClient.h:32
std::vector< std::string > histogramNames_
Definition: PFClient.h:30
ParameterSet const & parameterSet(StableProvenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:11
std::vector< std::string > profileHistogramNames_
Definition: PFClient.h:33
std::vector< std::string > folderNames_
Definition: PFClient.h:29
bool profileFlag_
Definition: PFClient.h:35
std::vector< std::string > effHistogramNames_
Definition: PFClient.h:31
bool efficiencyFlag_
Definition: PFClient.h:34

Member Function Documentation

◆ createEfficiencyPlots()

void PFClient::createEfficiencyPlots ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
std::string &  folder,
std::string &  name 
)
private

Definition at line 313 of file PFClient.cc.

References dqm::implementation::IBooker::book1D(), dqm::impl::MonitorElement::enableSumw2(), printsummarytable::folder, dqm::implementation::IGetter::get(), dqm::legacy::MonitorElement::getTH1F(), hlt_dqm_clientPB-live_cfg::me1, hlt_dqm_clientPB-live_cfg::me2, Skims_PA_cff::name, dqm::impl::MonitorElement::Reset(), dqm::implementation::NavigatorBase::setCurrentFolder(), dqm::impl::MonitorElement::setEfficiencyFlag(), AlCaHLTBitMon_QueryRunRegistry::string, MonitorElementData::TH1F, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.

Referenced by doEfficiency().

316  {
317  MonitorElement *me1 = igetter.get(folder + "/" + name + "ref_");
318  MonitorElement *me2 = igetter.get(folder + "/" + name + "gen_");
319  if (!me1 || !me2)
320  return;
321 
322  TH1F *me1_forEff = (TH1F *)me1->getTH1F()->Rebin(2, "me1_forEff");
323  TH1F *me2_forEff = (TH1F *)me2->getTH1F()->Rebin(2, "me2_forEff");
324 
325  MonitorElement *me_eff;
326  if ((me1->kind() == MonitorElement::Kind::TH1F) && (me1->kind() == MonitorElement::Kind::TH1F)) {
327  // TH1* th1 = me1->getTH1F();
328  // size_t nbinx = me1->getNbinsX();
329  size_t nbinx = me1_forEff->GetNbinsX();
330 
331  // float xmin = th1->GetXaxis()->GetXmin();
332  // float xmax = th1->GetXaxis()->GetXmax();
333  float xmin = me1_forEff->GetXaxis()->GetXmin();
334  float xmax = me1_forEff->GetXaxis()->GetXmax();
335  std::string xtit = me1->getAxisTitle(1);
336  std::string tit_new;
337  tit_new = ";" + xtit + ";" + xtit + " efficiency";
338 
339  ibooker.setCurrentFolder(folder);
340  me_eff = ibooker.book1D("efficiency_" + name, tit_new, nbinx, xmin, xmax);
341 
342  me_eff->Reset();
343  me_eff->setEfficiencyFlag();
344  /*
345  double efficiency;
346  for (size_t ix = 1; ix < nbinx+1; ++ix) {
347  float val1 = me1->getBinContent(ix);
348  float val2 = me2->getBinContent(ix);
349  if (val2 > 0.0) efficiency = val1/val2;
350  else efficiency = 0;
351  me_eff->setBinContent(ix,efficiency);
352  }
353  */
354  // Binomial errors "B" asked by Florian
355  /*me1_forEff->Sumw2(); me2_forEff->Sumw2();*/ me_eff->enableSumw2();
356  me_eff->getTH1F()->Divide(me1_forEff, me2_forEff, 1, 1, "B");
357  }
358 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
virtual TH1F * getTH1F() const
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ createProfilePlots()

void PFClient::createProfilePlots ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
std::string &  folder,
std::string &  name 
)
private

Definition at line 226 of file PFClient.cc.

References dqm::implementation::IBooker::bookProfile(), printsummarytable::folder, dqm::implementation::IGetter::get(), dqm::legacy::MonitorElement::getTProfile(), mps_fire::i, hlt_dqm_clientPB-live_cfg::me, Skims_PA_cff::name, hlt_dqm_clientPB-live_cfg::profileX, dqm::impl::MonitorElement::setBinContent(), dqm::impl::MonitorElement::setBinEntries(), dqm::implementation::NavigatorBase::setCurrentFolder(), dqm::impl::MonitorElement::setEntries(), dqmMemoryStats::stats, AlCaHLTBitMon_QueryRunRegistry::string, MonitorElementData::TH2D, MonitorElementData::TH2F, MonitorElementData::TH2S, fw3dlego::xbins, L1TOccupancyClient_cfi::ymax, and L1TOccupancyClient_cfi::ymin.

Referenced by doProfiles().

229  {
230  MonitorElement *me = igetter.get(folder + "/" + name);
231  if (!me)
232  return;
233 
234  if ((me->kind() == MonitorElement::Kind::TH2F) || (me->kind() == MonitorElement::Kind::TH2S) ||
235  (me->kind() == MonitorElement::Kind::TH2D)) {
236  TH2 *th = me->getTH2F();
237  size_t nbinx = me->getNbinsX();
238 
239  float ymin = th->GetYaxis()->GetXmin();
240  float ymax = th->GetYaxis()->GetXmax();
241  std::string xtit = th->GetXaxis()->GetTitle();
242  std::string ytit = th->GetYaxis()->GetTitle();
243  double *xbins = new double[nbinx + 1];
244  for (size_t ix = 1; ix < nbinx + 1; ++ix) {
245  xbins[ix - 1] = th->GetXaxis()->GetBinLowEdge(ix);
246  if (ix == nbinx)
247  xbins[ix] = th->GetXaxis()->GetBinUpEdge(ix);
248  }
249 
250  std::string tit_new;
251  ibooker.setCurrentFolder(folder);
252  // TProfiles
253  MonitorElement *me_profile[2];
254  me_profile[0] = ibooker.bookProfile("profile_" + name, tit_new, nbinx, xbins, ymin, ymax, "");
255  me_profile[1] = ibooker.bookProfile("profileRMS_" + name, tit_new, nbinx, xbins, ymin, ymax, "s");
256  TProfile *profileX = th->ProfileX();
257  // size_t nbiny = me->getNbinsY();
258  // TProfile* profileX = th->ProfileX("",0,nbiny+1); add underflow and
259  // overflow
260  static const Int_t NUM_STAT = 7;
261  Double_t stats[NUM_STAT] = {0};
262  th->GetStats(stats);
263 
264  for (Int_t i = 0; i < 2; i++) {
265  if (me_profile[i]) {
266  for (size_t ix = 0; ix <= nbinx + 1; ++ix) {
267  me_profile[i]->setBinContent(ix, profileX->GetBinContent(ix) * profileX->GetBinEntries(ix));
268  // me_profile[i]->Fill( profileX->GetBinCenter(ix),
269  // profileX->GetBinContent(ix)*profileX->GetBinEntries(ix) ) ;
270  me_profile[i]->setBinEntries(ix, profileX->GetBinEntries(ix));
271  me_profile[i]->getTProfile()->GetSumw2()->fArray[ix] = profileX->GetSumw2()->fArray[ix];
272  // me_profile[i]->getTProfile()->GetBinSumw2()->fArray[ix] =
273  // profileX->GetBinSumw2()->fArray[ix]; // segmentation violation
274  }
275  }
276  me_profile[i]->getTProfile()->PutStats(stats);
277  me_profile[i]->setEntries(profileX->GetEntries());
278  }
279 
280  delete[] xbins;
281  }
282 }
virtual TProfile * getTProfile() const
const double xbins[]
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
virtual void setEntries(double nentries)
set # of entries
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:399
virtual void setBinEntries(int bin, double nentries)
set # of bin entries (to be used for profiles)
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673

◆ createProjectionPlots()

void PFClient::createProjectionPlots ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
std::string &  folder,
std::string &  name 
)
private

Definition at line 171 of file PFClient.cc.

References dqm::implementation::IBooker::book1D(), printsummarytable::folder, dqm::implementation::IGetter::get(), hlt_dqm_clientPB-live_cfg::me, Skims_PA_cff::name, dqm::impl::MonitorElement::setBinContent(), dqm::implementation::NavigatorBase::setCurrentFolder(), dqm::impl::MonitorElement::setEntries(), AlCaHLTBitMon_QueryRunRegistry::string, MonitorElementData::TH2D, MonitorElementData::TH2F, MonitorElementData::TH2S, fw3dlego::xbins, L1TOccupancyClient_cfi::ymax, and L1TOccupancyClient_cfi::ymin.

Referenced by doProjection().

174  {
175  MonitorElement *me = igetter.get(folder + "/" + name);
176  if (!me)
177  return;
178 
179  MonitorElement *projection = nullptr;
180 
181  if ((me->kind() == MonitorElement::Kind::TH2F) || (me->kind() == MonitorElement::Kind::TH2S) ||
182  (me->kind() == MonitorElement::Kind::TH2D)) {
183  TH2 *th = me->getTH2F();
184  size_t nbinx = me->getNbinsX();
185  size_t nbiny = me->getNbinsY();
186 
187  float ymin = th->GetYaxis()->GetXmin();
188  float ymax = th->GetYaxis()->GetXmax();
189  std::string xtit = th->GetXaxis()->GetTitle();
190  std::string ytit = th->GetYaxis()->GetTitle();
191  float *xbins = new float[nbinx + 1];
192  for (size_t ix = 1; ix < nbinx + 1; ++ix) {
193  xbins[ix - 1] = th->GetXaxis()->GetBinLowEdge(ix);
194  if (ix == nbinx)
195  xbins[ix] = th->GetXaxis()->GetBinUpEdge(ix);
196  }
197 
198  std::string tit_new;
199  ibooker.setCurrentFolder(folder);
200 
201  if (folder == "ParticleFlow/PFElectronValidation/CompWithGenElectron") {
202  if (name == "delta_et_Over_et_VS_et_")
203  projection = ibooker.book1D("delta_et_Over_et", "E_{T} resolution;#DeltaE_{T}/E_{T}", nbiny, ymin, ymax);
204  if (name == "delta_et_VS_et_")
205  projection = ibooker.book1D("delta_et_", "#DeltaE_{T};#DeltaE_{T}", nbiny, ymin, ymax);
206  if (name == "delta_eta_VS_et_")
207  projection = ibooker.book1D("delta_eta_", "#Delta#eta;#Delta#eta", nbiny, ymin, ymax);
208  if (name == "delta_phi_VS_et_")
209  projection = ibooker.book1D("delta_phi_", "#Delta#phi;#Delta#phi", nbiny, ymin, ymax);
210  }
211 
212  if (projection) {
213  for (size_t iy = 1; iy < nbiny + 1; ++iy) {
214  projection->setBinContent(iy, th->ProjectionY("e")->GetBinContent(iy));
215  }
216  projection->setEntries(me->getEntries());
217  }
218 
219  delete[] xbins;
220  }
221 }
const double xbins[]
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
virtual void setEntries(double nentries)
set # of entries
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ createResolutionPlots()

void PFClient::createResolutionPlots ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
std::string &  folder,
std::string &  name 
)
private

Definition at line 104 of file PFClient.cc.

References PDRates::average, dqm::implementation::IBooker::book1D(), printsummarytable::folder, dqm::implementation::IGetter::get(), getHistogramParameters(), hlt_dqm_clientPB-live_cfg::me, SiStripPI::mean, Skims_PA_cff::name, dqm::impl::MonitorElement::Reset(), SiStripPI::rms, dqm::impl::MonitorElement::setBinContent(), dqm::implementation::NavigatorBase::setCurrentFolder(), dqm::impl::MonitorElement::setEfficiencyFlag(), AlCaHLTBitMon_QueryRunRegistry::string, MonitorElementData::TH2D, MonitorElementData::TH2F, MonitorElementData::TH2S, fw3dlego::xbins, L1TOccupancyClient_cfi::ymax, and L1TOccupancyClient_cfi::ymin.

Referenced by doSummaries().

107  {
108  MonitorElement *me = igetter.get(folder + "/" + name);
109 
110  if (!me)
111  return;
112 
113  MonitorElement *me_average;
114  MonitorElement *me_rms;
115  MonitorElement *me_mean;
116  MonitorElement *me_sigma;
117 
118  if ((me->kind() == MonitorElement::Kind::TH2F) || (me->kind() == MonitorElement::Kind::TH2S) ||
119  (me->kind() == MonitorElement::Kind::TH2D)) {
120  TH2 *th = me->getTH2F();
121  size_t nbinx = me->getNbinsX();
122  size_t nbiny = me->getNbinsY();
123 
124  float ymin = th->GetYaxis()->GetXmin();
125  float ymax = th->GetYaxis()->GetXmax();
126  std::string xtit = th->GetXaxis()->GetTitle();
127  std::string ytit = th->GetYaxis()->GetTitle();
128  float *xbins = new float[nbinx + 1];
129  for (size_t ix = 1; ix < nbinx + 1; ++ix) {
130  xbins[ix - 1] = th->GetXaxis()->GetBinLowEdge(ix);
131  if (ix == nbinx)
132  xbins[ix] = th->GetXaxis()->GetBinUpEdge(ix);
133  }
134  std::string tit_new = ";" + xtit + ";" + ytit;
135  ibooker.setCurrentFolder(folder);
136  MonitorElement *me_slice = ibooker.book1D("PFlowSlice", "PFlowSlice", nbiny, ymin, ymax);
137 
138  tit_new = ";" + xtit + ";Average_" + ytit;
139  me_average = ibooker.book1D("average_" + name, tit_new, nbinx, xbins);
140  me_average->setEfficiencyFlag();
141  tit_new = ";" + xtit + ";RMS_" + ytit;
142  me_rms = ibooker.book1D("rms_" + name, tit_new, nbinx, xbins);
143  me_rms->setEfficiencyFlag();
144  tit_new = ";" + xtit + ";Mean_" + ytit;
145  me_mean = ibooker.book1D("mean_" + name, tit_new, nbinx, xbins);
146  me_mean->setEfficiencyFlag();
147  tit_new = ";" + xtit + ";Sigma_" + ytit;
148  me_sigma = ibooker.book1D("sigma_" + name, tit_new, nbinx, xbins);
149  me_sigma->setEfficiencyFlag();
150 
151  double average, rms, mean, sigma;
152 
153  for (size_t ix = 1; ix < nbinx + 1; ++ix) {
154  me_slice->Reset();
155  for (size_t iy = 1; iy < nbiny + 1; ++iy) {
156  me_slice->setBinContent(iy, th->GetBinContent(ix, iy));
157  }
158  getHistogramParameters(me_slice, average, rms, mean, sigma);
159  me_average->setBinContent(ix, average);
160  me_rms->setBinContent(ix, rms);
161  me_mean->setBinContent(ix, mean);
162  me_sigma->setBinContent(ix, sigma);
163  }
164  delete[] xbins;
165  }
166 }
const double xbins[]
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
void getHistogramParameters(MonitorElement *me_slice, double &avarage, double &rms, double &mean, double &sigma)
Definition: PFClient.cc:287

◆ doEfficiency()

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

Definition at line 88 of file PFClient.cc.

References createEfficiencyPlots(), effHistogramNames_, folderNames_, castor_dqm_sourceclient_file_cfg::path, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by dqmEndJob().

88  {
89  for (std::vector<std::string>::const_iterator ifolder = folderNames_.begin(); ifolder != folderNames_.end();
90  ifolder++) {
91  std::string path = "ParticleFlow/" + (*ifolder);
92 
93  for (std::vector<std::string>::const_iterator ihist = effHistogramNames_.begin(); ihist != effHistogramNames_.end();
94  ihist++) {
95  std::string hname = (*ihist);
96  createEfficiencyPlots(ibooker, igetter, path, hname);
97  }
98  }
99 }
void createEfficiencyPlots(DQMStore::IBooker &, DQMStore::IGetter &, std::string &folder, std::string &name)
Definition: PFClient.cc:313
std::vector< std::string > folderNames_
Definition: PFClient.h:29
std::vector< std::string > effHistogramNames_
Definition: PFClient.h:31

◆ doProfiles()

void PFClient::doProfiles ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
private

Definition at line 71 of file PFClient.cc.

References createProfilePlots(), folderNames_, castor_dqm_sourceclient_file_cfg::path, profileHistogramNames_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by dqmEndJob().

71  {
72  for (std::vector<std::string>::const_iterator ifolder = folderNames_.begin(); ifolder != folderNames_.end();
73  ifolder++) {
74  std::string path = "ParticleFlow/" + (*ifolder);
75 
76  for (std::vector<std::string>::const_iterator ihist = profileHistogramNames_.begin();
77  ihist != profileHistogramNames_.end();
78  ihist++) {
79  std::string hname = (*ihist);
80  createProfilePlots(ibooker, igetter, path, hname);
81  }
82  }
83 }
std::vector< std::string > profileHistogramNames_
Definition: PFClient.h:33
void createProfilePlots(DQMStore::IBooker &, DQMStore::IGetter &, std::string &folder, std::string &name)
Definition: PFClient.cc:226
std::vector< std::string > folderNames_
Definition: PFClient.h:29

◆ doProjection()

void PFClient::doProjection ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
private

Definition at line 54 of file PFClient.cc.

References createProjectionPlots(), folderNames_, castor_dqm_sourceclient_file_cfg::path, projectionHistogramNames_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by dqmEndJob().

54  {
55  for (std::vector<std::string>::const_iterator ifolder = folderNames_.begin(); ifolder != folderNames_.end();
56  ifolder++) {
57  std::string path = "ParticleFlow/" + (*ifolder);
58 
59  for (std::vector<std::string>::const_iterator ihist = projectionHistogramNames_.begin();
60  ihist != projectionHistogramNames_.end();
61  ihist++) {
62  std::string hname = (*ihist);
63  createProjectionPlots(ibooker, igetter, path, hname);
64  }
65  }
66 }
std::vector< std::string > projectionHistogramNames_
Definition: PFClient.h:32
std::vector< std::string > folderNames_
Definition: PFClient.h:29
void createProjectionPlots(DQMStore::IBooker &, DQMStore::IGetter &, std::string &folder, std::string &name)
Definition: PFClient.cc:171

◆ doSummaries()

void PFClient::doSummaries ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
private

Definition at line 38 of file PFClient.cc.

References createResolutionPlots(), folderNames_, histogramNames_, castor_dqm_sourceclient_file_cfg::path, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by dqmEndJob().

38  {
39  for (std::vector<std::string>::const_iterator ifolder = folderNames_.begin(); ifolder != folderNames_.end();
40  ifolder++) {
41  std::string path = "ParticleFlow/" + (*ifolder);
42 
43  for (std::vector<std::string>::const_iterator ihist = histogramNames_.begin(); ihist != histogramNames_.end();
44  ihist++) {
45  std::string hname = (*ihist);
46  createResolutionPlots(ibooker, igetter, path, hname);
47  }
48  }
49 }
void createResolutionPlots(DQMStore::IBooker &, DQMStore::IGetter &, std::string &folder, std::string &name)
Definition: PFClient.cc:104
std::vector< std::string > histogramNames_
Definition: PFClient.h:30
std::vector< std::string > folderNames_
Definition: PFClient.h:29

◆ dqmEndJob()

void PFClient::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprivatevirtual

Implements DQMEDHarvester.

Definition at line 26 of file PFClient.cc.

References doEfficiency(), doProfiles(), doProjection(), doSummaries(), efficiencyFlag_, and profileFlag_.

26  {
27  doSummaries(ibooker, igetter);
28  doProjection(ibooker, igetter);
29  if (efficiencyFlag_)
30  doEfficiency(ibooker, igetter);
31  if (profileFlag_)
32  doProfiles(ibooker, igetter);
33 }
void doProjection(DQMStore::IBooker &, DQMStore::IGetter &)
Definition: PFClient.cc:54
void doSummaries(DQMStore::IBooker &, DQMStore::IGetter &)
Definition: PFClient.cc:38
void doEfficiency(DQMStore::IBooker &, DQMStore::IGetter &)
Definition: PFClient.cc:88
bool profileFlag_
Definition: PFClient.h:35
void doProfiles(DQMStore::IBooker &, DQMStore::IGetter &)
Definition: PFClient.cc:71
bool efficiencyFlag_
Definition: PFClient.h:34

◆ getHistogramParameters()

void PFClient::getHistogramParameters ( MonitorElement me_slice,
double &  avarage,
double &  rms,
double &  mean,
double &  sigma 
)
private

Definition at line 287 of file PFClient.cc.

References dqm::impl::MonitorElement::getMean(), dqm::impl::MonitorElement::getRMS(), dqm::legacy::MonitorElement::getTH1F(), dqm::impl::MonitorElement::kind(), SiStripPI::mean, SiStripPI::rms, and MonitorElementData::TH1F.

Referenced by createResolutionPlots().

288  {
289  average = 0.0;
290  rms = 0.0;
291  mean = 0.0;
292  sigma = 0.0;
293 
294  if (!me_slice)
295  return;
296  if (me_slice->kind() == MonitorElement::Kind::TH1F) {
297  average = me_slice->getMean();
298  rms = me_slice->getRMS();
299  TH1F *th_slice = me_slice->getTH1F();
300  if (th_slice && th_slice->GetEntries() > 0) {
301  // need our own copy for thread safety
302  TF1 gaus("mygaus", "gaus");
303  th_slice->Fit(&gaus, "Q0 SERIAL");
304  sigma = gaus.GetParameter(2);
305  mean = gaus.GetParameter(1);
306  }
307  }
308 }
Kind kind() const
Get the type of the monitor element.
virtual double getRMS(int axis=1) const
get RMS of histogram along x, y or z axis (axis=1, 2, 3 respectively)
virtual TH1F * getTH1F() const
virtual double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)

Member Data Documentation

◆ effHistogramNames_

std::vector<std::string> PFClient::effHistogramNames_
private

Definition at line 31 of file PFClient.h.

Referenced by doEfficiency(), and PFClient().

◆ efficiencyFlag_

bool PFClient::efficiencyFlag_
private

Definition at line 34 of file PFClient.h.

Referenced by dqmEndJob(), and PFClient().

◆ folderNames_

std::vector<std::string> PFClient::folderNames_
private

Definition at line 29 of file PFClient.h.

Referenced by doEfficiency(), doProfiles(), doProjection(), doSummaries(), and PFClient().

◆ histogramNames_

std::vector<std::string> PFClient::histogramNames_
private

Definition at line 30 of file PFClient.h.

Referenced by doSummaries(), and PFClient().

◆ profileFlag_

bool PFClient::profileFlag_
private

Definition at line 35 of file PFClient.h.

Referenced by dqmEndJob(), and PFClient().

◆ profileHistogramNames_

std::vector<std::string> PFClient::profileHistogramNames_
private

Definition at line 33 of file PFClient.h.

Referenced by doProfiles(), and PFClient().

◆ projectionHistogramNames_

std::vector<std::string> PFClient::projectionHistogramNames_
private

Definition at line 32 of file PFClient.h.

Referenced by doProjection(), and PFClient().