17 LogDebug(
"FourVectorHLT") <<
"constructor...." ;
21 LogWarning(
"Status") <<
"unable to get DQMStore service?";
28 dirname_=
"HLT/FourVectorHLT" ;
30 if (
dbe_ !=
nullptr ) {
31 LogDebug(
"Status") <<
"Setting current directory to " << dirname_;
32 dbe_->setCurrentFolder(dirname_);
44 std::vector<edm::ParameterSet>
filters =
45 iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"filters");
46 for(std::vector<edm::ParameterSet>::iterator
47 filterconf = filters.begin() ; filterconf != filters.end();
50 int objectType = filterconf->getParameter<
unsigned int>(
"type");
51 float ptMin = filterconf->getUntrackedParameter<
double>(
"ptMin");
52 float ptMax = filterconf->getUntrackedParameter<
double>(
"ptMax");
53 hltPaths_.push_back(
PathInfo(me, objectType, ptMin, ptMax));
55 if ( !hltPaths_.empty() && plotAll_) {
57 LogWarning(
"Configuration") <<
"Using both plotAll and a list. " 58 "list will be ignored." ;
61 triggerSummaryLabel_ =
92 iEvent.
getByToken(triggerSummaryToken_, triggerObj);
94 edm::LogInfo(
"Status") <<
"Summary HLT object (TriggerEvent) not found, " 102 for (
size_t ia = 0; ia < triggerObj->
sizeFilters(); ++ ia) {
107 size_t p = fullname.find_first_of(
':');
108 if ( p != std::string::npos) {
109 name = fullname.substr(0, p);
115 LogDebug(
"Parameter") <<
"filter " << ia <<
", full name = " << fullname
117 <<
", abbreviated = " <<
name ;
119 PathInfoCollection::iterator pic = hltPaths_.find(name);
120 if ( pic == hltPaths_.end() ) {
125 LogDebug(
"Status") <<
"new histo with name "<< histoname ;
126 dbe_->setCurrentFolder(dirname_);
128 et =
dbe_->book1D(histoname.c_str(),
129 title.c_str(),nBins_, 0, 100);
131 histoname = name+
"_eta";
132 title = name+
" #eta";
133 eta =
dbe_->book1D(histoname.c_str(),
134 title.c_str(),nBins_,-2.7,2.7);
136 histoname = name+
"_phi";
137 title = name+
" #phi";
138 phi =
dbe_->book1D(histoname.c_str(),
139 title.c_str(),nBins_,-3.14,3.14);
142 histoname = name+
"_etaphi";
143 title = name+
" #eta vs #phi";
144 etavsphi =
dbe_->book2D(histoname.c_str(),
151 hltPaths_.push_back(e);
152 pic = hltPaths_.begin() + hltPaths_.size()-1;
155 for (trigger::Keys::const_iterator ki = k.begin(); ki !=k.end(); ++ki ) {
156 LogDebug(
"Parameters") <<
"pt, eta, phi = " 157 << toc[*ki].pt() <<
", " 158 << toc[*ki].eta() <<
", " 160 pic->getEtHisto()->Fill(toc[*ki].
pt());
161 pic->getEtaHisto()->Fill(toc[*ki].
eta());
162 pic->getPhiHisto()->Fill(toc[*ki].phi());
163 pic->getEtaVsPhiHisto()->Fill(toc[*ki].
eta(), toc[*ki].phi());
170 for(PathInfoCollection::iterator
v = hltPaths_.begin();
171 v!= hltPaths_.end(); ++
v ) {
176 LogDebug(
"Status") <<
"filling ... " ;
178 for (trigger::Keys::const_iterator ki = k.begin(); ki !=k.end(); ++ki ) {
179 v->getEtHisto()->Fill(toc[*ki].
pt());
180 v->getEtaHisto()->Fill(toc[*ki].
eta());
181 v->getPhiHisto()->Fill(toc[*ki].phi());
182 v->getEtaVsPhiHisto()->Fill(toc[*ki].
eta(), toc[*ki].phi());
198 dbe->setCurrentFolder(dirname_);
199 dbe->rmdir(dirname_);
204 dbe->setCurrentFolder(dirname_);
207 for(PathInfoCollection::iterator
v = hltPaths_.begin();
208 v!= hltPaths_.end(); ++
v ) {
212 et = dbe->book1D(histoname.c_str(),
213 title.c_str(),nBins_,
217 histoname =
v->getName()+
"_eta";
218 title =
v->getName()+
" #eta";
219 eta = dbe->book1D(histoname.c_str(),
220 title.c_str(),nBins_,-2.7,2.7);
222 histoname =
v->getName()+
"_phi";
223 title =
v->getName()+
" #phi";
224 phi = dbe->book1D(histoname.c_str(),
225 histoname.c_str(),nBins_,-3.14,3.14);
228 histoname =
v->getName()+
"_etaphi";
229 title =
v->getName()+
" #eta vs #phi";
230 etavsphi = dbe->book2D(histoname.c_str(),
235 v->setHistos( et, eta, phi, etavsphi);
245 LogInfo(
"Status") <<
"endJob: analyzed " << nev_ <<
" events";
253 LogDebug(
"Status") <<
"beginRun, run " << run.
id();
259 LogDebug(
"Status") <<
"endRun, run " << run.
id();
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
trigger::size_type sizeFilters() const
~FourVectorHLT() override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const Keys & filterKeys(trigger::size_type index) const
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
void endRun(const edm::Run &run, const edm::EventSetup &c) override
EndRun.
FourVectorHLT(const edm::ParameterSet &)
std::vector< TPRegexp > filters
const TriggerObjectCollection & getObjects() const
void analyze(const edm::Event &, const edm::EventSetup &) override
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
const edm::InputTag filterTag(trigger::size_type index) const
std::vector< size_type > Keys
et
define resolution functions of each parameter
void beginRun(const edm::Run &run, const edm::EventSetup &c) override