119 using namespace trigger;
157 LogWarning(
"HLTJetMETDQMSource") <<
"TriggerResults not found, skipping event" << std::endl;
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
231 if (
verbose_)
std::cout <<
" N " << N <<
" trigger name " <<
v->getPath() << std::endl;
234 edm::LogInfo(
"HLTJetMETDQMSource") <<
"l1 seed path not accepted for hlt path "
235 <<
v->getPath() <<
"\t" <<
v->getl1Path();
241 if (
v->getLabel() ==
"dummy"){
245 for (std::vector<std::string>::const_iterator labelIter= filterLabels.begin();
246 labelIter!=filterLabels.end(); labelIter++) {
249 << testTag.process() << std::endl;
250 int testindex = triggerObj->filterIndex(testTag);
252 if ( !(testindex >= triggerObj->sizeFilters()) ) {
254 << testTag.label() << std::endl;
256 v->setLabel(*labelIter);
260 const int index = triggerObj->filterIndex(filterTag);
262 << filterTag << std::endl;
263 if ( index >= triggerObj->sizeFilters() ) {
265 << filterTag << std::endl;
270 for (trigger::Keys::const_iterator ki = k.begin(); ki !=k.end(); ++ki ) {
271 if (
verbose_)
cout <<
" filling HLT " <<
v->getPath() <<
"\t" << toc[*ki].pt()
272 <<
"\t" << toc[*ki].eta() <<
"\t" << toc[*ki].phi() << std::endl;
278 if (
verbose_)
cout <<
" filling HLT " <<
v->getPath() <<
"\t"
279 <<
" *ki " << *ki <<
" Nki "<< N<<
" "
280 << toc[*ki].pt() <<
"\t" << toc[*ki].eta() <<
"\t"
281 << toc[*ki].phi() << std::endl;
283 v->getEtHisto()->Fill(toc[*ki].pt());
284 v->getEtaHisto()->Fill(toc[*ki].
eta());
285 v->getPhiHisto()->Fill(toc[*ki].
phi());
286 v->getEtaPhiHisto()->Fill(toc[*ki].
eta(), toc[*ki].
phi());
289 trigger::Vids::const_iterator idtypeiter = idtype.begin();
290 for (trigger::Keys::const_iterator l1ki = l1k.begin();
291 l1ki !=l1k.end(); ++l1ki ) {
297 <<
"\t" <<
" *l1ki " << *l1ki <<
" NL1 "
298 << NL1<<
" " << toc[*l1ki].pt() <<
"\t"
299 << toc[*l1ki].eta() <<
"\t" << toc[*l1ki].phi()
305 v->getL1EtHisto()->Fill(toc[*l1ki].pt());
306 v->getL1PhiHisto()->Fill(toc[*l1ki].
phi());
307 v->getL1EtaHisto()->Fill(toc[*l1ki].
eta());
308 v->getL1EtaPhiHisto()->Fill(toc[*l1ki].
eta(),toc[*l1ki].
phi());
322 if (
verbose_)
cout <<
" filling HLT " <<
v->getPath() <<
"\t" <<
" *ki "
323 << *ki <<
" Nki "<< N <<
" " << toc[*ki].pt()
324 <<
"\t" << toc[*ki].eta() <<
"\t" << toc[*ki].phi() << std::endl;
326 v->getEtHisto()->Fill(toc[*ki].pt());
329 v->getEtaPhiHisto()->Fill(toc[*ki].
eta(), toc[*ki].
phi());
332 trigger::Vids::const_iterator idtypeiter = idtype.begin();
333 for (trigger::Keys::const_iterator l1ki = l1k.begin(); l1ki !=l1k.end(); ++l1ki ) {
341 v->getL1EtHisto()->Fill(toc[*l1ki].pt());
344 v->getL1EtaPhiHisto()->Fill(toc[*l1ki].
eta(),toc[*l1ki].
phi());
357 v->getEtHisto()->Fill(toc[*ki].pt());
358 v->getPhiHisto()->Fill(toc[*ki].
phi());
361 trigger::Vids::const_iterator idtypeiter = idtype.begin();
362 for (trigger::Keys::const_iterator l1ki = l1k.begin(); l1ki !=l1k.end(); ++l1ki ) {
369 v->getL1EtHisto()->Fill(toc[*l1ki].pt());
370 v->getL1PhiHisto()->Fill(toc[*l1ki].
phi());
381 v->getEtHisto()->Fill(toc[*ki].pt());
382 v->getPhiHisto()->Fill(toc[*ki].
phi());
384 trigger::Vids::const_iterator idtypeiter = idtype.begin();
385 for (trigger::Keys::const_iterator l1ki = l1k.begin(); l1ki !=l1k.end(); ++l1ki ) {
393 v->getL1EtHisto()->Fill(toc[*l1ki].pt());
394 v->getL1PhiHisto()->Fill(toc[*l1ki].
phi());
416 triggertype =
v->getObjectType();
418 bool l1accept =
false;
420 const int l1index = triggerObj->filterIndex(l1testTag);
421 if ( l1index >= triggerObj->sizeFilters() ) {
422 if (
verbose_)
std::cout<<
"no index "<< l1index <<
" of that name (wrtMu)" <<
v->getl1Path() <<
"\t" <<
"\t" << l1testTag << std::endl;
430 l1accept = l1k.size() > 0;
435 bool denompassed =
false;
437 for(
unsigned int i = 0;
i < npath; ++
i) {
438 if ( triggerNames.triggerName(
i).find(
v->getPath()) != std::string::npos &&
triggerResults->accept(
i)){
439 passed =
true; break ;
442 for(
unsigned int i = 0;
i < npath; ++
i) {
443 if ( triggerNames.triggerName(
i).find(
v->getDenomPath()) != std::string::npos &&
triggerResults->accept(
i)){
444 denompassed =
true; break ;
450 <<
v->getDenomPath() << std::endl;
457 <<
v->getPath() << std::endl;
460 edm::LogInfo(
"HLTJetMETDQMSource") <<
"l1 seed path not accepted for hlt path "
461 <<
v->getPath() <<
"\t" <<
v->getl1Path();
465 if (
v->getLabel() ==
"dummy"){
469 for (std::vector<std::string>::const_iterator labelIter= filterLabels.begin(); labelIter!=filterLabels.end(); labelIter++) {
471 if (
verbose_)
std::cout <<
v->getPath() <<
"\t" << testTag.label() <<
"\t" << testTag.process() << std::endl;
473 int testindex = triggerObj->filterIndex(testTag);
475 if ( !(testindex >= triggerObj->sizeFilters()) ) {
476 if (
verbose_)
std::cout <<
"found one! " <<
v->getPath() <<
"\t" << testTag.label() << std::endl;
478 v->setLabel(*labelIter);
482 const int index = triggerObj->filterIndex(filterTag);
484 << filterTag << std::endl;
485 if ( index >= triggerObj->sizeFilters() ) {
487 << filterTag << std::endl;
492 for (trigger::Keys::const_iterator ki = k.begin(); ki !=k.end(); ++ki ) {
495 <<
"\t" << toc[*ki].pt() <<
"\t" << toc[*ki].eta()
496 <<
"\t" << toc[*ki].phi() << std::endl;
503 <<
"\t" <<
" *ki " << *ki <<
" Nki "<< N
504 <<
" " << toc[*ki].pt() <<
"\t" << toc[*ki].eta()
505 <<
"\t" << toc[*ki].phi() << std::endl;
506 v->getEtwrtMuHisto()->Fill(toc[*ki].pt());
509 v->getEtaPhiwrtMuHisto()->Fill(toc[*ki].
eta(), toc[*ki].
phi());
516 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;
517 v->getEtwrtMuHisto()->Fill(toc[*ki].pt());
520 v->getEtaPhiwrtMuHisto()->Fill(toc[*ki].
eta(), toc[*ki].
phi());
526 v->getEtwrtMuHisto()->Fill(toc[*ki].pt());
527 v->getPhiwrtMuHisto()->Fill(toc[*ki].
phi());
533 v->getEtwrtMuHisto()->Fill(toc[*ki].pt());
554 triggertype =
v->getObjectType();
556 bool l1accept =
false;
558 const int l1index = triggerObj->filterIndex(l1testTag);
559 if ( l1index >= triggerObj->sizeFilters() ) {
561 <<
v->getl1Path() <<
"\t" <<
"\t" << l1testTag << std::endl;
568 l1accept = l1k.size() > 0;
570 for(
unsigned int i = 0;
i < npath; ++
i) {
571 if ( triggerNames.triggerName(
i).find(
v->getPath()) != std::string::npos
578 bool denompassed =
false;
579 for(
unsigned int i = 0;
i < npath; ++
i) {
580 if ( triggerNames.triggerName(
i).find(
v->getDenomPath()) != std::string::npos
583 if (
verbose_)
std::cout <<
" i " <<
i <<
" trigger name " <<
v->getDenomPath() << std::endl;
590 if (
verbose_)
std::cout <<
" N " << N <<
" trigger name " <<
v->getDenomPath() << std::endl;
593 edm::LogInfo(
"HLTJetMETDQMSource") <<
"l1 seed path not accepted for hlt path "
594 <<
v->getPath() <<
"\t" <<
v->getl1Path();
598 if (
verbose_)
std::cout <<
v->getDenomPath() <<
"\t" <<
v->getDenomLabel() <<
"\t" << std::endl;
599 if (
v->getDenomLabel() ==
"denomdummy"){
602 for (std::vector<std::string>::const_iterator labelIter= filterLabels.begin(); labelIter!=filterLabels.end(); labelIter++) {
605 << testTag.process() << std::endl;
606 int testindex = triggerObj->filterIndex(testTag);
607 if ( !(testindex >= triggerObj->sizeFilters()) ) {
609 << testTag.label() << std::endl;
611 v->setDenomLabel(*labelIter);
615 const int index = triggerObj->filterIndex(filterTag);
617 << filterTag << std::endl;
618 if ( index >= triggerObj->sizeFilters() ) {
620 << filterTag << std::endl;
625 for (trigger::Keys::const_iterator ki = k.begin(); ki !=k.end(); ++ki ) {
626 if (
verbose_)
cout <<
" filling HLT Denom " <<
v->getDenomPath() <<
"\t"
627 << toc[*ki].pt() <<
"\t" << toc[*ki].eta() <<
"\t"
628 << toc[*ki].phi() << std::endl;
634 if (
verbose_)
cout <<
" filling HLT Denom" <<
v->getDenomPath()
635 <<
"\t" <<
" *kiDeno " << *ki <<
" NkiDenom "
636 << Ndenom<<
" " << toc[*ki].pt() <<
"\t"
637 << toc[*ki].eta() <<
"\t" << toc[*ki].phi() << std::endl;
640 v->getEtDenomHisto()->Fill(toc[*ki].pt());
641 v->getEtaDenomHisto()->Fill(toc[*ki].
eta());
642 v->getPhiDenomHisto()->Fill(toc[*ki].
phi());
648 v->getEtDenomHisto()->Fill(toc[*ki].pt());
649 v->getPhiDenomHisto()->Fill(toc[*ki].
phi());
654 v->getEtDenomHisto()->Fill(toc[*ki].pt());
655 v->getPhiDenomHisto()->Fill(toc[*ki].
phi());
657 if ( numobj != -1)
break;
665 if (
verbose_)
std::cout <<
" N " << N <<
" trigger name " <<
v->getPath() << std::endl;
667 edm::LogInfo(
"HLTJetMETDQMSource") <<
"l1 seed path not accepted for hlt path "<<
v->getPath() <<
"\t" <<
v->getl1Path();
672 if (
v->getLabel() ==
"dummy"){
675 for (std::vector<std::string>::const_iterator labelIter= filterLabels.begin(); labelIter!=filterLabels.end(); labelIter++) {
678 << testTag.process() << std::endl;
679 int testindex = triggerObj->filterIndex(testTag);
680 if ( !(testindex >= triggerObj->sizeFilters()) ) {
682 << testTag.label() << std::endl;
684 v->setLabel(*labelIter);
688 const int index = triggerObj->filterIndex(filterTag);
690 << filterTag << std::endl;
691 if ( index >= triggerObj->sizeFilters() ) {
693 << filterTag << std::endl;
698 for (trigger::Keys::const_iterator ki = k.begin(); ki !=k.end(); ++ki ) {
700 if (
verbose_)
cout <<
" filling HLT " <<
v->getPath() <<
"\t"
701 << toc[*ki].pt() <<
"\t" << toc[*ki].eta()
702 <<
"\t" << toc[*ki].phi() << std::endl;
708 if (
verbose_)
cout <<
" filling HLT " <<
v->getPath() <<
"\t"
709 <<
" *ki " << *ki <<
" Nki "<< N<<
" "
710 << toc[*ki].pt() <<
"\t" << toc[*ki].eta()
711 <<
"\t" << toc[*ki].phi() << std::endl;
713 v->getEtNumHisto()->Fill(toc[*ki].pt());
714 v->getEtaNumHisto()->Fill(toc[*ki].
eta());
715 v->getPhiNumHisto()->Fill(toc[*ki].
phi());
721 v->getEtNumHisto()->Fill(toc[*ki].pt());
722 v->getPhiNumHisto()->Fill(toc[*ki].
phi());
727 v->getEtNumHisto()->Fill(toc[*ki].pt());
728 v->getPhiNumHisto()->Fill(toc[*ki].
phi());
730 if ( numobj != -1)
break;
736 if ( (
nev_ % 1000) == 0 ){
742 TH1F *rate_denom=
NULL;
747 if ((rate_denom->Integral() != 0.) && (rate_num->Integral() != 0.) ) {
749 for(
int j=1;
j <= rate_denom->GetXaxis()->GetNbins();
j++ ){
750 double y1 = rate_num->GetBinContent(
j);
751 double y2 = rate_denom->GetBinContent(
j);
752 double eff = y2 > 0. ? y1/y2 : 0.;
754 double y1err = rate_num->GetBinError(
j);
755 double y2err = rate_denom->GetBinError(
j);
758 if (y2 && y1 > 0.) efferr = (y1/y2)*
sqrt ((y1err/y1)*(y1err/y1)
759 + (y2err/y2)*(y2err/y2)) ;
765 triggertype =
v->getObjectType();
780 EtNum= (
v->getEtNumHisto())->
getTH1F() ;
781 EtaNum= (
v->getEtaNumHisto())->
getTH1F() ;
782 PhiNum= (
v->getPhiNumHisto())->
getTH1F() ;
783 EtDenom= (
v->getEtDenomHisto())->
getTH1F() ;
784 EtaDenom= (
v->getEtaDenomHisto())->
getTH1F() ;
785 PhiDenom= (
v->getPhiDenomHisto())->
getTH1F() ;
787 if ((EtNum->Integral() != 0.) && (EtDenom->Integral() != 0.) ) {
789 for(
int j=1;
j <= EtNum->GetXaxis()->GetNbins();
j++ ){
790 double y1 = EtNum->GetBinContent(
j);
791 double y2 = EtDenom->GetBinContent(
j);
792 double eff = y2 > 0. ? y1/y2 : 0.;
794 v->getEtEffHisto()->setBinContent(
j, eff);
795 double y1err = EtNum->GetBinError(
j);
796 double y2err = EtDenom->GetBinError(
j);
799 if (y2 && y1 > 0.) efferr = (y1/y2)*
sqrt ((y1err/y1)*(y1err/y1)
800 + (y2err/y2)*(y2err/y2)) ;
801 v->getEtEffHisto()->setBinError(
j, efferr);
804 << y1 <<
" " << y2 <<
" "<< y1err <<
" " << y2err << std::endl;
808 if (EtaNum->Integral() != 0. && EtaDenom->Integral() != 0. ) {
809 for(
int j=1;
j <= EtaNum->GetXaxis()->GetNbins();
j++ ){
810 double y1 = EtaNum->GetBinContent(
j);
811 double y2 = EtaDenom->GetBinContent(
j);
812 double eff = y2 > 0. ? y1/y2 : 0.;
813 v->getEtaEffHisto()->setBinContent(
j, eff);
814 double y1err = EtaNum->GetBinError(
j);
815 double y2err = EtaDenom->GetBinError(
j);
818 if (y2 && y1 > 0.) efferr = (y1/y2)*
sqrt ((y1err/y1)*(y1err/y1)
819 + (y2err/y2)*(y2err/y2)) ;
820 v->getEtaEffHisto()->setBinError(
j, efferr);
824 if (PhiNum->Integral() != 0. && PhiDenom->Integral() != 0. ) {
825 for(
int j=1;
j <= PhiNum->GetXaxis()->GetNbins();
j++ ){
826 double y1 = PhiNum->GetBinContent(
j);
827 double y2 = PhiDenom->GetBinContent(
j);
828 double eff = y2 > 0. ? y1/y2 : 0.;
829 v->getPhiEffHisto()->setBinContent(
j, eff);
830 double y1err = PhiNum->GetBinError(
j);
831 double y2err = PhiDenom->GetBinError(
j);
833 if (y2 && y1 > 0.) efferr = (y1/y2)*
sqrt ((y1err/y1)*(y1err/y1)
834 + (y2err/y2)*(y2err/y2)) ;
835 v->getPhiEffHisto()->setBinError(
j, efferr);
846 EtNum= (
v->getEtNumHisto())->
getTH1F() ;
847 PhiNum= (
v->getPhiNumHisto())->
getTH1F() ;
848 EtDenom= (
v->getEtDenomHisto())->
getTH1F() ;
849 PhiDenom= (
v->getPhiDenomHisto())->
getTH1F() ;
851 if (EtNum->Integral() != 0. && EtDenom->Integral() != 0. ) {
853 for(
int j=1;
j <= EtNum->GetXaxis()->GetNbins();
j++ ){
854 double y1 = EtNum->GetBinContent(
j);
855 double y2 = EtDenom->GetBinContent(
j);
856 double eff = y2 > 0. ? y1/y2 : 0.;
857 v->getEtEffHisto()->setBinContent(
j, eff);
858 double y1err = EtNum->GetBinError(
j);
859 double y2err = EtDenom->GetBinError(
j);
862 if (y2 && y1 > 0.) efferr = (y1/y2)*
sqrt ((y1err/y1)*(y1err/y1)
863 + (y2err/y2)*(y2err/y2)) ;
864 v->getEtEffHisto()->setBinError(
j, efferr);
867 if (PhiNum->Integral() != 0. && PhiDenom->Integral() != 0. ) {
869 for(
int j=1;
j <= PhiNum->GetXaxis()->GetNbins();
j++ ){
870 double y1 = PhiNum->GetBinContent(
j);
871 double y2 = PhiDenom->GetBinContent(
j);
872 double eff = y2 > 0. ? y1/y2 : 0.;
873 v->getPhiEffHisto()->setBinContent(
j, eff);
874 double y1err = PhiNum->GetBinError(
j);
875 double y2err = PhiDenom->GetBinError(
j);
878 if (y2 && y1 > 0.) efferr = (y1/y2)*
sqrt ((y1err/y1)*(y1err/y1)
879 + (y2err/y2)*(y2err/y2)) ;
880 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)
edm::InputTag triggerSummaryLabel_
edm::InputTag triggerResultsLabel_
enum start value shifted to 81 so as to avoid clashes with PDG codes
PathInfoCollection hltPathsAll_
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_