19 LogDebug(
"FourVectorHLT") <<
"constructor...." ;
23 LogWarning(
"Status") <<
"unable to get DQMStore service?";
30 dirname_=
"HLT/FourVectorHLT" ;
33 LogDebug(
"Status") <<
"Setting current directory to " << dirname_;
34 dbe_->setCurrentFolder(dirname_);
46 std::vector<edm::ParameterSet>
filters =
47 iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"filters");
48 for(std::vector<edm::ParameterSet>::iterator
49 filterconf = filters.begin() ; filterconf != filters.end();
52 int objectType = filterconf->getParameter<
unsigned int>(
"type");
53 float ptMin = filterconf->getUntrackedParameter<
double>(
"ptMin");
54 float ptMax = filterconf->getUntrackedParameter<
double>(
"ptMax");
55 hltPaths_.push_back(
PathInfo(me, objectType, ptMin, ptMax));
57 if ( hltPaths_.size() && plotAll_) {
59 LogWarning(
"Configuration") <<
"Using both plotAll and a list. "
60 "list will be ignored." ;
63 triggerSummaryLabel_ =
89 using namespace trigger;
94 iEvent.
getByToken(triggerSummaryToken_, triggerObj);
95 if(!triggerObj.isValid()) {
96 edm::LogInfo(
"Status") <<
"Summary HLT object (TriggerEvent) not found, "
104 for (
size_t ia = 0; ia < triggerObj->sizeFilters(); ++ ia) {
105 std::string fullname = triggerObj->filterTag(ia).encode();
109 size_t p = fullname.find_first_of(
':');
110 if ( p != std::string::npos) {
111 name = fullname.substr(0, p);
117 LogDebug(
"Parameter") <<
"filter " << ia <<
", full name = " << fullname
119 <<
", abbreviated = " <<
name ;
121 PathInfoCollection::iterator pic = hltPaths_.find(name);
122 if ( pic == hltPaths_.end() ) {
127 LogDebug(
"Status") <<
"new histo with name "<< histoname ;
128 dbe_->setCurrentFolder(dirname_);
130 et =
dbe_->book1D(histoname.c_str(),
131 title.c_str(),nBins_, 0, 100);
133 histoname = name+
"_eta";
134 title = name+
" #eta";
135 eta =
dbe_->book1D(histoname.c_str(),
136 title.c_str(),nBins_,-2.7,2.7);
138 histoname = name+
"_phi";
139 title = name+
" #phi";
140 phi =
dbe_->book1D(histoname.c_str(),
141 title.c_str(),nBins_,-3.14,3.14);
144 histoname = name+
"_etaphi";
145 title = name+
" #eta vs #phi";
146 etavsphi =
dbe_->book2D(histoname.c_str(),
153 hltPaths_.push_back(e);
154 pic = hltPaths_.begin() + hltPaths_.size()-1;
157 for (trigger::Keys::const_iterator ki = k.begin(); ki !=k.end(); ++ki ) {
158 LogDebug(
"Parameters") <<
"pt, eta, phi = "
159 << toc[*ki].pt() <<
", "
160 << toc[*ki].eta() <<
", "
162 pic->getEtHisto()->Fill(toc[*ki].
pt());
163 pic->getEtaHisto()->Fill(toc[*ki].
eta());
164 pic->getPhiHisto()->Fill(toc[*ki].
phi());
165 pic->getEtaVsPhiHisto()->Fill(toc[*ki].
eta(), toc[*ki].
phi());
172 for(PathInfoCollection::iterator
v = hltPaths_.begin();
173 v!= hltPaths_.end(); ++
v ) {
174 const int index = triggerObj->filterIndex(
v->getName());
175 if ( index >= triggerObj->sizeFilters() ) {
178 LogDebug(
"Status") <<
"filling ... " ;
180 for (trigger::Keys::const_iterator ki = k.begin(); ki !=k.end(); ++ki ) {
181 v->getEtHisto()->Fill(toc[*ki].
pt());
182 v->getEtaHisto()->Fill(toc[*ki].
eta());
183 v->getPhiHisto()->Fill(toc[*ki].
phi());
184 v->getEtaVsPhiHisto()->Fill(toc[*ki].
eta(), toc[*ki].
phi());
200 dbe->setCurrentFolder(dirname_);
201 dbe->rmdir(dirname_);
206 dbe->setCurrentFolder(dirname_);
209 for(PathInfoCollection::iterator
v = hltPaths_.begin();
210 v!= hltPaths_.end(); ++
v ) {
214 et = dbe->book1D(histoname.c_str(),
215 title.c_str(),nBins_,
219 histoname =
v->getName()+
"_eta";
220 title =
v->getName()+
" #eta";
221 eta = dbe->book1D(histoname.c_str(),
222 title.c_str(),nBins_,-2.7,2.7);
224 histoname =
v->getName()+
"_phi";
225 title =
v->getName()+
" #phi";
226 phi = dbe->book1D(histoname.c_str(),
227 histoname.c_str(),nBins_,-3.14,3.14);
230 histoname =
v->getName()+
"_etaphi";
231 title =
v->getName()+
" #eta vs #phi";
232 etavsphi = dbe->book2D(histoname.c_str(),
237 v->setHistos( et, eta, phi, etavsphi);
247 LogInfo(
"Status") <<
"endJob: analyzed " << nev_ <<
" events";
255 LogDebug(
"Status") <<
"beginRun, run " << run.
id();
261 LogDebug(
"Status") <<
"endRun, run " << run.
id();
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
FourVectorHLT(const edm::ParameterSet &)
std::vector< TPRegexp > filters
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
void endRun(const edm::Run &run, const edm::EventSetup &c)
EndRun.
std::vector< size_type > Keys
void beginRun(const edm::Run &run, const edm::EventSetup &c)