124 using namespace trigger;
161 LogWarning(
"HLTJetMETDQMSource") <<
"TriggerResults not found, skipping event" << std::endl;
170 if(!triggerObj.isValid()) {
172 if(!triggerObj.isValid()) {
173 LogWarning(
"HLTJetMETDQMSource") <<
"TriggerEvent not found, skipping event" << std::endl;
198 triggertype =
v->getObjectType();
200 bool l1accept =
false;
202 const int l1index = triggerObj->filterIndex(l1testTag);
203 if ( l1index >= triggerObj->sizeFilters() ) {
205 <<
v->getl1Path() <<
"\t" <<
"\t" << l1testTag << std::endl;
209 const trigger::Vids & idtype = triggerObj->filterIds(l1index);
213 l1accept = l1k.size() > 0;
221 for(
unsigned int i = 0;
i < npath; ++
i) {
222 if ( triggerNames.triggerName(
i).find(
v->getPath()) != std::string::npos
234 if (
verbose_)
std::cout <<
" N " << N <<
" trigger name " <<
v->getPath() << std::endl;
237 edm::LogInfo(
"HLTJetMETDQMSource") <<
"l1 seed path not accepted for hlt path "
238 <<
v->getPath() <<
"\t" <<
v->getl1Path();
244 if (
v->getLabel() ==
"dummy"){
248 for (std::vector<std::string>::const_iterator labelIter= filterLabels.begin();
249 labelIter!=filterLabels.end(); labelIter++) {
252 << testTag.process() << std::endl;
253 int testindex = triggerObj->filterIndex(testTag);
255 if ( !(testindex >= triggerObj->sizeFilters()) ) {
257 << testTag.label() << std::endl;
259 v->setLabel(*labelIter);
263 const int index = triggerObj->filterIndex(filterTag);
265 << filterTag << std::endl;
266 if ( index >= triggerObj->sizeFilters() ) {
268 << filterTag << std::endl;
273 for (trigger::Keys::const_iterator ki = k.begin(); ki !=k.end(); ++ki ) {
274 if (
verbose_)
cout <<
" filling HLT " <<
v->getPath() <<
"\t" << toc[*ki].pt()
275 <<
"\t" << toc[*ki].eta() <<
"\t" << toc[*ki].phi() << std::endl;
281 if (
verbose_)
cout <<
" filling HLT " <<
v->getPath() <<
"\t"
282 <<
" *ki " << *ki <<
" Nki "<< N<<
" "
283 << toc[*ki].pt() <<
"\t" << toc[*ki].eta() <<
"\t"
284 << toc[*ki].phi() << std::endl;
286 v->getEtHisto()->Fill(toc[*ki].
pt());
287 v->getEtaHisto()->Fill(toc[*ki].
eta());
288 v->getPhiHisto()->Fill(toc[*ki].
phi());
289 v->getEtaPhiHisto()->Fill(toc[*ki].
eta(), toc[*ki].
phi());
292 trigger::Vids::const_iterator idtypeiter = idtype.begin();
293 for (trigger::Keys::const_iterator l1ki = l1k.begin();
294 l1ki !=l1k.end(); ++l1ki ) {
300 <<
"\t" <<
" *l1ki " << *l1ki <<
" NL1 "
301 << NL1<<
" " << toc[*l1ki].pt() <<
"\t"
302 << toc[*l1ki].eta() <<
"\t" << toc[*l1ki].phi()
308 v->getL1EtHisto()->Fill(toc[*l1ki].
pt());
309 v->getL1PhiHisto()->Fill(toc[*l1ki].
phi());
310 v->getL1EtaHisto()->Fill(toc[*l1ki].
eta());
311 v->getL1EtaPhiHisto()->Fill(toc[*l1ki].
eta(),toc[*l1ki].
phi());
325 if (
verbose_)
cout <<
" filling HLT " <<
v->getPath() <<
"\t" <<
" *ki "
326 << *ki <<
" Nki "<< N <<
" " << toc[*ki].pt()
327 <<
"\t" << toc[*ki].eta() <<
"\t" << toc[*ki].phi() << std::endl;
329 v->getEtHisto()->Fill(toc[*ki].
pt());
332 v->getEtaPhiHisto()->Fill(toc[*ki].
eta(), toc[*ki].
phi());
335 trigger::Vids::const_iterator idtypeiter = idtype.begin();
336 for (trigger::Keys::const_iterator l1ki = l1k.begin(); l1ki !=l1k.end(); ++l1ki ) {
344 v->getL1EtHisto()->Fill(toc[*l1ki].
pt());
347 v->getL1EtaPhiHisto()->Fill(toc[*l1ki].
eta(),toc[*l1ki].
phi());
360 v->getEtHisto()->Fill(toc[*ki].
pt());
361 v->getPhiHisto()->Fill(toc[*ki].
phi());
364 trigger::Vids::const_iterator idtypeiter = idtype.begin();
365 for (trigger::Keys::const_iterator l1ki = l1k.begin(); l1ki !=l1k.end(); ++l1ki ) {
372 v->getL1EtHisto()->Fill(toc[*l1ki].
pt());
373 v->getL1PhiHisto()->Fill(toc[*l1ki].
phi());
384 v->getEtHisto()->Fill(toc[*ki].
pt());
385 v->getPhiHisto()->Fill(toc[*ki].
phi());
387 trigger::Vids::const_iterator idtypeiter = idtype.begin();
388 for (trigger::Keys::const_iterator l1ki = l1k.begin(); l1ki !=l1k.end(); ++l1ki ) {
396 v->getL1EtHisto()->Fill(toc[*l1ki].
pt());
397 v->getL1PhiHisto()->Fill(toc[*l1ki].
phi());
419 triggertype =
v->getObjectType();
421 bool l1accept =
false;
423 const int l1index = triggerObj->filterIndex(l1testTag);
424 if ( l1index >= triggerObj->sizeFilters() ) {
425 if (
verbose_)
std::cout<<
"no index "<< l1index <<
" of that name (wrtMu)" <<
v->getl1Path() <<
"\t" <<
"\t" << l1testTag << std::endl;
433 l1accept = l1k.size() > 0;
438 bool denompassed =
false;
440 for(
unsigned int i = 0;
i < npath; ++
i) {
441 if ( triggerNames.triggerName(
i).find(
v->getPath()) != std::string::npos &&
triggerResults->accept(
i)){
442 passed =
true; break ;
445 for(
unsigned int i = 0;
i < npath; ++
i) {
446 if ( triggerNames.triggerName(
i).find(
v->getDenomPath()) != std::string::npos &&
triggerResults->accept(
i)){
447 denompassed =
true; break ;
453 <<
v->getDenomPath() << std::endl;
460 <<
v->getPath() << std::endl;
463 edm::LogInfo(
"HLTJetMETDQMSource") <<
"l1 seed path not accepted for hlt path "
464 <<
v->getPath() <<
"\t" <<
v->getl1Path();
468 if (
v->getLabel() ==
"dummy"){
472 for (std::vector<std::string>::const_iterator labelIter= filterLabels.begin(); labelIter!=filterLabels.end(); labelIter++) {
474 if (
verbose_)
std::cout <<
v->getPath() <<
"\t" << testTag.label() <<
"\t" << testTag.process() << std::endl;
476 int testindex = triggerObj->filterIndex(testTag);
478 if ( !(testindex >= triggerObj->sizeFilters()) ) {
479 if (
verbose_)
std::cout <<
"found one! " <<
v->getPath() <<
"\t" << testTag.label() << std::endl;
481 v->setLabel(*labelIter);
485 const int index = triggerObj->filterIndex(filterTag);
487 << filterTag << std::endl;
488 if ( index >= triggerObj->sizeFilters() ) {
490 << filterTag << std::endl;
495 for (trigger::Keys::const_iterator ki = k.begin(); ki !=k.end(); ++ki ) {
498 <<
"\t" << toc[*ki].pt() <<
"\t" << toc[*ki].eta()
499 <<
"\t" << toc[*ki].phi() << std::endl;
506 <<
"\t" <<
" *ki " << *ki <<
" Nki "<< N
507 <<
" " << toc[*ki].pt() <<
"\t" << toc[*ki].eta()
508 <<
"\t" << toc[*ki].phi() << std::endl;
509 v->getEtwrtMuHisto()->Fill(toc[*ki].
pt());
512 v->getEtaPhiwrtMuHisto()->Fill(toc[*ki].
eta(), toc[*ki].
phi());
519 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;
520 v->getEtwrtMuHisto()->Fill(toc[*ki].
pt());
523 v->getEtaPhiwrtMuHisto()->Fill(toc[*ki].
eta(), toc[*ki].
phi());
529 v->getEtwrtMuHisto()->Fill(toc[*ki].
pt());
530 v->getPhiwrtMuHisto()->Fill(toc[*ki].
phi());
536 v->getEtwrtMuHisto()->Fill(toc[*ki].
pt());
557 triggertype =
v->getObjectType();
559 bool l1accept =
false;
561 const int l1index = triggerObj->filterIndex(l1testTag);
562 if ( l1index >= triggerObj->sizeFilters() ) {
564 <<
v->getl1Path() <<
"\t" <<
"\t" << l1testTag << std::endl;
571 l1accept = l1k.size() > 0;
573 for(
unsigned int i = 0;
i < npath; ++
i) {
574 if ( triggerNames.triggerName(
i).find(
v->getPath()) != std::string::npos
581 bool denompassed =
false;
582 for(
unsigned int i = 0;
i < npath; ++
i) {
583 if ( triggerNames.triggerName(
i).find(
v->getDenomPath()) != std::string::npos
586 if (
verbose_)
std::cout <<
" i " <<
i <<
" trigger name " <<
v->getDenomPath() << std::endl;
593 if (
verbose_)
std::cout <<
" N " << N <<
" trigger name " <<
v->getDenomPath() << std::endl;
596 edm::LogInfo(
"HLTJetMETDQMSource") <<
"l1 seed path not accepted for hlt path "
597 <<
v->getPath() <<
"\t" <<
v->getl1Path();
601 if (
verbose_)
std::cout <<
v->getDenomPath() <<
"\t" <<
v->getDenomLabel() <<
"\t" << std::endl;
602 if (
v->getDenomLabel() ==
"denomdummy"){
605 for (std::vector<std::string>::const_iterator labelIter= filterLabels.begin(); labelIter!=filterLabels.end(); labelIter++) {
608 << testTag.process() << std::endl;
609 int testindex = triggerObj->filterIndex(testTag);
610 if ( !(testindex >= triggerObj->sizeFilters()) ) {
612 << testTag.label() << std::endl;
614 v->setDenomLabel(*labelIter);
618 const int index = triggerObj->filterIndex(filterTag);
620 << filterTag << std::endl;
621 if ( index >= triggerObj->sizeFilters() ) {
623 << filterTag << std::endl;
628 for (trigger::Keys::const_iterator ki = k.begin(); ki !=k.end(); ++ki ) {
629 if (
verbose_)
cout <<
" filling HLT Denom " <<
v->getDenomPath() <<
"\t"
630 << toc[*ki].pt() <<
"\t" << toc[*ki].eta() <<
"\t"
631 << toc[*ki].phi() << std::endl;
637 if (
verbose_)
cout <<
" filling HLT Denom" <<
v->getDenomPath()
638 <<
"\t" <<
" *kiDeno " << *ki <<
" NkiDenom "
639 << Ndenom<<
" " << toc[*ki].pt() <<
"\t"
640 << toc[*ki].eta() <<
"\t" << toc[*ki].phi() << std::endl;
643 v->getEtDenomHisto()->Fill(toc[*ki].
pt());
644 v->getEtaDenomHisto()->Fill(toc[*ki].
eta());
645 v->getPhiDenomHisto()->Fill(toc[*ki].
phi());
651 v->getEtDenomHisto()->Fill(toc[*ki].
pt());
652 v->getPhiDenomHisto()->Fill(toc[*ki].
phi());
657 v->getEtDenomHisto()->Fill(toc[*ki].
pt());
658 v->getPhiDenomHisto()->Fill(toc[*ki].
phi());
660 if ( numobj != -1)
break;
668 if (
verbose_)
std::cout <<
" N " << N <<
" trigger name " <<
v->getPath() << std::endl;
670 edm::LogInfo(
"HLTJetMETDQMSource") <<
"l1 seed path not accepted for hlt path "<<
v->getPath() <<
"\t" <<
v->getl1Path();
675 if (
v->getLabel() ==
"dummy"){
678 for (std::vector<std::string>::const_iterator labelIter= filterLabels.begin(); labelIter!=filterLabels.end(); labelIter++) {
681 << testTag.process() << std::endl;
682 int testindex = triggerObj->filterIndex(testTag);
683 if ( !(testindex >= triggerObj->sizeFilters()) ) {
685 << testTag.label() << std::endl;
687 v->setLabel(*labelIter);
691 const int index = triggerObj->filterIndex(filterTag);
693 << filterTag << std::endl;
694 if ( index >= triggerObj->sizeFilters() ) {
696 << filterTag << std::endl;
701 for (trigger::Keys::const_iterator ki = k.begin(); ki !=k.end(); ++ki ) {
703 if (
verbose_)
cout <<
" filling HLT " <<
v->getPath() <<
"\t"
704 << toc[*ki].pt() <<
"\t" << toc[*ki].eta()
705 <<
"\t" << toc[*ki].phi() << std::endl;
711 if (
verbose_)
cout <<
" filling HLT " <<
v->getPath() <<
"\t"
712 <<
" *ki " << *ki <<
" Nki "<< N<<
" "
713 << toc[*ki].pt() <<
"\t" << toc[*ki].eta()
714 <<
"\t" << toc[*ki].phi() << std::endl;
716 v->getEtNumHisto()->Fill(toc[*ki].
pt());
717 v->getEtaNumHisto()->Fill(toc[*ki].
eta());
718 v->getPhiNumHisto()->Fill(toc[*ki].
phi());
724 v->getEtNumHisto()->Fill(toc[*ki].
pt());
725 v->getPhiNumHisto()->Fill(toc[*ki].
phi());
730 v->getEtNumHisto()->Fill(toc[*ki].
pt());
731 v->getPhiNumHisto()->Fill(toc[*ki].
phi());
733 if ( numobj != -1)
break;
739 if ( (
nev_ % 1000) == 0 ){
745 TH1F *rate_denom=
NULL;
750 if ((rate_denom->Integral() != 0.) && (rate_num->Integral() != 0.) ) {
752 for(
int j=1;
j <= rate_denom->GetXaxis()->GetNbins();
j++ ){
753 double y1 = rate_num->GetBinContent(
j);
754 double y2 = rate_denom->GetBinContent(
j);
755 double eff = y2 > 0. ? y1/y2 : 0.;
757 double y1err = rate_num->GetBinError(
j);
758 double y2err = rate_denom->GetBinError(
j);
761 if (y2 && y1 > 0.) efferr = (y1/y2)*
sqrt ((y1err/y1)*(y1err/y1)
762 + (y2err/y2)*(y2err/y2)) ;
768 triggertype =
v->getObjectType();
783 EtNum= (
v->getEtNumHisto())->
getTH1F() ;
784 EtaNum= (
v->getEtaNumHisto())->
getTH1F() ;
785 PhiNum= (
v->getPhiNumHisto())->
getTH1F() ;
786 EtDenom= (
v->getEtDenomHisto())->
getTH1F() ;
787 EtaDenom= (
v->getEtaDenomHisto())->
getTH1F() ;
788 PhiDenom= (
v->getPhiDenomHisto())->
getTH1F() ;
790 if ((EtNum->Integral() != 0.) && (EtDenom->Integral() != 0.) ) {
792 for(
int j=1;
j <= EtNum->GetXaxis()->GetNbins();
j++ ){
793 double y1 = EtNum->GetBinContent(
j);
794 double y2 = EtDenom->GetBinContent(
j);
795 double eff = y2 > 0. ? y1/y2 : 0.;
797 v->getEtEffHisto()->setBinContent(
j, eff);
798 double y1err = EtNum->GetBinError(
j);
799 double y2err = EtDenom->GetBinError(
j);
802 if (y2 && y1 > 0.) efferr = (y1/y2)*
sqrt ((y1err/y1)*(y1err/y1)
803 + (y2err/y2)*(y2err/y2)) ;
804 v->getEtEffHisto()->setBinError(
j, efferr);
807 << y1 <<
" " << y2 <<
" "<< y1err <<
" " << y2err << std::endl;
811 if (EtaNum->Integral() != 0. && EtaDenom->Integral() != 0. ) {
812 for(
int j=1;
j <= EtaNum->GetXaxis()->GetNbins();
j++ ){
813 double y1 = EtaNum->GetBinContent(
j);
814 double y2 = EtaDenom->GetBinContent(
j);
815 double eff = y2 > 0. ? y1/y2 : 0.;
816 v->getEtaEffHisto()->setBinContent(
j, eff);
817 double y1err = EtaNum->GetBinError(
j);
818 double y2err = EtaDenom->GetBinError(
j);
821 if (y2 && y1 > 0.) efferr = (y1/y2)*
sqrt ((y1err/y1)*(y1err/y1)
822 + (y2err/y2)*(y2err/y2)) ;
823 v->getEtaEffHisto()->setBinError(
j, efferr);
827 if (PhiNum->Integral() != 0. && PhiDenom->Integral() != 0. ) {
828 for(
int j=1;
j <= PhiNum->GetXaxis()->GetNbins();
j++ ){
829 double y1 = PhiNum->GetBinContent(
j);
830 double y2 = PhiDenom->GetBinContent(
j);
831 double eff = y2 > 0. ? y1/y2 : 0.;
832 v->getPhiEffHisto()->setBinContent(
j, eff);
833 double y1err = PhiNum->GetBinError(
j);
834 double y2err = PhiDenom->GetBinError(
j);
836 if (y2 && y1 > 0.) efferr = (y1/y2)*
sqrt ((y1err/y1)*(y1err/y1)
837 + (y2err/y2)*(y2err/y2)) ;
838 v->getPhiEffHisto()->setBinError(
j, efferr);
849 EtNum= (
v->getEtNumHisto())->
getTH1F() ;
850 PhiNum= (
v->getPhiNumHisto())->
getTH1F() ;
851 EtDenom= (
v->getEtDenomHisto())->
getTH1F() ;
852 PhiDenom= (
v->getPhiDenomHisto())->
getTH1F() ;
854 if (EtNum->Integral() != 0. && EtDenom->Integral() != 0. ) {
856 for(
int j=1;
j <= EtNum->GetXaxis()->GetNbins();
j++ ){
857 double y1 = EtNum->GetBinContent(
j);
858 double y2 = EtDenom->GetBinContent(
j);
859 double eff = y2 > 0. ? y1/y2 : 0.;
860 v->getEtEffHisto()->setBinContent(
j, eff);
861 double y1err = EtNum->GetBinError(
j);
862 double y2err = EtDenom->GetBinError(
j);
865 if (y2 && y1 > 0.) efferr = (y1/y2)*
sqrt ((y1err/y1)*(y1err/y1)
866 + (y2err/y2)*(y2err/y2)) ;
867 v->getEtEffHisto()->setBinError(
j, efferr);
870 if (PhiNum->Integral() != 0. && PhiDenom->Integral() != 0. ) {
872 for(
int j=1;
j <= PhiNum->GetXaxis()->GetNbins();
j++ ){
873 double y1 = PhiNum->GetBinContent(
j);
874 double y2 = PhiDenom->GetBinContent(
j);
875 double eff = y2 > 0. ? y1/y2 : 0.;
876 v->getPhiEffHisto()->setBinContent(
j, eff);
877 double y1err = PhiNum->GetBinError(
j);
878 double y2err = PhiDenom->GetBinError(
j);
881 if (y2 && y1 > 0.) efferr = (y1/y2)*
sqrt ((y1err/y1)*(y1err/y1)
882 + (y2err/y2)*(y2err/y2)) ;
883 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::EDGetTokenT< trigger::TriggerEvent > triggerSummaryToken_
edm::EDGetTokenT< edm::TriggerResults > triggerResultsTokenFU_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
enum start value shifted to 81 so as to avoid clashes with PDG codes
PathInfoCollection hltPathsAll_
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
HLTConfigProvider hltConfig_
MonitorElement * rate_Denom
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
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)
static std::string const triggerResults
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
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryTokenFU_
TH1F * getTH1F(void) const
MonitorElement * rate_Eff
MonitorElement * rate_Num
PathInfoCollection hltPathsEff_