CMS 3D CMS Logo

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

#include <HLTTauPostProcessor.h>

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

Public Member Functions

void dqmEndJob (DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter) override
 
 HLTTauPostProcessor (const edm::ParameterSet &)
 
 ~HLTTauPostProcessor () override
 
- Public Member Functions inherited from DQMEDHarvester
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester (void)
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
void endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void produce (edm::Event &, edm::EventSetup const &) final
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources, edm::EndLuminosityBlockProducer >
 EDProducer ()=default
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () 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)
 
virtual ~ProducerBase () noexcept(false)
 
- 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
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void plotFilterEfficiencies (DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, const std::string &folder) const
 

Private Attributes

const std::string dqmBaseFolder_
 

Additional Inherited Members

- 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::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 

Detailed Description

Definition at line 13 of file HLTTauPostProcessor.h.

Constructor & Destructor Documentation

HLTTauPostProcessor::HLTTauPostProcessor ( const edm::ParameterSet ps)

Definition at line 26 of file HLTTauPostProcessor.cc.

References ~HLTTauPostProcessor().

26  :
28 {}
T getUntrackedParameter(std::string const &, T const &) const
const std::string dqmBaseFolder_
HLTTauPostProcessor::~HLTTauPostProcessor ( )
overridedefault

Referenced by HLTTauPostProcessor().

Member Function Documentation

void HLTTauPostProcessor::dqmEndJob ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter 
)
overridevirtual

Implements DQMEDHarvester.

Definition at line 32 of file HLTTauPostProcessor.cc.

References DQMStore::IGetter::dirExists(), dqmBaseFolder_, DQMStore::IGetter::getSubdirs(), LogDebug, plotFilterEfficiencies(), DQMStore::IGetter::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

33 {
34  if(!iGetter.dirExists(dqmBaseFolder_)) {
35  LogDebug("HLTTauDQMOffline") << "Folder " << dqmBaseFolder_ << " does not exist";
36  return;
37  }
39  for(const std::string& subfolder: iGetter.getSubdirs()) {
40  std::size_t pos = subfolder.rfind('/');
41  if(pos == std::string::npos)
42  continue;
43  ++pos; // position of first letter after /
44  if(subfolder.compare(pos, 4, "HLT_") == 0) { // start with HLT_
45  LogDebug("HLTTauDQMOffline") << "Processing path " << subfolder.substr(pos);
46  plotFilterEfficiencies(iBooker, iGetter, subfolder);
47  }
48  }
49 }
#define LogDebug(id)
bool dirExists(const std::string &path)
Definition: DQMStore.cc:335
void plotFilterEfficiencies(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, const std::string &folder) const
std::vector< std::string > getSubdirs(void)
Definition: DQMStore.cc:323
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:347
const std::string dqmBaseFolder_
void HLTTauPostProcessor::plotFilterEfficiencies ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter,
const std::string &  folder 
) const
private

Definition at line 51 of file HLTTauPostProcessor.cc.

References stringResolutionProvider_cfi::bin, DQMStore::IBooker::bookProfile(), PostProcessor_cff::efficiency, DQMStore::IGetter::get(), MonitorElement::getBinContent(), MonitorElement::getNbinsX(), MonitorElement::getTH1F(), MonitorElement::getTProfile(), mps_fire::i, LogDebug, MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), and mathSSE::sqrt().

Referenced by dqmEndJob().

51  {
52  // Get the source
53  const MonitorElement *eventsPerFilter = iGetter.get(folder+"/EventsPerFilter");
54  if(!eventsPerFilter) {
55  LogDebug("HLTTauDQMOffline") << "ME " << folder << "/EventsPerFilter not found";
56  return;
57  }
58 
59  // Book efficiency TProfile
60  iBooker.setCurrentFolder(folder);
61  MonitorElement *efficiency = iBooker.bookProfile("EfficiencyRefPrevious", "Efficiency to previous filter", eventsPerFilter->getNbinsX()-1,0,eventsPerFilter->getNbinsX()-1, 100,0,1);
62  efficiency->setAxisTitle("Efficiency", 2);
63  const TAxis *xaxis = eventsPerFilter->getTH1F()->GetXaxis();
64  for(int bin=1; bin < eventsPerFilter->getNbinsX(); ++bin) {
65  efficiency->setBinLabel(bin, xaxis->GetBinLabel(bin+1));
66  }
67 
68  // Fill efficiency TProfile
69  TProfile *prev = efficiency->getTProfile();
70  for(int i=2; i <= eventsPerFilter->getNbinsX(); ++i) {
71  if(eventsPerFilter->getBinContent(i-1) < eventsPerFilter->getBinContent(i)) {
72  LogDebug("HLTTauDQMOffline") << "HLTTauPostProcessor: Encountered denominator < numerator with efficiency plot EfficiencyRefPrevious in folder " << folder << ", bin " << i << " numerator " << eventsPerFilter->getBinContent(i) << " denominator " << eventsPerFilter->getBinContent(i-1);
73  continue;
74  }
75  const std::tuple<float, float> effErr = calcEfficiency(eventsPerFilter->getBinContent(i), eventsPerFilter->getBinContent(i-1));
76  const float efficiency = std::get<0>(effErr);
77  const float err = std::get<1>(effErr);
78 
79  prev->SetBinContent(i-1, efficiency);
80  prev->SetBinEntries(i-1, 1);
81  prev->SetBinError(i-1, std::sqrt(efficiency*efficiency + err*err));
82  }
83 }
#define LogDebug(id)
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:305
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
T sqrt(T t)
Definition: SSEVec.h:18
bin
set the eta bin as selection string.
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
TH1F * getTH1F(void) const
double getBinContent(int binx) const
get content of bin (1-D)
TProfile * getTProfile(void) const
int getNbinsX(void) const
get # of bins in X-axis
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

Member Data Documentation

const std::string HLTTauPostProcessor::dqmBaseFolder_
private

Definition at line 23 of file HLTTauPostProcessor.h.

Referenced by dqmEndJob().