119 using namespace trigger;
153 if(!triggerResults.isValid()) {
155 iEvent.
getByLabel(triggerResultsLabelFU,triggerResults);
156 if(!triggerResults.isValid()) {
157 LogWarning(
"HLTJetMETDQMSource") <<
"TriggerResults not found, skipping event" << std::endl;
162 unsigned int npath = triggerResults->
size();
166 if(!triggerObj.isValid()) {
168 iEvent.
getByLabel(triggerSummaryLabelFU,triggerObj);
169 if(!triggerObj.isValid()) {
170 LogWarning(
"HLTJetMETDQMSource") <<
"TriggerEvent not found, skipping event" << std::endl;
195 triggertype =
v->getObjectType();
197 bool l1accept =
false;
199 const int l1index = triggerObj->filterIndex(l1testTag);
200 if ( l1index >= triggerObj->sizeFilters() ) {
202 <<
v->getl1Path() <<
"\t" <<
"\t" << l1testTag << std::endl;
206 const trigger::Vids & idtype = triggerObj->filterIds(l1index);
210 l1accept = l1k.size() > 0;
218 for(
unsigned int i = 0;
i < npath; ++
i) {
219 if ( triggerNames.triggerName(
i).find(
v->getPath()) != std::string::npos
220 && triggerResults->accept(
i)){
230 if (
verbose_)
std::cout <<
" N " << N <<
" trigger name " <<
v->getPath() << std::endl;
233 edm::LogInfo(
"HLTJetMETDQMSource") <<
"l1 seed path not accepted for hlt path "
234 <<
v->getPath() <<
"\t" <<
v->getl1Path();
240 if (
v->getLabel() ==
"dummy"){
244 for (std::vector<std::string>::const_iterator labelIter= filterLabels.begin();
245 labelIter!=filterLabels.end(); labelIter++) {
248 << testTag.process() << std::endl;
249 int testindex = triggerObj->filterIndex(testTag);
251 if ( !(testindex >= triggerObj->sizeFilters()) ) {
253 << testTag.label() << std::endl;
255 v->setLabel(*labelIter);
259 const int index = triggerObj->filterIndex(filterTag);
261 << filterTag << std::endl;
262 if ( index >= triggerObj->sizeFilters() ) {
264 << filterTag << std::endl;
269 for (trigger::Keys::const_iterator ki = k.begin(); ki !=k.end(); ++ki ) {
270 if (
verbose_)
cout <<
" filling HLT " <<
v->getPath() <<
"\t" << toc[*ki].pt()
271 <<
"\t" << toc[*ki].eta() <<
"\t" << toc[*ki].phi() << std::endl;
277 if (
verbose_)
cout <<
" filling HLT " <<
v->getPath() <<
"\t"
278 <<
" *ki " << *ki <<
" Nki "<< N<<
" "
279 << toc[*ki].pt() <<
"\t" << toc[*ki].eta() <<
"\t"
280 << toc[*ki].phi() << std::endl;
282 v->getEtHisto()->Fill(toc[*ki].pt());
283 v->getEtaHisto()->Fill(toc[*ki].
eta());
284 v->getPhiHisto()->Fill(toc[*ki].
phi());
285 v->getEtaPhiHisto()->Fill(toc[*ki].
eta(), toc[*ki].
phi());
288 trigger::Vids::const_iterator idtypeiter = idtype.begin();
289 for (trigger::Keys::const_iterator l1ki = l1k.begin();
290 l1ki !=l1k.end(); ++l1ki ) {
296 <<
"\t" <<
" *l1ki " << *l1ki <<
" NL1 "
297 << NL1<<
" " << toc[*l1ki].pt() <<
"\t"
298 << toc[*l1ki].eta() <<
"\t" << toc[*l1ki].phi()
303 v->getL1EtHisto()->Fill(toc[*l1ki].pt());
304 v->getL1PhiHisto()->Fill(toc[*l1ki].
phi());
305 v->getL1EtaHisto()->Fill(toc[*l1ki].
eta());
306 v->getL1EtaPhiHisto()->Fill(toc[*l1ki].
eta(),toc[*l1ki].
phi());
320 if (
verbose_)
cout <<
" filling HLT " <<
v->getPath() <<
"\t" <<
" *ki "
321 << *ki <<
" Nki "<< N <<
" " << toc[*ki].pt()
322 <<
"\t" << toc[*ki].eta() <<
"\t" << toc[*ki].phi() << std::endl;
324 v->getEtHisto()->Fill(toc[*ki].pt());
327 v->getEtaPhiHisto()->Fill(toc[*ki].
eta(), toc[*ki].
phi());
330 trigger::Vids::const_iterator idtypeiter = idtype.begin();
331 for (trigger::Keys::const_iterator l1ki = l1k.begin(); l1ki !=l1k.end(); ++l1ki ) {
338 v->getL1EtHisto()->Fill(toc[*l1ki].pt());
341 v->getL1EtaPhiHisto()->Fill(toc[*l1ki].
eta(),toc[*l1ki].
phi());
354 v->getEtHisto()->Fill(toc[*ki].pt());
355 v->getPhiHisto()->Fill(toc[*ki].
phi());
358 trigger::Vids::const_iterator idtypeiter = idtype.begin();
359 for (trigger::Keys::const_iterator l1ki = l1k.begin(); l1ki !=l1k.end(); ++l1ki ) {
365 v->getL1EtHisto()->Fill(toc[*l1ki].pt());
366 v->getL1PhiHisto()->Fill(toc[*l1ki].
phi());
377 v->getEtHisto()->Fill(toc[*ki].pt());
378 v->getPhiHisto()->Fill(toc[*ki].
phi());
380 trigger::Vids::const_iterator idtypeiter = idtype.begin();
381 for (trigger::Keys::const_iterator l1ki = l1k.begin(); l1ki !=l1k.end(); ++l1ki ) {
388 v->getL1EtHisto()->Fill(toc[*l1ki].pt());
389 v->getL1PhiHisto()->Fill(toc[*l1ki].
phi());
411 triggertype =
v->getObjectType();
413 bool l1accept =
false;
415 const int l1index = triggerObj->filterIndex(l1testTag);
416 if ( l1index >= triggerObj->sizeFilters() ) {
417 if (
verbose_)
std::cout<<
"no index "<< l1index <<
" of that name (wrtMu)" <<
v->getl1Path() <<
"\t" <<
"\t" << l1testTag << std::endl;
425 l1accept = l1k.size() > 0;
430 bool denompassed =
false;
432 for(
unsigned int i = 0;
i < npath; ++
i) {
433 if ( triggerNames.triggerName(
i).find(
v->getPath()) != std::string::npos && triggerResults->accept(
i)){
434 passed =
true; break ;
437 for(
unsigned int i = 0;
i < npath; ++
i) {
438 if ( triggerNames.triggerName(
i).find(
v->getDenomPath()) != std::string::npos && triggerResults->accept(
i)){
439 denompassed =
true; break ;
445 <<
v->getDenomPath() << std::endl;
451 <<
v->getPath() << std::endl;
454 edm::LogInfo(
"HLTJetMETDQMSource") <<
"l1 seed path not accepted for hlt path "
455 <<
v->getPath() <<
"\t" <<
v->getl1Path();
459 if (
v->getLabel() ==
"dummy"){
463 for (std::vector<std::string>::const_iterator labelIter= filterLabels.begin(); labelIter!=filterLabels.end(); labelIter++) {
465 if (
verbose_)
std::cout <<
v->getPath() <<
"\t" << testTag.label() <<
"\t" << testTag.process() << std::endl;
467 int testindex = triggerObj->filterIndex(testTag);
469 if ( !(testindex >= triggerObj->sizeFilters()) ) {
470 if (
verbose_)
std::cout <<
"found one! " <<
v->getPath() <<
"\t" << testTag.label() << std::endl;
472 v->setLabel(*labelIter);
476 const int index = triggerObj->filterIndex(filterTag);
478 << filterTag << std::endl;
479 if ( index >= triggerObj->sizeFilters() ) {
481 << filterTag << std::endl;
486 for (trigger::Keys::const_iterator ki = k.begin(); ki !=k.end(); ++ki ) {
489 <<
"\t" << toc[*ki].pt() <<
"\t" << toc[*ki].eta()
490 <<
"\t" << toc[*ki].phi() << std::endl;
497 <<
"\t" <<
" *ki " << *ki <<
" Nki "<< N
498 <<
" " << toc[*ki].pt() <<
"\t" << toc[*ki].eta()
499 <<
"\t" << toc[*ki].phi() << std::endl;
500 v->getEtwrtMuHisto()->Fill(toc[*ki].pt());
503 v->getEtaPhiwrtMuHisto()->Fill(toc[*ki].
eta(), toc[*ki].
phi());
510 if (
verbose_)
cout <<
" filling HLT (wrtMu)" <<
v->getPath() <<
"\t" <<
" *ki " << *ki <<
" Nki "<< N <<
" " << toc[*ki].pt() <<
"\t" << toc[*ki].eta() <<
"\t" << toc[*ki].phi() << std::endl;
511 v->getEtwrtMuHisto()->Fill(toc[*ki].pt());
514 v->getEtaPhiwrtMuHisto()->Fill(toc[*ki].
eta(), toc[*ki].
phi());
520 v->getEtwrtMuHisto()->Fill(toc[*ki].pt());
521 v->getPhiwrtMuHisto()->Fill(toc[*ki].
phi());
527 v->getEtwrtMuHisto()->Fill(toc[*ki].pt());
548 triggertype =
v->getObjectType();
550 bool l1accept =
false;
552 const int l1index = triggerObj->filterIndex(l1testTag);
553 if ( l1index >= triggerObj->sizeFilters() ) {
555 <<
v->getl1Path() <<
"\t" <<
"\t" << l1testTag << std::endl;
562 l1accept = l1k.size() > 0;
564 for(
unsigned int i = 0;
i < npath; ++
i) {
565 if ( triggerNames.triggerName(
i).find(
v->getPath()) != std::string::npos
566 && triggerResults->accept(
i)){
572 bool denompassed =
false;
573 for(
unsigned int i = 0;
i < npath; ++
i) {
574 if ( triggerNames.triggerName(
i).find(
v->getDenomPath()) != std::string::npos
575 && triggerResults->accept(
i)){
577 if (
verbose_)
std::cout <<
" i " <<
i <<
" trigger name " <<
v->getDenomPath() << std::endl;
583 if (
verbose_)
std::cout <<
" N " << N <<
" trigger name " <<
v->getDenomPath() << std::endl;
586 edm::LogInfo(
"HLTJetMETDQMSource") <<
"l1 seed path not accepted for hlt path "
587 <<
v->getPath() <<
"\t" <<
v->getl1Path();
591 if (
verbose_)
std::cout <<
v->getDenomPath() <<
"\t" <<
v->getDenomLabel() <<
"\t" << std::endl;
592 if (
v->getDenomLabel() ==
"denomdummy"){
595 for (std::vector<std::string>::const_iterator labelIter= filterLabels.begin(); labelIter!=filterLabels.end(); labelIter++) {
598 << testTag.process() << std::endl;
599 int testindex = triggerObj->filterIndex(testTag);
600 if ( !(testindex >= triggerObj->sizeFilters()) ) {
602 << testTag.label() << std::endl;
604 v->setDenomLabel(*labelIter);
608 const int index = triggerObj->filterIndex(filterTag);
610 << filterTag << std::endl;
611 if ( index >= triggerObj->sizeFilters() ) {
613 << filterTag << std::endl;
618 for (trigger::Keys::const_iterator ki = k.begin(); ki !=k.end(); ++ki ) {
619 if (
verbose_)
cout <<
" filling HLT Denom " <<
v->getDenomPath() <<
"\t"
620 << toc[*ki].pt() <<
"\t" << toc[*ki].eta() <<
"\t"
621 << toc[*ki].phi() << std::endl;
627 if (
verbose_)
cout <<
" filling HLT Denom" <<
v->getDenomPath()
628 <<
"\t" <<
" *kiDeno " << *ki <<
" NkiDenom "
629 << Ndenom<<
" " << toc[*ki].pt() <<
"\t"
630 << toc[*ki].eta() <<
"\t" << toc[*ki].phi() << std::endl;
633 v->getEtDenomHisto()->Fill(toc[*ki].pt());
634 v->getEtaDenomHisto()->Fill(toc[*ki].
eta());
635 v->getPhiDenomHisto()->Fill(toc[*ki].
phi());
641 v->getEtDenomHisto()->Fill(toc[*ki].pt());
642 v->getPhiDenomHisto()->Fill(toc[*ki].
phi());
647 v->getEtDenomHisto()->Fill(toc[*ki].pt());
648 v->getPhiDenomHisto()->Fill(toc[*ki].
phi());
650 if ( numobj != -1)
break;
657 if (
verbose_)
std::cout <<
" N " << N <<
" trigger name " <<
v->getPath() << std::endl;
659 edm::LogInfo(
"HLTJetMETDQMSource") <<
"l1 seed path not accepted for hlt path "<<
v->getPath() <<
"\t" <<
v->getl1Path();
664 if (
v->getLabel() ==
"dummy"){
667 for (std::vector<std::string>::const_iterator labelIter= filterLabels.begin(); labelIter!=filterLabels.end(); labelIter++) {
670 << testTag.process() << std::endl;
671 int testindex = triggerObj->filterIndex(testTag);
672 if ( !(testindex >= triggerObj->sizeFilters()) ) {
674 << testTag.label() << std::endl;
676 v->setLabel(*labelIter);
680 const int index = triggerObj->filterIndex(filterTag);
682 << filterTag << std::endl;
683 if ( index >= triggerObj->sizeFilters() ) {
685 << filterTag << std::endl;
690 for (trigger::Keys::const_iterator ki = k.begin(); ki !=k.end(); ++ki ) {
692 if (
verbose_)
cout <<
" filling HLT " <<
v->getPath() <<
"\t"
693 << toc[*ki].pt() <<
"\t" << toc[*ki].eta()
694 <<
"\t" << toc[*ki].phi() << std::endl;
700 if (
verbose_)
cout <<
" filling HLT " <<
v->getPath() <<
"\t"
701 <<
" *ki " << *ki <<
" Nki "<< N<<
" "
702 << toc[*ki].pt() <<
"\t" << toc[*ki].eta()
703 <<
"\t" << toc[*ki].phi() << std::endl;
705 v->getEtNumHisto()->Fill(toc[*ki].pt());
706 v->getEtaNumHisto()->Fill(toc[*ki].
eta());
707 v->getPhiNumHisto()->Fill(toc[*ki].
phi());
713 v->getEtNumHisto()->Fill(toc[*ki].pt());
714 v->getPhiNumHisto()->Fill(toc[*ki].
phi());
719 v->getEtNumHisto()->Fill(toc[*ki].pt());
720 v->getPhiNumHisto()->Fill(toc[*ki].
phi());
722 if ( numobj != -1)
break;
728 if ( (
nev_ % 1000) == 0 ){
734 TH1F *rate_denom=
NULL;
739 if ((rate_denom->Integral() != 0.) && (rate_num->Integral() != 0.) ) {
741 for(
int j=1;
j <= rate_denom->GetXaxis()->GetNbins();
j++ ){
742 double y1 = rate_num->GetBinContent(
j);
743 double y2 = rate_denom->GetBinContent(
j);
744 double eff = y2 > 0. ? y1/y2 : 0.;
746 double y1err = rate_num->GetBinError(
j);
747 double y2err = rate_denom->GetBinError(
j);
750 if (y2 && y1 > 0.) efferr = (y1/y2)*
sqrt ((y1err/y1)*(y1err/y1)
751 + (y2err/y2)*(y2err/y2)) ;
757 triggertype =
v->getObjectType();
772 EtNum= (
v->getEtNumHisto())->
getTH1F() ;
773 EtaNum= (
v->getEtaNumHisto())->
getTH1F() ;
774 PhiNum= (
v->getPhiNumHisto())->
getTH1F() ;
775 EtDenom= (
v->getEtDenomHisto())->
getTH1F() ;
776 EtaDenom= (
v->getEtaDenomHisto())->
getTH1F() ;
777 PhiDenom= (
v->getPhiDenomHisto())->
getTH1F() ;
779 if ((EtNum->Integral() != 0.) && (EtDenom->Integral() != 0.) ) {
781 for(
int j=1;
j <= EtNum->GetXaxis()->GetNbins();
j++ ){
782 double y1 = EtNum->GetBinContent(
j);
783 double y2 = EtDenom->GetBinContent(
j);
784 double eff = y2 > 0. ? y1/y2 : 0.;
786 v->getEtEffHisto()->setBinContent(
j, eff);
787 double y1err = EtNum->GetBinError(
j);
788 double y2err = EtDenom->GetBinError(
j);
791 if (y2 && y1 > 0.) efferr = (y1/y2)*
sqrt ((y1err/y1)*(y1err/y1)
792 + (y2err/y2)*(y2err/y2)) ;
793 v->getEtEffHisto()->setBinError(
j, efferr);
796 << y1 <<
" " << y2 <<
" "<< y1err <<
" " << y2err << std::endl;
800 if (EtaNum->Integral() != 0. && EtaDenom->Integral() != 0. ) {
801 for(
int j=1;
j <= EtaNum->GetXaxis()->GetNbins();
j++ ){
802 double y1 = EtaNum->GetBinContent(
j);
803 double y2 = EtaDenom->GetBinContent(
j);
804 double eff = y2 > 0. ? y1/y2 : 0.;
805 v->getEtaEffHisto()->setBinContent(
j, eff);
806 double y1err = EtaNum->GetBinError(
j);
807 double y2err = EtaDenom->GetBinError(
j);
810 if (y2 && y1 > 0.) efferr = (y1/y2)*
sqrt ((y1err/y1)*(y1err/y1)
811 + (y2err/y2)*(y2err/y2)) ;
812 v->getEtaEffHisto()->setBinError(
j, efferr);
816 if (PhiNum->Integral() != 0. && PhiDenom->Integral() != 0. ) {
817 for(
int j=1;
j <= PhiNum->GetXaxis()->GetNbins();
j++ ){
818 double y1 = PhiNum->GetBinContent(
j);
819 double y2 = PhiDenom->GetBinContent(
j);
820 double eff = y2 > 0. ? y1/y2 : 0.;
821 v->getPhiEffHisto()->setBinContent(
j, eff);
822 double y1err = PhiNum->GetBinError(
j);
823 double y2err = PhiDenom->GetBinError(
j);
825 if (y2 && y1 > 0.) efferr = (y1/y2)*
sqrt ((y1err/y1)*(y1err/y1)
826 + (y2err/y2)*(y2err/y2)) ;
827 v->getPhiEffHisto()->setBinError(
j, efferr);
838 EtNum= (
v->getEtNumHisto())->
getTH1F() ;
839 PhiNum= (
v->getPhiNumHisto())->
getTH1F() ;
840 EtDenom= (
v->getEtDenomHisto())->
getTH1F() ;
841 PhiDenom= (
v->getPhiDenomHisto())->
getTH1F() ;
843 if (EtNum->Integral() != 0. && EtDenom->Integral() != 0. ) {
845 for(
int j=1;
j <= EtNum->GetXaxis()->GetNbins();
j++ ){
846 double y1 = EtNum->GetBinContent(
j);
847 double y2 = EtDenom->GetBinContent(
j);
848 double eff = y2 > 0. ? y1/y2 : 0.;
849 v->getEtEffHisto()->setBinContent(
j, eff);
850 double y1err = EtNum->GetBinError(
j);
851 double y2err = EtDenom->GetBinError(
j);
854 if (y2 && y1 > 0.) efferr = (y1/y2)*
sqrt ((y1err/y1)*(y1err/y1)
855 + (y2err/y2)*(y2err/y2)) ;
856 v->getEtEffHisto()->setBinError(
j, efferr);
859 if (PhiNum->Integral() != 0. && PhiDenom->Integral() != 0. ) {
861 for(
int j=1;
j <= PhiNum->GetXaxis()->GetNbins();
j++ ){
862 double y1 = PhiNum->GetBinContent(
j);
863 double y2 = PhiDenom->GetBinContent(
j);
864 double eff = y2 > 0. ? y1/y2 : 0.;
865 v->getPhiEffHisto()->setBinContent(
j, eff);
866 double y1err = PhiNum->GetBinError(
j);
867 double y2err = PhiDenom->GetBinError(
j);
870 if (y2 && y1 > 0.) efferr = (y1/y2)*
sqrt ((y1err/y1)*(y1err/y1)
871 + (y2err/y2)*(y2err/y2)) ;
872 v->getPhiEffHisto()->setBinError(
j, efferr);
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * rate_All
edm::InputTag triggerSummaryLabel_
edm::InputTag triggerResultsLabel_
enum start value shifted to 81 so as to avoid clashes with PDG codes
PathInfoCollection hltPathsAll_
Strings::size_type size() const
double deltaR(double eta1, double phi1, double eta2, double phi2)
HLTConfigProvider hltConfig_
MonitorElement * rate_Denom
TH1F * getTH1F(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
PathInfoCollection hltPathswrtMu_
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
std::vector< size_type > Keys
TH1F * getTH1F(void) const
MonitorElement * rate_Eff
MonitorElement * rate_Num
PathInfoCollection hltPathsEff_
MonitorElement * rate_All_L1
MonitorElement * rate_wrtMu