Skip to content

Commit

Permalink
Merge pull request #37931 from swagata87/backport_bctoe
Browse files Browse the repository at this point in the history
[12_2_X backport] fix in bc->e filter
  • Loading branch information
cmsbuild committed May 17, 2022
2 parents afc4951 + bb59ada commit a4df806
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
)

bctoefilter = cms.EDFilter("BCToEFilter",
filterAlgoPSet = cms.PSet(eTThreshold = cms.double(1),
filterAlgoPSet = cms.PSet(maxAbsEta = cms.double(2.5),
eTThreshold = cms.double(1),
genParSource = cms.InputTag("genParticlesForFilter")
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
)

bctoefilter = cms.EDFilter("BCToEFilter",
filterAlgoPSet = cms.PSet(eTThreshold = cms.double(1),
filterAlgoPSet = cms.PSet(maxAbsEta = cms.double(2.5),
eTThreshold = cms.double(1),
genParSource = cms.InputTag("genParticlesForFilter")
)
)
Expand Down
5 changes: 2 additions & 3 deletions GeneratorInterface/GenFilters/plugins/BCToEFilterAlgo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

BCToEFilterAlgo::BCToEFilterAlgo(const edm::ParameterSet& iConfig, edm::ConsumesCollector&& iC)
: //set constants
FILTER_ETA_MAX_(2.5),
maxAbsEta_((float)iConfig.getParameter<double>("maxAbsEta")),
eTThreshold_((float)iConfig.getParameter<double>("eTThreshold")),
genParSource_(iC.consumes<reco::GenParticleCollection>(iConfig.getParameter<edm::InputTag>("genParSource"))) {}

Expand All @@ -27,8 +27,7 @@ bool BCToEFilterAlgo::filter(const edm::Event& iEvent) const {

for (uint32_t ig = 0; ig < genPars.size(); ig++) {
reco::GenParticle gp = genPars.at(ig);
if (gp.status() == 1 && std::abs(gp.pdgId()) == 11 && gp.et() > eTThreshold_ &&
std::fabs(gp.eta()) < FILTER_ETA_MAX_) {
if (gp.status() == 1 && std::abs(gp.pdgId()) == 11 && gp.et() > eTThreshold_ && std::fabs(gp.eta()) < maxAbsEta_) {
if (hasBCAncestors(gp)) {
result = true;
}
Expand Down
3 changes: 1 addition & 2 deletions GeneratorInterface/GenFilters/plugins/BCToEFilterAlgo.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ class BCToEFilterAlgo {
bool isBCMeson(const reco::GenParticle& gp) const;
bool isBCBaryon(const reco::GenParticle& gp) const;

//constants:
const float FILTER_ETA_MAX_;
//filter parameters:
const float maxAbsEta_;
const float eTThreshold_;
const edm::EDGetTokenT<reco::GenParticleCollection> genParSource_;
};
Expand Down
1 change: 1 addition & 0 deletions GeneratorInterface/GenFilters/python/BCToEFilter_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

bctoefilter = cms.EDFilter("BCToEFilter",
filterAlgoPSet = cms.PSet(
maxAbsEta = cms.double(3.05),
eTThreshold = cms.double(10.0)
)
)
Expand Down

0 comments on commit a4df806

Please sign in to comment.