Skip to content
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

Merged
merged 2 commits into from Jan 18, 2022

Conversation

sarafiorendi
Copy link
Contributor

@sarafiorendi sarafiorendi commented Jan 10, 2022

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.

@cmsbuild
Copy link
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36666/27707

  • This PR adds an extra 16KB to repository

Code check has found code style and quality issues which could be resolved by applying following patch(s)

Copy link
Contributor

@missirol missirol left a 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.

HLTrigger/btau/plugins/HLTTauDxyFilter.h Outdated Show resolved Hide resolved
Comment on lines 37 to 44
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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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;

Comment on lines 53 to 55
#include "HLTTauDxyFilter.h"
DEFINE_FWK_MODULE(HLTTauDxyFilter);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#include "DataFormats/TauReco/interface/PFTau.h"
#include "DataFormats/TauReco/interface/PFTau.h"
#include "DataFormats/TauReco/interface/PFTauFwd.h"

Comment on lines 55 to 56
using namespace edm;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
using namespace edm;

#include <string>

#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "DataFormats/Common/interface/Handle.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#include "DataFormats/Common/interface/Handle.h"

Comment on lines 13 to 18
#include "HLTrigger/HLTcore/interface/defaultModuleLabel.h"


//
// constructors and destructor
//
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#include "HLTrigger/HLTcore/interface/defaultModuleLabel.h"
//
// constructors and destructor
//

}


// ------------ method called to produce the data ------------
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// ------------ method called to produce the data ------------

Comment on lines 19 to 26
namespace edm {
class ConfigurationDescriptions;
}

//
// class declaration
//

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
namespace edm {
class ConfigurationDescriptions;
}
//
// class declaration
//

Comment on lines 22 to 29
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),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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")) {

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36666/27709

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @sarafiorendi for master.

It involves the following packages:

  • HLTrigger/btau (hlt)

@cmsbuild, @missirol, @Martin-Grunewald can you please review it and eventually sign? Thanks.
@AlexDeMoor, @emilbols, @JyothsnaKomaragiri, @silviodonato, @Martin-Grunewald, @missirol, @andrzejnovak, @demuller this is something you requested to watch as well.
@perrotta, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@cmsbuild
Copy link
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36666/27711

ERROR: Build errors found during clang-tidy run.

HLTrigger/btau/plugins/HLTTauDxyFilter.cc:37:18: error: definition of implicitly declared destructor [clang-diagnostic-error]
HLTTauDxyFilter::~HLTTauDxyFilter() = default;
                 ^
Suppressed 1456 warnings (1452 in non-user code, 3 NOLINT, 1 with check filters).
--
gmake: *** [config/SCRAM/GMake/Makefile.coderules:129: code-checks] Error 2
gmake: *** [There are compilation/build errors. Please see the detail log above.] Error 2

@sarafiorendi
Copy link
Contributor Author

Hi @missirol,
thanks for the review. I applied almost all of your suggestions, but I still need to answer about if a check for a valid TIP reference is needed.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36666/27712

  • This PR adds an extra 16KB to repository

  • Found files with invalid states:

@cmsbuild
Copy link
Contributor

Pull request #36666 was updated. @cmsbuild, @missirol, @Martin-Grunewald can you please check and sign again.

Copy link
Contributor

@missirol missirol left a 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.

Comment on lines 37 to 41
#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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#include "FWCore/Framework/interface/MakerMacros.h"

This one can also go upstairs.

Comment on lines 8 to 16
#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>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#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>

@sarafiorendi
Copy link
Contributor Author

Hi Marino,
checks for a valid reference are performed by the PFTauTransverseImpactParameters class here [1] and [2] so I think a further check in this new filter is not needed.

[1]
https://github.com/cms-sw/cmssw/blob/master/RecoTauTag/RecoTau/plugins/PFTauTransverseImpactParameters.cc#L84
[2]
https://github.com/cms-sw/cmssw/blob/master/RecoTauTag/RecoTau/plugins/PFTauTransverseImpactParameters.cc#L135

@cmsbuild
Copy link
Contributor

Pull request #36666 was updated. @cmsbuild, @missirol, @Martin-Grunewald can you please check and sign again.

Copy link
Contributor

@missirol missirol left a 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
Copy link
Contributor

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>
Copy link
Contributor

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.

Comment on lines 36 to 37
std::string m_tauTIPSelectorString;
StringCutObjectSelector<reco::PFTauTransverseImpactParameter> m_tauTIPSelector;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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])) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36666/27788

  • This PR adds an extra 16KB to repository

  • Found files with invalid states:

    • RecoTauTag/HLTProducers/src/HLTTauDxyFilter.cc:

@cmsbuild
Copy link
Contributor

Pull request #36666 was updated. @cmsbuild, @missirol, @Martin-Grunewald can you please check and sign again.

@missirol
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-ab50aa/21724/summary.html
COMMIT: fd3fedb
CMSSW: CMSSW_12_3_X_2022-01-14-1100/slc7_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/36666/21724/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 43
  • DQMHistoTests: Total histograms compared: 3461659
  • DQMHistoTests: Total failures: 0
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3461637
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 42 files compared)
  • Checked 181 log files, 42 edm output root files, 43 DQM output files
  • TriggerResults: no differences found

@missirol
Copy link
Contributor

+hlt

  • new HLTFilter to select PFTaus based on their IP properties
  • presently not used in any validation wf (nor any HLT menu)

@cmsbuild
Copy link
Contributor

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)

@missirol
Copy link
Contributor

@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).

@qliphy
Copy link
Contributor

qliphy commented Jan 17, 2022

@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

@sarafiorendi sarafiorendi changed the title Add HLT filter to select online taus based on their dxy Add HLT filter to select online pf taus based on their impact parameter Jan 17, 2022
@qliphy
Copy link
Contributor

qliphy commented Jan 18, 2022

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants