CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 
 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
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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
< HLTTauDQML1Plotter
l1Plotter_
 
const int nEtaBins_
 
const int nPhiBins_
 
const int nPtBins_
 
std::vector< HLTTauDQMPathPlotterpathPlotters_
 
const boost::regex pathRegex_
 
std::unique_ptr
< HLTTauDQMPathSummaryPlotter
pathSummaryPlotter_
 
const int prescaleEvt_
 
const double ptMax_
 
std::vector< RefObjectrefObjects_
 
edm::InputTag triggerEventSrc_
 
edm::EDGetTokenT
< trigger::TriggerEvent
triggerEventToken_
 
edm::InputTag triggerResultsSrc_
 
edm::EDGetTokenT
< edm::TriggerResults
triggerResultsToken_
 

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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (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 16 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_, ptMax_, and refObjects_.

16  :
17  hltProcessName_(ps.getUntrackedParameter<std::string>("HLTProcessName","HLT")),
18  triggerResultsSrc_(ps.getUntrackedParameter<edm::InputTag>("TriggerResultsSrc")),
19  triggerResultsToken_(consumes<edm::TriggerResults>(triggerResultsSrc_)),
21  triggerEventToken_(consumes<trigger::TriggerEvent>(triggerEventSrc_)),
23  nPtBins_(ps.getUntrackedParameter<int>("PtHistoBins", 20)),
24  nEtaBins_(ps.getUntrackedParameter<int>("EtaHistoBins",12)),
25  nPhiBins_(ps.getUntrackedParameter<int>("PhiHistoBins",18)),
26  ptMax_(ps.getUntrackedParameter<double>("PtHistoMax",200)),
27  highPtMax_(ps.getUntrackedParameter<double>("HighPtHistoMax",1000)),
28  l1MatchDr_(ps.getUntrackedParameter<double>("L1MatchDeltaR", 0.5)),
29  hltMatchDr_(ps.getUntrackedParameter<double>("HLTMatchDeltaR", 0.2)),
30  dqmBaseFolder_(ps.getUntrackedParameter<std::string>("DQMBaseFolder")),
31  counterEvt_(0),
32  prescaleEvt_(ps.getUntrackedParameter<int>("prescaleEvt", -1))
33 {
34  edm::ParameterSet matching = ps.getParameter<edm::ParameterSet>("Matching");
35  doRefAnalysis_ = matching.getUntrackedParameter<bool>("doMatching");
36 
37  if(ps.exists("L1Plotter")) {
39  nPhiBins_, ptMax_, highPtMax_, doRefAnalysis_, l1MatchDr_, dqmBaseFolder_));
40  }
41  if(ps.exists("PathSummaryPlotter")) {
43  doRefAnalysis_, dqmBaseFolder_, hltMatchDr_));
44  }
45 
46  if(doRefAnalysis_) {
47  using VPSet = std::vector<edm::ParameterSet>;
48  VPSet matchObjects = matching.getUntrackedParameter<VPSet>("matchFilters");
49  for(const edm::ParameterSet& pset: matchObjects) {
50  refObjects_.push_back(RefObject{pset.getUntrackedParameter<int>("matchObjectID"),
51  consumes<LVColl>(pset.getUntrackedParameter<edm::InputTag>("FilterName"))});
52  }
53  }
54 }
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_
const boost::regex pathRegex_
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
std::unique_ptr< HLTTauDQML1Plotter > l1Plotter_
HLTTauDQMOfflineSource::~HLTTauDQMOfflineSource ( )

Definition at line 56 of file HLTTauDQMOfflineSource.cc.

56  {
57 }

Member Function Documentation

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

Implements edm::stream::EDAnalyzerBase.

Definition at line 113 of file HLTTauDQMOfflineSource.cc.

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

113  {
114  //Apply the prescaler
115  if (counterEvt_ > prescaleEvt_) {
116  //Do Analysis here
117  counterEvt_ = 0;
118 
119  edm::Handle<edm::TriggerResults> triggerResultsHandle;
120  iEvent.getByToken(triggerResultsToken_, triggerResultsHandle);
121  if(!triggerResultsHandle.isValid()) {
122  edm::LogWarning("HLTTauDQMOffline") << "Unable to read edm::TriggerResults with label " << triggerResultsSrc_;
123  return;
124  }
125 
126  edm::Handle<trigger::TriggerEvent> triggerEventHandle;
127  iEvent.getByToken(triggerEventToken_, triggerEventHandle);
128  if(!triggerEventHandle.isValid()) {
129  edm::LogWarning("HLTTauDQMOffline") << "Unable to read trigger::TriggerEvent with label " << triggerEventSrc_;
130  return;
131  }
132 
133  //Create match collections
135  if (doRefAnalysis_) {
136  for(RefObject& refObj: refObjects_) {
137  edm::Handle<LVColl> collHandle;
138  iEvent.getByToken(refObj.token, collHandle);
139  if(!collHandle.isValid())
140  continue;
141 
142  if(refObj.objID == 11) {
143  refC.electrons.insert(refC.electrons.end(), collHandle->begin(), collHandle->end());
144  }
145  else if(refObj.objID == 13) {
146  refC.muons.insert(refC.muons.end(), collHandle->begin(), collHandle->end());
147  }
148  else if(refObj.objID == 15) {
149  refC.taus.insert(refC.taus.end(), collHandle->begin(), collHandle->end());
150  }
151  }
152  }
153 
154  //Path Plotters
155  for(auto& pathPlotter: pathPlotters_) {
156  if(pathPlotter.isValid())
157  pathPlotter.analyze(*triggerResultsHandle, *triggerEventHandle, refC);
158  }
159 
160  if(pathSummaryPlotter_ && pathSummaryPlotter_->isValid()) {
161  pathSummaryPlotter_->analyze(*triggerResultsHandle, *triggerEventHandle, refC);
162  }
163 
164  //L1 Plotter
165  if(l1Plotter_ && l1Plotter_->isValid()) {
166  l1Plotter_->analyze(iEvent, iSetup, refC);
167  }
168  } else {
169  counterEvt_++;
170  }
171 }
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:76
std::unique_ptr< HLTTauDQMPathSummaryPlotter > pathSummaryPlotter_
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 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 100 of file HLTTauDQMOfflineSource.cc.

References l1Plotter_, pathPlotters_, and pathSummaryPlotter_.

100  {
101  if(l1Plotter_) {
102  l1Plotter_->bookHistograms(iBooker);
103  }
104  for(auto& pathPlotter: pathPlotters_) {
105  pathPlotter.bookHistograms(iBooker);
106  }
107  if(pathSummaryPlotter_) {
108  pathSummaryPlotter_->bookHistograms(iBooker);
109  }
110 }
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 
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 60 of file HLTTauDQMOfflineSource.cc.

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

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

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 boost::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().