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:
edm::EDAnalyzer edm::EDConsumerBase

Classes

struct  RefObject
 

Public Member Functions

 HLTTauDQMOfflineSource (const edm::ParameterSet &)
 
 ~HLTTauDQMOfflineSource ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- 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
 
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)
 
void beginJob ()
 
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 
- 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_
 
HLTConfigProvider HLTCP_
 
bool hltMenuChanged_
 
std::string hltProcessName_
 
std::vector< HLTTauDQML1Plotterl1Plotters_
 
std::vector< HLTTauDQMPathPlotterpathPlotters2_
 
std::vector
< HLTTauDQMPathSummaryPlotter
pathSummaryPlotters_
 
const int prescaleEvt_
 
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::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 23 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_, alignCSCRings::e, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), hltProcessName_, l1Plotters_, pathPlotters2_, pathSummaryPlotters_, jptDQMConfig_cff::ptMax, refObjects_, AlCaHLTBitMon_QueryRunRegistry::string, and cms::Exception::what().

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_)),
22  counterEvt_(0),
23  prescaleEvt_(ps.getUntrackedParameter<int>("prescaleEvt", -1))
24 {
25  int nPtBins = ps.getUntrackedParameter<int>("PtHistoBins", 20);
26  int nEtaBins = ps.getUntrackedParameter<int>("EtaHistoBins",12);
27  int nPhiBins = ps.getUntrackedParameter<int>("PhiHistoBins",18);
28  double ptMax = ps.getUntrackedParameter<double>("PtHistoMax",200);
29  double highPtMax = ps.getUntrackedParameter<double>("HighPtHistoMax",1000);
30  double l1MatchDr = ps.getUntrackedParameter<double>("L1MatchDeltaR", 0.5);
31  double hltMatchDr = ps.getUntrackedParameter<double>("HLTMatchDeltaR", 0.2);
32  std::string dqmBaseFolder = ps.getUntrackedParameter<std::string>("DQMBaseFolder");
33 
34  edm::ParameterSet matching = ps.getParameter<edm::ParameterSet>("Matching");
35  doRefAnalysis_ = matching.getUntrackedParameter<bool>("doMatching");
36 
37  using VPSet = std::vector<edm::ParameterSet>;
38  VPSet monitorSetup = ps.getParameter<VPSet>("MonitorSetup");
39 
40  /*
41  l1Plotters_.reserve(monitorSetup.size());
42  pathPlotters_.reserve(monitorSetup.size());
43  pathSummaryPlotters_.reserve(monitorSetup.size());
44  */
45  for(const edm::ParameterSet& pset: monitorSetup) {
46  std::string configtype;
47  try {
48  configtype = pset.getUntrackedParameter<std::string>("ConfigType");
49  } catch(cms::Exception& e) {
50  edm::LogWarning("HLTTauDQMOffline") << e.what() << std::endl;
51  continue;
52  }
53  if(configtype == "L1") {
54  try {
55  l1Plotters_.emplace_back(pset, consumesCollector(), nPhiBins, ptMax, highPtMax, doRefAnalysis_, l1MatchDr, dqmBaseFolder);
56  } catch(cms::Exception& e) {
57  edm::LogWarning("HLTTauDQMOffline") << e.what() << std::endl;
58  continue;
59  }
60  } else if (configtype == "Path") {
61  try {
62  pathPlotters2_.emplace_back(pset, doRefAnalysis_, dqmBaseFolder, hltProcessName_, nPtBins, nEtaBins, nPhiBins, ptMax, highPtMax, l1MatchDr, hltMatchDr);
63  } catch ( cms::Exception &e ) {
64  edm::LogWarning("HLTTauDQMOffline") << e.what() << std::endl;
65  continue;
66  }
67  } else if (configtype == "PathSummary") {
68  try {
69  pathSummaryPlotters_.emplace_back(pset, doRefAnalysis_, dqmBaseFolder, hltMatchDr);
70  } catch ( cms::Exception &e ) {
71  edm::LogWarning("HLTTauDQMOffline") << e.what() << std::endl;
72  continue;
73  }
74  }
75  }
76 
77  if(doRefAnalysis_) {
78  VPSet matchObjects = matching.getUntrackedParameter<VPSet>("matchFilters");
79  for(const edm::ParameterSet& pset: matchObjects) {
80  refObjects_.push_back(RefObject{pset.getUntrackedParameter<int>("matchObjectID"),
81  consumes<LVColl>(pset.getUntrackedParameter<edm::InputTag>("FilterName"))});
82  }
83  }
84 }
virtual char const * what() const
Definition: Exception.cc:141
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::vector< HLTTauDQMPathPlotter > pathPlotters2_
edm::EDGetTokenT< trigger::TriggerEvent > triggerEventToken_
std::vector< RefObject > refObjects_
std::vector< HLTTauDQMPathSummaryPlotter > pathSummaryPlotters_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::vector< HLTTauDQML1Plotter > l1Plotters_
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
HLTTauDQMOfflineSource::~HLTTauDQMOfflineSource ( )

Definition at line 86 of file HLTTauDQMOfflineSource.cc.

86  {
87 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 119 of file HLTTauDQMOfflineSource.cc.

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

119  {
120  //Apply the prescaler
121  if (counterEvt_ > prescaleEvt_) {
122  //Do Analysis here
123  counterEvt_ = 0;
124 
125  edm::Handle<edm::TriggerResults> triggerResultsHandle;
126  iEvent.getByToken(triggerResultsToken_, triggerResultsHandle);
127  if(!triggerResultsHandle.isValid()) {
128  edm::LogWarning("HLTTauDQMOffline") << "Unable to read edm::TriggerResults with label " << triggerResultsSrc_;
129  return;
130  }
131 
132  edm::Handle<trigger::TriggerEvent> triggerEventHandle;
133  iEvent.getByToken(triggerEventToken_, triggerEventHandle);
134  if(!triggerEventHandle.isValid()) {
135  edm::LogWarning("HLTTauDQMOffline") << "Unable to read trigger::TriggerEvent with label " << triggerEventSrc_;
136  return;
137  }
138 
139  //Create match collections
141  if (doRefAnalysis_) {
142  for(RefObject& refObj: refObjects_) {
143  edm::Handle<LVColl> collHandle;
144  iEvent.getByToken(refObj.token, collHandle);
145  if(!collHandle.isValid())
146  continue;
147 
148  if(refObj.objID == 11) {
149  refC.electrons.insert(refC.electrons.end(), collHandle->begin(), collHandle->end());
150  }
151  else if(refObj.objID == 13) {
152  refC.muons.insert(refC.muons.end(), collHandle->begin(), collHandle->end());
153  }
154  else if(refObj.objID == 15) {
155  refC.taus.insert(refC.taus.end(), collHandle->begin(), collHandle->end());
156  }
157  }
158  }
159 
160  //Path Plotters
161  for(auto& pathPlotter: pathPlotters2_) {
162  if(pathPlotter.isValid())
163  pathPlotter.analyze(*triggerResultsHandle, *triggerEventHandle, refC);
164  }
165 
166  for(auto& pathSummaryPlotter: pathSummaryPlotters_) {
167  if(pathSummaryPlotter.isValid())
168  pathSummaryPlotter.analyze(*triggerResultsHandle, *triggerEventHandle, refC);
169  }
170 
171  //L1 Plotters
172  for(auto& l1Plotter: l1Plotters_) {
173  if(l1Plotter.isValid())
174  l1Plotter.analyze(iEvent, iSetup, refC);
175  }
176  } else {
177  counterEvt_++;
178  }
179 }
std::vector< HLTTauDQMPathPlotter > pathPlotters2_
std::vector< LV > electrons
std::vector< LV > taus
edm::EDGetTokenT< trigger::TriggerEvent > triggerEventToken_
std::vector< RefObject > refObjects_
std::vector< HLTTauDQMPathSummaryPlotter > pathSummaryPlotters_
int iEvent
Definition: GenABIO.cc:243
bool isValid() const
Definition: HandleBase.h:76
std::vector< HLTTauDQML1Plotter > l1Plotters_
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
std::vector< LV > muons
void HLTTauDQMOfflineSource::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 90 of file HLTTauDQMOfflineSource.cc.

90  {
91 }
void HLTTauDQMOfflineSource::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 94 of file HLTTauDQMOfflineSource.cc.

References HLTCP_, hltProcessName_, HLTConfigProvider::init(), l1Plotters_, pathPlotters2_, and pathSummaryPlotters_.

94  {
95  //Evaluate configuration for every new trigger menu
96  bool hltMenuChanged = false;
97  if(HLTCP_.init(iRun, iSetup, hltProcessName_, hltMenuChanged)) {
98  if(hltMenuChanged) {
99  for(auto& l1Plotter: l1Plotters_) {
100  l1Plotter.beginRun();
101  }
102  std::vector<const HLTTauDQMPath *> pathObjects;
103  pathObjects.reserve(pathPlotters2_.size());
104  for(auto& pathPlotter: pathPlotters2_) {
105  pathPlotter.beginRun(HLTCP_);
106  if(pathPlotter.isValid())
107  pathObjects.push_back(pathPlotter.getPathObject());
108  }
109  for(auto& pathSummaryPlotter: pathSummaryPlotters_) {
110  pathSummaryPlotter.beginRun(pathObjects);
111  }
112  }
113  } else {
114  edm::LogWarning("HLTTauDQMOffline") << "HLT config extraction failure with process name '" << hltProcessName_ << "'";
115  }
116 }
std::vector< HLTTauDQMPathPlotter > pathPlotters2_
std::vector< HLTTauDQMPathSummaryPlotter > pathSummaryPlotters_
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
std::vector< HLTTauDQML1Plotter > l1Plotters_

Member Data Documentation

int HLTTauDQMOfflineSource::counterEvt_
private

Definition at line 52 of file HLTTauDQMOfflineSource.h.

Referenced by analyze().

bool HLTTauDQMOfflineSource::doRefAnalysis_
private

Definition at line 44 of file HLTTauDQMOfflineSource.h.

Referenced by analyze(), and HLTTauDQMOfflineSource().

HLTConfigProvider HLTTauDQMOfflineSource::HLTCP_
private

Definition at line 41 of file HLTTauDQMOfflineSource.h.

Referenced by beginRun().

bool HLTTauDQMOfflineSource::hltMenuChanged_
private

Definition at line 39 of file HLTTauDQMOfflineSource.h.

std::string HLTTauDQMOfflineSource::hltProcessName_
private

Definition at line 34 of file HLTTauDQMOfflineSource.h.

Referenced by beginRun(), and HLTTauDQMOfflineSource().

std::vector<HLTTauDQML1Plotter> HLTTauDQMOfflineSource::l1Plotters_
private

Definition at line 56 of file HLTTauDQMOfflineSource.h.

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

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

Definition at line 57 of file HLTTauDQMOfflineSource.h.

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

std::vector<HLTTauDQMPathSummaryPlotter> HLTTauDQMOfflineSource::pathSummaryPlotters_
private

Definition at line 58 of file HLTTauDQMOfflineSource.h.

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

const int HLTTauDQMOfflineSource::prescaleEvt_
private

Definition at line 53 of file HLTTauDQMOfflineSource.h.

Referenced by analyze().

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

Definition at line 49 of file HLTTauDQMOfflineSource.h.

Referenced by analyze(), and HLTTauDQMOfflineSource().

edm::InputTag HLTTauDQMOfflineSource::triggerEventSrc_
private

Definition at line 37 of file HLTTauDQMOfflineSource.h.

Referenced by analyze().

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

Definition at line 38 of file HLTTauDQMOfflineSource.h.

Referenced by analyze().

edm::InputTag HLTTauDQMOfflineSource::triggerResultsSrc_
private

Definition at line 35 of file HLTTauDQMOfflineSource.h.

Referenced by analyze().

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

Definition at line 36 of file HLTTauDQMOfflineSource.h.

Referenced by analyze().