New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add HLT filter to select online pf taus based on their impact parameter #36666
Conversation
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36666/27707
Code check has found code style and quality issues which could be resolved by applying following patch(s)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the first round of comments: mostly small technical changes, plus some questions.
"Code-checks" failed, and this needs to be fixed. Please remember to run scram b code-checks ; scram b code-format
, and commit the suggested changes, before pushing updates to the branch.
edm::InputTag m_Taus; // module label of input TauCollection | ||
edm::EDGetTokenT<std::vector<reco::PFTau>> m_TausToken; | ||
edm::InputTag m_TausIP; // module label of input TauIPCollection | ||
edm::EDGetTokenT<edm::AssociationVector<reco::PFTauRefProd,std::vector<reco::PFTauTransverseImpactParameterRef>>> m_TausIPToken; | ||
|
||
double m_MinDxy, m_MaxDxy; // dxy cuts applied to each tau | ||
int m_MinTaus; // min. number of taus required to pass the cuts | ||
int m_TriggerType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
edm::InputTag m_Taus; // module label of input TauCollection | |
edm::EDGetTokenT<std::vector<reco::PFTau>> m_TausToken; | |
edm::InputTag m_TausIP; // module label of input TauIPCollection | |
edm::EDGetTokenT<edm::AssociationVector<reco::PFTauRefProd,std::vector<reco::PFTauTransverseImpactParameterRef>>> m_TausIPToken; | |
double m_MinDxy, m_MaxDxy; // dxy cuts applied to each tau | |
int m_MinTaus; // min. number of taus required to pass the cuts | |
int m_TriggerType; | |
const edm::InputTag m_TausInputTag; // module label of input TauCollection | |
const edm::EDGetTokenT<reco::PFTauCollection> m_TausToken; | |
const edm::EDGetTokenT<edm::AssociationVector<reco::PFTauRefProd,std::vector<reco::PFTauTransverseImpactParameterRef>>> m_TausIPToken; | |
const double m_MinDxy, m_MaxDxy; // dxy cuts applied to each tau | |
const int m_MinTaus; // min. number of taus required to pass the cuts | |
const int m_TriggerType; |
HLTrigger/btau/plugins/modules.cc
Outdated
#include "HLTTauDxyFilter.h" | ||
DEFINE_FWK_MODULE(HLTTauDxyFilter); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include "HLTTauDxyFilter.h" | |
DEFINE_FWK_MODULE(HLTTauDxyFilter); |
If the header file is not necessary (for example, like for a non-templated plugin like this one), the preferred convention in CMSSW is to have only one single file ([FilterName].cc
), which contains both the definition (the .h part), and the implementation part (the .cc part), plus the DEFINE_FWK_MODULE
call. It's true that this convention is not followed for all the filters in this package, but I would prefer to stick to the current convention.
#include "FWCore/Framework/interface/Frameworkfwd.h" | ||
#include "FWCore/Utilities/interface/InputTag.h" | ||
#include "HLTrigger/HLTcore/interface/HLTFilter.h" | ||
#include "DataFormats/TauReco/interface/PFTau.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include "DataFormats/TauReco/interface/PFTau.h" | |
#include "DataFormats/TauReco/interface/PFTau.h" | |
#include "DataFormats/TauReco/interface/PFTauFwd.h" |
using namespace edm; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using namespace edm; |
#include <string> | ||
|
||
#include "FWCore/MessageLogger/interface/MessageLogger.h" | ||
#include "DataFormats/Common/interface/Handle.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include "DataFormats/Common/interface/Handle.h" |
#include "HLTrigger/HLTcore/interface/defaultModuleLabel.h" | ||
|
||
|
||
// | ||
// constructors and destructor | ||
// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include "HLTrigger/HLTcore/interface/defaultModuleLabel.h" | |
// | |
// constructors and destructor | |
// |
} | ||
|
||
|
||
// ------------ method called to produce the data ------------ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// ------------ method called to produce the data ------------ |
namespace edm { | ||
class ConfigurationDescriptions; | ||
} | ||
|
||
// | ||
// class declaration | ||
// | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
namespace edm { | |
class ConfigurationDescriptions; | |
} | |
// | |
// class declaration | |
// |
m_Taus(config.getParameter<edm::InputTag>("Taus")), | ||
m_TausIP(config.getParameter<edm::InputTag>("TausIP")), | ||
m_MinDxy(config.getParameter<double>("MinDxy")), | ||
m_MaxDxy(config.getParameter<double>("MaxDxy")), | ||
m_MinTaus(config.getParameter<int>("MinN")), | ||
m_TriggerType(config.getParameter<int>("TriggerType")) { | ||
m_TausToken = consumes<std::vector<reco::PFTau>>(m_Taus), | ||
m_TausIPToken = consumes<edm::AssociationVector<reco::PFTauRefProd,std::vector<reco::PFTauTransverseImpactParameterRef>>>(m_TausIP), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m_Taus(config.getParameter<edm::InputTag>("Taus")), | |
m_TausIP(config.getParameter<edm::InputTag>("TausIP")), | |
m_MinDxy(config.getParameter<double>("MinDxy")), | |
m_MaxDxy(config.getParameter<double>("MaxDxy")), | |
m_MinTaus(config.getParameter<int>("MinN")), | |
m_TriggerType(config.getParameter<int>("TriggerType")) { | |
m_TausToken = consumes<std::vector<reco::PFTau>>(m_Taus), | |
m_TausIPToken = consumes<edm::AssociationVector<reco::PFTauRefProd,std::vector<reco::PFTauTransverseImpactParameterRef>>>(m_TausIP), | |
m_TausInputTag(config.getParameter<edm::InputTag>("Taus")), | |
m_TausToken(consumes(m_TausInputTag)), | |
m_TausIPToken(consumes(config.getParameter<edm::InputTag>("TausIP"))), | |
m_MinDxy(config.getParameter<double>("MinDxy")), | |
m_MaxDxy(config.getParameter<double>("MaxDxy")), | |
m_MinTaus(config.getParameter<int>("MinN")), | |
m_TriggerType(config.getParameter<int>("TriggerType")) { |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36666/27709
|
A new Pull Request was created by @sarafiorendi for master. It involves the following packages:
@cmsbuild, @missirol, @Martin-Grunewald can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36666/27711 ERROR: Build errors found during clang-tidy run.
|
Hi @missirol, |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36666/27712 |
Pull request #36666 was updated. @cmsbuild, @missirol, @Martin-Grunewald can you please check and sign again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sarafiorendi , I will wait for you to check that.
One more suggestion below to adjust the #include
statements.
#include "FWCore/MessageLogger/interface/MessageLogger.h" | ||
#include "DataFormats/Common/interface/RefToBase.h" | ||
#include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h" | ||
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include "FWCore/MessageLogger/interface/MessageLogger.h" | |
#include "DataFormats/Common/interface/RefToBase.h" | |
#include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h" | |
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" | |
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" |
Please move these header files upstairs with the other ones. I'm not sure RefToBase.h
is needed, I would try to remove it.
return accept; | ||
} | ||
|
||
#include "FWCore/Framework/interface/MakerMacros.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include "FWCore/Framework/interface/MakerMacros.h" |
This one can also go upstairs.
#include "FWCore/Framework/interface/Frameworkfwd.h" | ||
#include "FWCore/Utilities/interface/InputTag.h" | ||
#include "HLTrigger/HLTcore/interface/HLTFilter.h" | ||
#include "DataFormats/TauReco/interface/PFTau.h" | ||
#include "DataFormats/TauReco/interface/PFTauFwd.h" | ||
#include "DataFormats/TauReco/interface/PFTauTransverseImpactParameterAssociation.h" | ||
|
||
#include <vector> | ||
#include <string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include "FWCore/Framework/interface/Frameworkfwd.h" | |
#include "FWCore/Utilities/interface/InputTag.h" | |
#include "HLTrigger/HLTcore/interface/HLTFilter.h" | |
#include "DataFormats/TauReco/interface/PFTau.h" | |
#include "DataFormats/TauReco/interface/PFTauFwd.h" | |
#include "DataFormats/TauReco/interface/PFTauTransverseImpactParameterAssociation.h" | |
#include <vector> | |
#include <string> | |
#include "FWCore/Framework/interface/Frameworkfwd.h" | |
#include "FWCore/Framework/interface/MakerMacros.h" | |
#include "FWCore/MessageLogger/interface/MessageLogger.h" | |
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" | |
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" | |
#include "FWCore/Utilities/interface/InputTag.h" | |
#include "FWCore/Utilities/interface/EDGetToken.h" | |
#include "DataFormats/TauReco/interface/PFTau.h" | |
#include "DataFormats/TauReco/interface/PFTauFwd.h" | |
#include "DataFormats/TauReco/interface/PFTauTransverseImpactParameterAssociation.h" | |
#include "HLTrigger/HLTcore/interface/HLTFilter.h" | |
#include <vector> |
Hi Marino, [1] |
Pull request #36666 was updated. @cmsbuild, @missirol, @Martin-Grunewald can you please check and sign again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last set of comments. Some were missed in the previous round, and are repeated below.
Optional: consider squashing again into 1 commit before the final push.
@@ -0,0 +1,94 @@ | |||
/** \class HLTTauIPFilter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have been clearer: no problem with "IP", but I would still prefer "PFTau".
Could we please use HLTPFTauIPFilter
since the filter deals with "PFTau"s? (atm, we have other filters/producers in the menu named HLTPFTau*
, but I couldn't find any called HLTTau*
)
#include "DataFormats/TauReco/interface/PFTauTransverseImpactParameterAssociation.h" | ||
#include "HLTrigger/HLTcore/interface/HLTFilter.h" | ||
#include "CommonTools/Utils/interface/StringCutObjectSelector.h" | ||
#include <vector> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From previous round of comments.
std::string m_tauTIPSelectorString; | ||
StringCutObjectSelector<reco::PFTauTransverseImpactParameter> m_tauTIPSelector; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::string m_tauTIPSelectorString; | |
StringCutObjectSelector<reco::PFTauTransverseImpactParameter> m_tauTIPSelector; | |
const std::string m_tauTIPSelectorString; | |
const StringCutObjectSelector<reco::PFTauTransverseImpactParameter> m_tauTIPSelector; |
From previous round of comments.
for (reco::PFTauCollection::size_type iPFTau = 0; iPFTau < h_Taus->size(); iPFTau++) { | ||
reco::PFTauRef tauref(h_Taus, iPFTau); | ||
|
||
if ((m_tauTIPSelector)(*TausTIP[tauref])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ((m_tauTIPSelector)(*TausTIP[tauref])) { | |
if (m_tauTIPSelector(*TausTIP[tauref])) { |
Parentheses not needed.
more generic name after change to cut string apply code format implement latest suggestions rename pftau, add const
94422ce
to
fd3fedb
Compare
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36666/27788 |
Pull request #36666 was updated. @cmsbuild, @missirol, @Martin-Grunewald can you please check and sign again. |
please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-ab50aa/21724/summary.html Comparison SummarySummary:
|
+hlt
|
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2) |
@sarafiorendi , it would be great if you could update the PR title and description to reflect the latest changes to the plugin (dxy -> IP properties). |
ping @sarafiorendi |
+1 |
PR description:
A new HLTFilter is added in order to be able to apply cuts on the PF tau impact parameters values as calculated by the PFTauTransverseImpactParameter class .
The purpose is to use this filter in an HLT path for Run3 targeting displaced taus.