CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes
FourVectorHLT Class Reference

#include <DQM/FourVectorHLT/src/FourVectorHLT.cc>

Inheritance diagram for FourVectorHLT:
edm::EDAnalyzer edm::EDConsumerBase

Classes

class  PathInfo
 
class  PathInfoCollection
 

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

 FourVectorHLT (const edm::ParameterSet &)
 
 ~FourVectorHLT () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void beginRun (const edm::Run &run, const edm::EventSetup &c) override
 
void endJob () override
 
void endRun (const edm::Run &run, const edm::EventSetup &c) override
 EndRun. More...
 

Private Attributes

DQMStoredbe_
 
std::string dirname_
 
PathInfoCollection hltPaths_
 
unsigned int nBins_
 
int nev_
 
bool plotAll_
 
double ptMax_
 
double ptMin_
 
edm::InputTag triggerResultLabel_
 
edm::InputTag triggerSummaryLabel_
 
edm::EDGetTokenT< trigger::TriggerEventtriggerSummaryToken_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Description: This is a DQM source meant to plot high-level HLT trigger quantities as stored in the HLT results object TriggerResults

Implementation: <Notes on="" implementation>="">

Definition at line 46 of file FourVectorHLT.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 49 of file FourVectorHLT.h.

◆ MonitorElement

Definition at line 48 of file FourVectorHLT.h.

Constructor & Destructor Documentation

◆ FourVectorHLT()

FourVectorHLT::FourVectorHLT ( const edm::ParameterSet iConfig)
explicit

Definition at line 15 of file FourVectorHLT.cc.

15  {
16  LogDebug("FourVectorHLT") << "constructor....";
17 
18  dbe_ = Service<DQMStore>().operator->();
19  if (!dbe_) {
20  LogWarning("Status") << "unable to get DQMStore service?";
21  }
22 
23  dirname_ = "HLT/FourVectorHLT";
24 
25  if (dbe_ != nullptr) {
26  LogDebug("Status") << "Setting current directory to " << dirname_;
28  }
29 
30  // plotting paramters
31  ptMin_ = iConfig.getUntrackedParameter<double>("ptMin", 0.);
32  ptMax_ = iConfig.getUntrackedParameter<double>("ptMax", 200.);
33  nBins_ = iConfig.getUntrackedParameter<unsigned int>("Nbins", 50);
34 
35  plotAll_ = iConfig.getUntrackedParameter<bool>("plotAll", false);
36 
37  // this is the list of paths to look at.
38  std::vector<edm::ParameterSet> filters = iConfig.getParameter<std::vector<edm::ParameterSet> >("filters");
39  for (std::vector<edm::ParameterSet>::iterator filterconf = filters.begin(); filterconf != filters.end();
40  filterconf++) {
41  std::string me = filterconf->getParameter<std::string>("name");
42  int objectType = filterconf->getParameter<unsigned int>("type");
43  float ptMin = filterconf->getUntrackedParameter<double>("ptMin");
44  float ptMax = filterconf->getUntrackedParameter<double>("ptMax");
45  hltPaths_.push_back(PathInfo(me, objectType, ptMin, ptMax));
46  }
47  if (!hltPaths_.empty() && plotAll_) {
48  // these two ought to be mutually exclusive....
49  LogWarning("Configuration") << "Using both plotAll and a list. "
50  "list will be ignored.";
51  hltPaths_.clear();
52  }
53  triggerSummaryLabel_ = iConfig.getParameter<edm::InputTag>("triggerSummaryLabel");
54 
55  //set Token(-s)
56  triggerSummaryToken_ = consumes<trigger::TriggerEvent>(iConfig.getParameter<edm::InputTag>("triggerSummaryLabel"));
57 }

References dbe_, filters, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), LogDebug, hlt_dqm_clientPB-live_cfg::me, AlignmentTrackSelector_cfi::ptMax, ptMin, dqm::implementation::DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~FourVectorHLT()

FourVectorHLT::~FourVectorHLT ( )
override

Definition at line 59 of file FourVectorHLT.cc.

59  {
60  // do anything here that needs to be done at desctruction time
61  // (e.g. close files, deallocate resources etc.)
62 }

Member Function Documentation

◆ analyze()

void FourVectorHLT::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 69 of file FourVectorHLT.cc.

69  {
70  using namespace edm;
71  using namespace trigger;
72  ++nev_;
73  LogDebug("Status") << "analyze";
74 
75  edm::Handle<TriggerEvent> triggerObj;
76  iEvent.getByToken(triggerSummaryToken_, triggerObj);
77  if (!triggerObj.isValid()) {
78  edm::LogInfo("Status") << "Summary HLT object (TriggerEvent) not found, "
79  "skipping event";
80  return;
81  }
82 
83  const trigger::TriggerObjectCollection& toc(triggerObj->getObjects());
84 
85  if (plotAll_) {
86  for (size_t ia = 0; ia < triggerObj->sizeFilters(); ++ia) {
87  std::string fullname = triggerObj->filterTag(ia).encode();
88  // the name can have in it the module label as well as the process and
89  // other labels - strip 'em
91  size_t p = fullname.find_first_of(':');
92  if (p != std::string::npos) {
93  name = fullname.substr(0, p);
94  } else {
95  name = fullname;
96  }
97 
98  LogDebug("Parameter") << "filter " << ia << ", full name = " << fullname << ", p = " << p
99  << ", abbreviated = " << name;
100 
101  PathInfoCollection::iterator pic = hltPaths_.find(name);
102  if (pic == hltPaths_.end()) {
103  // doesn't exist - add it
104  MonitorElement *et(nullptr), *eta(nullptr), *phi(nullptr), *etavsphi(nullptr);
105 
106  std::string histoname(name + "_et");
107  LogDebug("Status") << "new histo with name " << histoname;
109  std::string title(name + " E_{T}");
110  et = dbe_->book1D(histoname.c_str(), title.c_str(), nBins_, 0, 100);
111 
112  histoname = name + "_eta";
113  title = name + " #eta";
114  eta = dbe_->book1D(histoname.c_str(), title.c_str(), nBins_, -2.7, 2.7);
115 
116  histoname = name + "_phi";
117  title = name + " #phi";
118  phi = dbe_->book1D(histoname.c_str(), title.c_str(), nBins_, -3.14, 3.14);
119 
120  histoname = name + "_etaphi";
121  title = name + " #eta vs #phi";
122  etavsphi = dbe_->book2D(histoname.c_str(), title.c_str(), nBins_, -2.7, 2.7, nBins_, -3.14, 3.14);
123 
124  // no idea how to get the bin boundries in this mode
125  PathInfo e(name, 0, et, eta, phi, etavsphi, ptMin_, ptMax_);
126  hltPaths_.push_back(e);
127  pic = hltPaths_.begin() + hltPaths_.size() - 1;
128  }
129  const trigger::Keys& k = triggerObj->filterKeys(ia);
130  for (trigger::Keys::const_iterator ki = k.begin(); ki != k.end(); ++ki) {
131  LogDebug("Parameters") << "pt, eta, phi = " << toc[*ki].pt() << ", " << toc[*ki].eta() << ", "
132  << toc[*ki].phi();
133  pic->getEtHisto()->Fill(toc[*ki].pt());
134  pic->getEtaHisto()->Fill(toc[*ki].eta());
135  pic->getPhiHisto()->Fill(toc[*ki].phi());
136  pic->getEtaVsPhiHisto()->Fill(toc[*ki].eta(), toc[*ki].phi());
137  }
138  }
139 
140  } else { // not plotAll_
141  for (PathInfoCollection::iterator v = hltPaths_.begin(); v != hltPaths_.end(); ++v) {
142  const int index = triggerObj->filterIndex(v->getName());
143  if (index >= triggerObj->sizeFilters()) {
144  continue; // not in this event
145  }
146  LogDebug("Status") << "filling ... ";
147  const trigger::Keys& k = triggerObj->filterKeys(index);
148  for (trigger::Keys::const_iterator ki = k.begin(); ki != k.end(); ++ki) {
149  v->getEtHisto()->Fill(toc[*ki].pt());
150  v->getEtaHisto()->Fill(toc[*ki].eta());
151  v->getPhiHisto()->Fill(toc[*ki].phi());
152  v->getEtaVsPhiHisto()->Fill(toc[*ki].eta(), toc[*ki].phi());
153  }
154  }
155  }
156 }

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), dbe_, MillePedeFileConverter_cfg::e, edm::InputTag::encode(), EgHLTOffHistBins_cfi::et, PVValHelper::eta, trigger::TriggerEvent::filterIndex(), trigger::TriggerEvent::filterKeys(), trigger::TriggerEvent::filterTag(), trigger::TriggerEvent::getObjects(), iEvent, edm::HandleBase::isValid(), dqmdumpme::k, LogDebug, Skims_PA_cff::name, AlCaHLTBitMon_ParallelJobs::p, DiDispStaMuonMonitor_cfi::pt, dqm::implementation::DQMStore::setCurrentFolder(), trigger::TriggerEvent::sizeFilters(), AlCaHLTBitMon_QueryRunRegistry::string, overlapproblemtsosanalyzer_cfi::title, and findQualityFiles::v.

◆ beginJob()

void FourVectorHLT::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 159 of file FourVectorHLT.cc.

159  {
160  nev_ = 0;
161  DQMStore* dbe = nullptr;
162  dbe = Service<DQMStore>().operator->();
163 
164  if (dbe) {
165  dbe->setCurrentFolder(dirname_);
166 
167  if (!plotAll_) {
168  for (PathInfoCollection::iterator v = hltPaths_.begin(); v != hltPaths_.end(); ++v) {
169  MonitorElement *et, *eta, *phi, *etavsphi = nullptr;
170  std::string histoname(v->getName() + "_et");
171  std::string title(v->getName() + " E_t");
172  et = dbe->book1D(histoname.c_str(), title.c_str(), nBins_, v->getPtMin(), v->getPtMax());
173 
174  histoname = v->getName() + "_eta";
175  title = v->getName() + " #eta";
176  eta = dbe->book1D(histoname.c_str(), title.c_str(), nBins_, -2.7, 2.7);
177 
178  histoname = v->getName() + "_phi";
179  title = v->getName() + " #phi";
180  phi = dbe->book1D(histoname.c_str(), histoname.c_str(), nBins_, -3.14, 3.14);
181 
182  histoname = v->getName() + "_etaphi";
183  title = v->getName() + " #eta vs #phi";
184  etavsphi = dbe->book2D(histoname.c_str(), title.c_str(), nBins_, -2.7, 2.7, nBins_, -3.14, 3.14);
185 
186  v->setHistos(et, eta, phi, etavsphi);
187  }
188  } // ! plotAll_ - for plotAll we discover it during the event
189  }
190 }

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), EgHLTOffHistBins_cfi::et, PVValHelper::eta, dqm::implementation::DQMStore::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, overlapproblemtsosanalyzer_cfi::title, and findQualityFiles::v.

◆ beginRun()

void FourVectorHLT::beginRun ( const edm::Run run,
const edm::EventSetup c 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 199 of file FourVectorHLT.cc.

199  {
200  LogDebug("Status") << "beginRun, run " << run.id();
201 }

References LogDebug, and writedatasetfile::run.

◆ endJob()

void FourVectorHLT::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 193 of file FourVectorHLT.cc.

193  {
194  LogInfo("Status") << "endJob: analyzed " << nev_ << " events";
195  return;
196 }

◆ endRun()

void FourVectorHLT::endRun ( const edm::Run run,
const edm::EventSetup c 
)
overrideprivatevirtual

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 204 of file FourVectorHLT.cc.

204  {
205  LogDebug("Status") << "endRun, run " << run.id();
206 }

References LogDebug, and writedatasetfile::run.

Member Data Documentation

◆ dbe_

DQMStore* FourVectorHLT::dbe_
private

Definition at line 67 of file FourVectorHLT.h.

◆ dirname_

std::string FourVectorHLT::dirname_
private

Definition at line 75 of file FourVectorHLT.h.

◆ hltPaths_

PathInfoCollection FourVectorHLT::hltPaths_
private

Definition at line 153 of file FourVectorHLT.h.

◆ nBins_

unsigned int FourVectorHLT::nBins_
private

Definition at line 71 of file FourVectorHLT.h.

◆ nev_

int FourVectorHLT::nev_
private

Definition at line 66 of file FourVectorHLT.h.

◆ plotAll_

bool FourVectorHLT::plotAll_
private

Definition at line 69 of file FourVectorHLT.h.

◆ ptMax_

double FourVectorHLT::ptMax_
private

Definition at line 73 of file FourVectorHLT.h.

◆ ptMin_

double FourVectorHLT::ptMin_
private

Definition at line 72 of file FourVectorHLT.h.

◆ triggerResultLabel_

edm::InputTag FourVectorHLT::triggerResultLabel_
private

Definition at line 77 of file FourVectorHLT.h.

◆ triggerSummaryLabel_

edm::InputTag FourVectorHLT::triggerSummaryLabel_
private

Definition at line 76 of file FourVectorHLT.h.

◆ triggerSummaryToken_

edm::EDGetTokenT<trigger::TriggerEvent> FourVectorHLT::triggerSummaryToken_
private

Definition at line 80 of file FourVectorHLT.h.

FourVectorHLT::triggerSummaryToken_
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryToken_
Definition: FourVectorHLT.h:80
FourVectorHLT::triggerSummaryLabel_
edm::InputTag triggerSummaryLabel_
Definition: FourVectorHLT.h:76
trigger::TriggerEvent::sizeFilters
trigger::size_type sizeFilters() const
Definition: TriggerEvent.h:146
filters
std::vector< TPRegexp > filters
Definition: eve_filter.cc:22
trigger::TriggerEvent::filterKeys
const Keys & filterKeys(trigger::size_type index) const
Definition: TriggerEvent.h:118
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
edm
HLT enums.
Definition: AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::LogInfo
Definition: MessageLogger.h:254
ptMin
constexpr float ptMin
Definition: PhotonIDValueMapProducer.cc:153
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
findQualityFiles.v
v
Definition: findQualityFiles.py:179
FourVectorHLT::DQMStore
dqm::legacy::DQMStore DQMStore
Definition: FourVectorHLT.h:49
edm::Handle
Definition: AssociativeIterator.h:50
FourVectorHLT::nev_
int nev_
Definition: FourVectorHLT.h:66
trigger::TriggerEvent::filterTag
const edm::InputTag filterTag(trigger::size_type index) const
Definition: TriggerEvent.h:108
AlignmentTrackSelector_cfi.ptMax
ptMax
Definition: AlignmentTrackSelector_cfi.py:12
PVValHelper::eta
Definition: PVValidationHelpers.h:69
dqm::implementation::DQMStore::setCurrentFolder
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
dqmdumpme.k
k
Definition: dqmdumpme.py:60
FourVectorHLT::plotAll_
bool plotAll_
Definition: FourVectorHLT.h:69
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogWarning
Definition: MessageLogger.h:141
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
FourVectorHLT::ptMax_
double ptMax_
Definition: FourVectorHLT.h:73
trigger::TriggerObjectCollection
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:75
FourVectorHLT::nBins_
unsigned int nBins_
Definition: FourVectorHLT.h:71
edm::Service
Definition: Service.h:30
iEvent
int iEvent
Definition: GenABIO.cc:224
FourVectorHLT::ptMin_
double ptMin_
Definition: FourVectorHLT.h:72
trigger::TriggerEvent::filterIndex
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
Definition: TriggerEvent.h:132
trigger::Keys
std::vector< size_type > Keys
Definition: TriggerTypeDefs.h:19
edm::InputTag::encode
std::string encode() const
Definition: InputTag.cc:159
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
FourVectorHLT::dbe_
DQMStore * dbe_
Definition: FourVectorHLT.h:67
trigger::TriggerEvent::getObjects
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:101
overlapproblemtsosanalyzer_cfi.title
title
Definition: overlapproblemtsosanalyzer_cfi.py:7
DDAxes::phi
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
writedatasetfile.run
run
Definition: writedatasetfile.py:27
FourVectorHLT::hltPaths_
PathInfoCollection hltPaths_
Definition: FourVectorHLT.h:153
FourVectorHLT::PathInfoCollection::find
std::vector< PathInfo >::iterator find(std::string pathName)
Definition: FourVectorHLT.h:151
FourVectorHLT::dirname_
std::string dirname_
Definition: FourVectorHLT.h:75
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
trigger
Definition: HLTPrescaleTableCond.h:8
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::InputTag
Definition: InputTag.h:15
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37