16 LogDebug(
"FourVectorHLT") <<
"constructor....";
20 LogWarning(
"Status") <<
"unable to get DQMStore service?";
23 dirname_ =
"HLT/FourVectorHLT";
25 if (
dbe_ !=
nullptr) {
26 LogDebug(
"Status") <<
"Setting current directory to " << dirname_;
27 dbe_->setCurrentFolder(dirname_);
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();
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));
47 if (!hltPaths_.empty() && plotAll_) {
49 LogWarning(
"Configuration") <<
"Using both plotAll and a list. "
50 "list will be ignored.";
71 using namespace trigger;
76 iEvent.
getByToken(triggerSummaryToken_, triggerObj);
77 if (!triggerObj.isValid()) {
78 edm::LogInfo(
"Status") <<
"Summary HLT object (TriggerEvent) not found, "
86 for (
size_t ia = 0; ia < triggerObj->sizeFilters(); ++ia) {
87 std::string fullname = triggerObj->filterTag(ia).encode();
91 size_t p = fullname.find_first_of(
':');
92 if (p != std::string::npos) {
93 name = fullname.substr(0, p);
98 LogDebug(
"Parameter") <<
"filter " << ia <<
", full name = " << fullname <<
", p = " << p
99 <<
", abbreviated = " <<
name;
101 PathInfoCollection::iterator pic = hltPaths_.find(name);
102 if (pic == hltPaths_.end()) {
107 LogDebug(
"Status") <<
"new histo with name " << histoname;
108 dbe_->setCurrentFolder(dirname_);
110 et =
dbe_->book1D(histoname.c_str(), title.c_str(), nBins_, 0, 100);
112 histoname = name +
"_eta";
113 title = name +
" #eta";
114 eta =
dbe_->book1D(histoname.c_str(), title.c_str(), nBins_, -2.7, 2.7);
116 histoname = name +
"_phi";
117 title = name +
" #phi";
118 phi =
dbe_->book1D(histoname.c_str(), title.c_str(), nBins_, -3.14, 3.14);
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);
126 hltPaths_.push_back(e);
127 pic = hltPaths_.begin() + hltPaths_.size() - 1;
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() <<
", "
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());
141 for (PathInfoCollection::iterator
v = hltPaths_.begin();
v != hltPaths_.end(); ++
v) {
142 const int index = triggerObj->filterIndex(
v->getName());
143 if (index >= triggerObj->sizeFilters()) {
146 LogDebug(
"Status") <<
"filling ... ";
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());
168 for (PathInfoCollection::iterator
v = hltPaths_.begin();
v != hltPaths_.end(); ++
v) {
172 et = dbe->
book1D(histoname.c_str(),
title.c_str(), nBins_,
v->getPtMin(),
v->getPtMax());
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);
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);
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);
186 v->setHistos(et, eta, phi, etavsphi);
194 LogInfo(
"Status") <<
"endJob: analyzed " << nev_ <<
" events";
200 LogDebug(
"Status") <<
"beginRun, run " << run.
id();
205 LogDebug(
"Status") <<
"endRun, run " << run.
id();
T getUntrackedParameter(std::string const &, T const &) const
const edm::EventSetup & c
~FourVectorHLT() override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void setCurrentFolder(std::string const &fullpath) override
void endRun(const edm::Run &run, const edm::EventSetup &c) override
EndRun.
FourVectorHLT(const edm::ParameterSet &)
std::vector< TPRegexp > filters
ptMin_(conf.getParameter< double >("ptMin"))
void analyze(const edm::Event &, const edm::EventSetup &) override
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Log< level::Info, false > LogInfo
std::vector< size_type > Keys
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
T getParameter(std::string const &) const
Log< level::Warning, false > LogWarning
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
void beginRun(const edm::Run &run, const edm::EventSetup &c) override