Skip to content

Commit

Permalink
Merge pull request #27791 from danielwinterbottom/higgstautau-tau-gen…
Browse files Browse the repository at this point in the history
…filters

modifying filters to use with higgs samples
  • Loading branch information
cmsbuild committed Aug 23, 2019
2 parents e4c4735 + 8cb750e commit 041eba6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion GeneratorInterface/Core/interface/EmbeddingHepMCFilter.h
Expand Up @@ -14,7 +14,7 @@ class EmbeddingHepMCFilter : public BaseHepMCFilter {
const int muonPDGID_ = 13;
const int electron_neutrino_PDGID_ = 12;
const int electronPDGID_ = 11;
const int ZPDGID_ = 23;
int ZPDGID_ = 23;

enum class TauDecayMode : int { Unfilled = -1, Muon = 0, Electron = 1, Hadronic = 2 };

Expand Down
10 changes: 7 additions & 3 deletions GeneratorInterface/Core/src/EmbeddingHepMCFilter.cc
Expand Up @@ -3,7 +3,8 @@
#include "boost/algorithm/string.hpp"
#include "boost/algorithm/string/trim_all.hpp"

EmbeddingHepMCFilter::EmbeddingHepMCFilter(const edm::ParameterSet &iConfig) {
EmbeddingHepMCFilter::EmbeddingHepMCFilter(const edm::ParameterSet &iConfig)
: ZPDGID_(iConfig.getParameter<int>("BosonPDGID")) {
// Defining standard decay channels
ee.fill(TauDecayMode::Electron);
ee.fill(TauDecayMode::Electron);
Expand Down Expand Up @@ -118,13 +119,16 @@ void EmbeddingHepMCFilter::decay_and_sump4Vis(HepMC::GenParticle *particle, reco
// Asuming, that there are only the two tauons from the Z-boson.
// This is the case for the simulated Z->tautau event constructed by EmbeddingLHEProducer.
if (std::abs(particle->pdg_id()) == tauonPDGID_ && !decaymode_known) {
// use these bools to protect againt taus that aren't the last copy (which "decay" to a tau and a gamma)
bool isGamma = std::abs((*daughter)->pdg_id()) == 22;
bool isTau = std::abs((*daughter)->pdg_id()) == 15;
if (std::abs((*daughter)->pdg_id()) == muonPDGID_) {
DecayChannel_.fill(TauDecayMode::Muon);
decaymode_known = true;
} else if (std::abs((*daughter)->pdg_id()) == electronPDGID_) {
DecayChannel_.fill(TauDecayMode::Electron);
decaymode_known = true;
} else if (!neutrino) {
} else if (!neutrino && !isGamma && !isTau) {
DecayChannel_.fill(TauDecayMode::Hadronic);
decaymode_known = true;
}
Expand Down Expand Up @@ -229,4 +233,4 @@ void EmbeddingHepMCFilter::fill_cut(std::string cut_string,
cut.eta2 = std::stod(single_cuts[i]);
}
}
}
}
Expand Up @@ -18,8 +18,9 @@
HadHadCut = cms.string('Had1.Pt > 35 && Had2.Pt > 30'),
MuHadCut = cms.string('Mu.Pt > 18 && Had.Pt > 25 && Mu.Eta < 2.1'),
MuMuCut = cms.string('Mu1.Pt > 17 && Mu2.Pt > 8'),
Final_States = cms.vstring('ElEl','ElHad','ElMu','HadHad','MuHad','MuMu')
)
Final_States = cms.vstring('ElEl','ElHad','ElMu','HadHad','MuHad','MuMu'),
BosonPDGID = cms.int32(23)
),
),
pythiaPylistVerbosity = cms.untracked.int32(0),
filterEfficiency = cms.untracked.double(1.0),
Expand Down

0 comments on commit 041eba6

Please sign in to comment.