CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Protected Member Functions | Private Attributes
HLTTauDQMOfflineSource Class Reference

#include <HLTTauDQMOfflineSource.h>

Inheritance diagram for HLTTauDQMOfflineSource:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Classes

struct  RefObject
 

Public Member Functions

 HLTTauDQMOfflineSource (const edm::ParameterSet &)
 
 ~HLTTauDQMOfflineSource ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void bookHistograms (DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &)=0
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::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 & 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)
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 
void bookHistograms (DQMStore::IBooker &iBooker, const edm::Run &r, const edm::EventSetup &c) override
 
void dqmBeginRun (const edm::Run &r, const edm::EventSetup &c) override
 
- 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)
 

Private Attributes

int counterEvt_
 
bool doRefAnalysis_
 
const std::string dqmBaseFolder_
 
const double highPtMax_
 
HLTConfigProvider HLTCP_
 
const double hltMatchDr_
 
std::string hltProcessName_
 
const double l1MatchDr_
 
std::unique_ptr< HLTTauDQML1Plotterl1Plotter_
 
const int nEtaBins_
 
const int nPhiBins_
 
const int nPtBins_
 
std::vector< HLTTauDQMPathPlotterpathPlotters_
 
const std::regex pathRegex_
 
std::unique_ptr< HLTTauDQMPathSummaryPlotterpathSummaryPlotter_
 
const int prescaleEvt_
 
const double ptMax_
 
std::vector< RefObjectrefObjects_
 
edm::InputTag triggerEventSrc_
 
edm::EDGetTokenT< trigger::TriggerEventtriggerEventToken_
 
edm::InputTag triggerResultsSrc_
 
edm::EDGetTokenT< edm::TriggerResultstriggerResultsToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 26 of file HLTTauDQMOfflineSource.h.

Constructor & Destructor Documentation

HLTTauDQMOfflineSource::HLTTauDQMOfflineSource ( const edm::ParameterSet ps)

Definition at line 15 of file HLTTauDQMOfflineSource.cc.

References edm::EDConsumerBase::consumesCollector(), doRefAnalysis_, dqmBaseFolder_, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), highPtMax_, hltMatchDr_, l1MatchDr_, l1Plotter_, nPhiBins_, pathSummaryPlotter_, muonDTDigis_cfi::pset, ptMax_, refObjects_, and HistogramManager_cfi::VPSet().

15  :
16  hltProcessName_(ps.getUntrackedParameter<std::string>("HLTProcessName","HLT")),
17  triggerResultsSrc_(ps.getUntrackedParameter<edm::InputTag>("TriggerResultsSrc")),
18  triggerResultsToken_(consumes<edm::TriggerResults>(triggerResultsSrc_)),
20  triggerEventToken_(consumes<trigger::TriggerEvent>(triggerEventSrc_)),
22  nPtBins_(ps.getUntrackedParameter<int>("PtHistoBins", 20)),
23  nEtaBins_(ps.getUntrackedParameter<int>("EtaHistoBins",12)),
24  nPhiBins_(ps.getUntrackedParameter<int>("PhiHistoBins",18)),
25  ptMax_(ps.getUntrackedParameter<double>("PtHistoMax",200)),
26  highPtMax_(ps.getUntrackedParameter<double>("HighPtHistoMax",1000)),
27  l1MatchDr_(ps.getUntrackedParameter<double>("L1MatchDeltaR", 0.5)),
28  hltMatchDr_(ps.getUntrackedParameter<double>("HLTMatchDeltaR", 0.5)),
29  dqmBaseFolder_(ps.getUntrackedParameter<std::string>("DQMBaseFolder")),
30  counterEvt_(0),
31  prescaleEvt_(ps.getUntrackedParameter<int>("prescaleEvt", -1))
32 {
34  doRefAnalysis_ = matching.getUntrackedParameter<bool>("doMatching");
35 
36  if(ps.exists("L1Plotter")) {
38  nPhiBins_, ptMax_, highPtMax_, doRefAnalysis_, l1MatchDr_, dqmBaseFolder_));
39  }
40  if(ps.exists("PathSummaryPlotter")) {
42  doRefAnalysis_, dqmBaseFolder_, hltMatchDr_));
43  }
44 
45  if(doRefAnalysis_) {
46  using VPSet = std::vector<edm::ParameterSet>;
47  VPSet matchObjects = matching.getUntrackedParameter<VPSet>("matchFilters");
48  for(const edm::ParameterSet& pset: matchObjects) {
49  refObjects_.push_back(RefObject{pset.getUntrackedParameter<int>("matchObjectID"),
50  consumes<LVColl>(pset.getUntrackedParameter<edm::InputTag>("FilterName"))});
51  }
52  }
53 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
const std::string dqmBaseFolder_
edm::EDGetTokenT< trigger::TriggerEvent > triggerEventToken_
std::vector< RefObject > refObjects_
bool exists(std::string const &parameterName) const
checks if a parameter exists
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::unique_ptr< HLTTauDQMPathSummaryPlotter > pathSummaryPlotter_
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
std::unique_ptr< HLTTauDQML1Plotter > l1Plotter_
HLTTauDQMOfflineSource::~HLTTauDQMOfflineSource ( )

Definition at line 55 of file HLTTauDQMOfflineSource.cc.

55  {
56 }

Member Function Documentation

void HLTTauDQMOfflineSource::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overrideprotected

Definition at line 112 of file HLTTauDQMOfflineSource.cc.

References counterEvt_, doRefAnalysis_, HLTTauDQMOfflineObjects::electrons, edm::Event::getByToken(), edm::HandleBase::isValid(), l1Plotter_, HLTTauDQMOfflineObjects::met, HLTTauDQMOfflineObjects::muons, pathPlotters_, pathSummaryPlotter_, prescaleEvt_, refObjects_, HLTTauDQMOfflineObjects::taus, triggerEventSrc_, triggerEventToken_, triggerResultsSrc_, and triggerResultsToken_.

112  {
113  //Apply the prescaler
114  if (counterEvt_ > prescaleEvt_) {
115  //Do Analysis here
116  counterEvt_ = 0;
117 
118  edm::Handle<edm::TriggerResults> triggerResultsHandle;
119  iEvent.getByToken(triggerResultsToken_, triggerResultsHandle);
120  if(!triggerResultsHandle.isValid()) {
121  edm::LogWarning("HLTTauDQMOffline") << "Unable to read edm::TriggerResults with label " << triggerResultsSrc_;
122  return;
123  }
124 
125  edm::Handle<trigger::TriggerEvent> triggerEventHandle;
126  iEvent.getByToken(triggerEventToken_, triggerEventHandle);
127  if(!triggerEventHandle.isValid()) {
128  edm::LogWarning("HLTTauDQMOffline") << "Unable to read trigger::TriggerEvent with label " << triggerEventSrc_;
129  return;
130  }
131 
132  //Create match collections
134  if (doRefAnalysis_) {
135  for(RefObject& refObj: refObjects_) {
136  edm::Handle<LVColl> collHandle;
137  iEvent.getByToken(refObj.token, collHandle);
138  if(!collHandle.isValid())
139  continue;
140 
141  if(refObj.objID == 11) {
142  refC.electrons.insert(refC.electrons.end(), collHandle->begin(), collHandle->end());
143  }
144  else if(refObj.objID == 13) {
145  refC.muons.insert(refC.muons.end(), collHandle->begin(), collHandle->end());
146  }
147  else if(refObj.objID == 15) {
148  refC.taus.insert(refC.taus.end(), collHandle->begin(), collHandle->end());
149  }
150  else if(refObj.objID == 0) {
151  refC.met.insert(refC.met.end(), collHandle->begin(), collHandle->end());
152  }
153  }
154  }
155 
156  //Path Plotters
157  for(auto& pathPlotter: pathPlotters_) {
158  if(pathPlotter.isValid())
159  pathPlotter.analyze(*triggerResultsHandle, *triggerEventHandle, refC);
160  }
161 
162  if(pathSummaryPlotter_ && pathSummaryPlotter_->isValid()) {
163  pathSummaryPlotter_->analyze(*triggerResultsHandle, *triggerEventHandle, refC);
164  }
165 
166  //L1 Plotter
167  if(l1Plotter_ && l1Plotter_->isValid()) {
168  l1Plotter_->analyze(iEvent, iSetup, refC);
169  }
170  } else {
171  counterEvt_++;
172  }
173 }
std::vector< LV > electrons
std::vector< LV > taus
edm::EDGetTokenT< trigger::TriggerEvent > triggerEventToken_
std::vector< RefObject > refObjects_
int iEvent
Definition: GenABIO.cc:230
std::vector< HLTTauDQMPathPlotter > pathPlotters_
bool isValid() const
Definition: HandleBase.h:74
std::unique_ptr< HLTTauDQMPathSummaryPlotter > pathSummaryPlotter_
std::vector< LV > met
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
std::vector< LV > muons
std::unique_ptr< HLTTauDQML1Plotter > l1Plotter_
void HLTTauDQMOfflineSource::bookHistograms ( DQMStore::IBooker iBooker,
const edm::Run r,
const edm::EventSetup c 
)
overrideprotected

Definition at line 99 of file HLTTauDQMOfflineSource.cc.

References l1Plotter_, pathPlotters_, and pathSummaryPlotter_.

99  {
100  if(l1Plotter_) {
101  l1Plotter_->bookHistograms(iBooker);
102  }
103  for(auto& pathPlotter: pathPlotters_) {
104  pathPlotter.bookHistograms(iBooker);
105  }
106  if(pathSummaryPlotter_) {
107  pathSummaryPlotter_->bookHistograms(iBooker);
108  }
109 }
std::vector< HLTTauDQMPathPlotter > pathPlotters_
std::unique_ptr< HLTTauDQMPathSummaryPlotter > pathSummaryPlotter_
std::unique_ptr< HLTTauDQML1Plotter > l1Plotter_
void HLTTauDQMOfflineSource::dqmBeginRun ( const edm::Run r,
const edm::EventSetup c 
)
overrideprotected

Definition at line 59 of file HLTTauDQMOfflineSource.cc.

References doRefAnalysis_, dqmBaseFolder_, highPtMax_, HLTCP_, hltMatchDr_, hltProcessName_, HLTConfigProvider::init(), l1MatchDr_, LogDebug, nEtaBins_, nPhiBins_, nPtBins_, pathPlotters_, pathRegex_, pathSummaryPlotter_, ptMax_, AlCaHLTBitMon_QueryRunRegistry::string, and HLTConfigProvider::triggerNames().

59  {
60  //Evaluate configuration for every new trigger menu
61  bool hltMenuChanged = false;
62  if(HLTCP_.init(iRun, iSetup, hltProcessName_, hltMenuChanged)) {
63  LogDebug("HLTTauDQMOffline") << "dqmBeginRun(), hltMenuChanged " << hltMenuChanged;
64  if(hltMenuChanged) {
65  // Find all paths to monitor
66  std::vector<std::string> foundPaths;
67  std::smatch what;
68  LogDebug("HLTTauDQMOffline") << "Looking for paths with regex " << pathRegex_;
69  for(const std::string& pathName: HLTCP_.triggerNames()) {
70  if(std::regex_search(pathName, what, pathRegex_)) {
71  LogDebug("HLTTauDQMOffline") << "Found path " << pathName;
72  foundPaths.emplace_back(pathName);
73  }
74  }
75  std::sort(foundPaths.begin(), foundPaths.end());
76 
77  // Construct path plotters
78  std::vector<const HLTTauDQMPath *> pathObjects;
79  pathPlotters_.reserve(foundPaths.size());
80  pathObjects.reserve(foundPaths.size());
81  for(const std::string& pathName: foundPaths) {
83  if(pathPlotters_.back().isValid()) {
84  pathObjects.push_back(pathPlotters_.back().getPathObject());
85  }
86  }
87 
88  // Update paths to the summary plotter
90  pathSummaryPlotter_->setPathObjects(pathObjects);
91  }
92  }
93  } else {
94  edm::LogWarning("HLTTauDQMOffline") << "HLT config extraction failure with process name '" << hltProcessName_ << "'";
95  }
96 }
#define LogDebug(id)
const std::string dqmBaseFolder_
const std::vector< std::string > & triggerNames() const
names of trigger paths
std::vector< HLTTauDQMPathPlotter > pathPlotters_
std::unique_ptr< HLTTauDQMPathSummaryPlotter > pathSummaryPlotter_
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor

Member Data Documentation

int HLTTauDQMOfflineSource::counterEvt_
private

Definition at line 60 of file HLTTauDQMOfflineSource.h.

Referenced by analyze().

bool HLTTauDQMOfflineSource::doRefAnalysis_
private

Definition at line 52 of file HLTTauDQMOfflineSource.h.

Referenced by analyze(), dqmBeginRun(), and HLTTauDQMOfflineSource().

const std::string HLTTauDQMOfflineSource::dqmBaseFolder_
private

Definition at line 47 of file HLTTauDQMOfflineSource.h.

Referenced by dqmBeginRun(), and HLTTauDQMOfflineSource().

const double HLTTauDQMOfflineSource::highPtMax_
private

Definition at line 46 of file HLTTauDQMOfflineSource.h.

Referenced by dqmBeginRun(), and HLTTauDQMOfflineSource().

HLTConfigProvider HLTTauDQMOfflineSource::HLTCP_
private

Definition at line 49 of file HLTTauDQMOfflineSource.h.

Referenced by dqmBeginRun().

const double HLTTauDQMOfflineSource::hltMatchDr_
private

Definition at line 46 of file HLTTauDQMOfflineSource.h.

Referenced by dqmBeginRun(), and HLTTauDQMOfflineSource().

std::string HLTTauDQMOfflineSource::hltProcessName_
private

Definition at line 37 of file HLTTauDQMOfflineSource.h.

Referenced by dqmBeginRun().

const double HLTTauDQMOfflineSource::l1MatchDr_
private

Definition at line 46 of file HLTTauDQMOfflineSource.h.

Referenced by dqmBeginRun(), and HLTTauDQMOfflineSource().

std::unique_ptr<HLTTauDQML1Plotter> HLTTauDQMOfflineSource::l1Plotter_
private

Definition at line 64 of file HLTTauDQMOfflineSource.h.

Referenced by analyze(), bookHistograms(), and HLTTauDQMOfflineSource().

const int HLTTauDQMOfflineSource::nEtaBins_
private

Definition at line 45 of file HLTTauDQMOfflineSource.h.

Referenced by dqmBeginRun().

const int HLTTauDQMOfflineSource::nPhiBins_
private

Definition at line 45 of file HLTTauDQMOfflineSource.h.

Referenced by dqmBeginRun(), and HLTTauDQMOfflineSource().

const int HLTTauDQMOfflineSource::nPtBins_
private

Definition at line 45 of file HLTTauDQMOfflineSource.h.

Referenced by dqmBeginRun().

std::vector<HLTTauDQMPathPlotter> HLTTauDQMOfflineSource::pathPlotters_
private

Definition at line 65 of file HLTTauDQMOfflineSource.h.

Referenced by analyze(), bookHistograms(), and dqmBeginRun().

const std::regex HLTTauDQMOfflineSource::pathRegex_
private

Definition at line 44 of file HLTTauDQMOfflineSource.h.

Referenced by dqmBeginRun().

std::unique_ptr<HLTTauDQMPathSummaryPlotter> HLTTauDQMOfflineSource::pathSummaryPlotter_
private
const int HLTTauDQMOfflineSource::prescaleEvt_
private

Definition at line 61 of file HLTTauDQMOfflineSource.h.

Referenced by analyze().

const double HLTTauDQMOfflineSource::ptMax_
private

Definition at line 46 of file HLTTauDQMOfflineSource.h.

Referenced by dqmBeginRun(), and HLTTauDQMOfflineSource().

std::vector<RefObject> HLTTauDQMOfflineSource::refObjects_
private

Definition at line 57 of file HLTTauDQMOfflineSource.h.

Referenced by analyze(), and HLTTauDQMOfflineSource().

edm::InputTag HLTTauDQMOfflineSource::triggerEventSrc_
private

Definition at line 40 of file HLTTauDQMOfflineSource.h.

Referenced by analyze().

edm::EDGetTokenT<trigger::TriggerEvent> HLTTauDQMOfflineSource::triggerEventToken_
private

Definition at line 41 of file HLTTauDQMOfflineSource.h.

Referenced by analyze().

edm::InputTag HLTTauDQMOfflineSource::triggerResultsSrc_
private

Definition at line 38 of file HLTTauDQMOfflineSource.h.

Referenced by analyze().

edm::EDGetTokenT<edm::TriggerResults> HLTTauDQMOfflineSource::triggerResultsToken_
private

Definition at line 39 of file HLTTauDQMOfflineSource.h.

Referenced by analyze().