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::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void dqmEndJob (DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter) override
 
 HLTTauPostProcessor (const edm::ParameterSet &)
 
 ~HLTTauPostProcessor ()
 
- Public Member Functions inherited from DQMEDHarvester
virtual void analyze (edm::Event const &, edm::EventSetup const &) final
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDHarvester (void)
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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 & itemsToGetFromEvent () 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::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
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.

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

Definition at line 30 of file HLTTauPostProcessor.cc.

31 {}

Member Function Documentation

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

Implements DQMEDHarvester.

Definition at line 33 of file HLTTauPostProcessor.cc.

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

34 {
35  if(!iGetter.dirExists(dqmBaseFolder_)) {
36  LogDebug("HLTTauDQMOffline") << "Folder " << dqmBaseFolder_ << " does not exist";
37  return;
38  }
40  for(const std::string& subfolder: iGetter.getSubdirs()) {
41  std::size_t pos = subfolder.rfind("/");
42  if(pos == std::string::npos)
43  continue;
44  ++pos; // position of first letter after /
45  if(subfolder.compare(pos, 4, "HLT_") == 0) { // start with HLT_
46  LogDebug("HLTTauDQMOffline") << "Processing path " << subfolder.substr(pos);
47  plotFilterEfficiencies(iBooker, iGetter, subfolder);
48  }
49  }
50 }
#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 52 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().

52  {
53  // Get the source
54  const MonitorElement *eventsPerFilter = iGetter.get(folder+"/EventsPerFilter");
55  if(!eventsPerFilter) {
56  LogDebug("HLTTauDQMOffline") << "ME " << folder << "/EventsPerFilter not found";
57  return;
58  }
59 
60  // Book efficiency TProfile
61  iBooker.setCurrentFolder(folder);
62  MonitorElement *efficiency = iBooker.bookProfile("EfficiencyRefPrevious", "Efficiency to previous filter", eventsPerFilter->getNbinsX()-1,0,eventsPerFilter->getNbinsX()-1, 100,0,1);
63  efficiency->setAxisTitle("Efficiency", 2);
64  const TAxis *xaxis = eventsPerFilter->getTH1F()->GetXaxis();
65  for(int bin=1; bin < eventsPerFilter->getNbinsX(); ++bin) {
66  efficiency->setBinLabel(bin, xaxis->GetBinLabel(bin+1));
67  }
68 
69  // Fill efficiency TProfile
70  TProfile *prev = efficiency->getTProfile();
71  for(int i=2; i <= eventsPerFilter->getNbinsX(); ++i) {
72  if(eventsPerFilter->getBinContent(i-1) < eventsPerFilter->getBinContent(i)) {
73  LogDebug("HLTTauDQMOffline") << "HLTTauPostProcessor: Encountered denominator < numerator with efficiency plot EfficiencyRefPrevious in folder " << folder << ", bin " << i << " numerator " << eventsPerFilter->getBinContent(i) << " denominator " << eventsPerFilter->getBinContent(i-1);
74  continue;
75  }
76  const std::tuple<float, float> effErr = calcEfficiency(eventsPerFilter->getBinContent(i), eventsPerFilter->getBinContent(i-1));
77  const float efficiency = std::get<0>(effErr);
78  const float err = std::get<1>(effErr);
79 
80  prev->SetBinContent(i-1, efficiency);
81  prev->SetBinEntries(i-1, 1);
82  prev->SetBinError(i-1, std::sqrt(efficiency*efficiency + err*err));
83  }
84 }
#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().