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

Biased tau decayer update #31353

Merged
merged 2 commits into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
//
class BiasedTauDecayer : public Pythia8::DecayHandler {
public:
BiasedTauDecayer(const Pythia8::Info* infoPtr,
Pythia8::Settings* settingsPtr,
Pythia8::ParticleData* particleDataPtr,
Pythia8::Rndm* rndmPtr);
BiasedTauDecayer(Pythia8::Info* infoPtr, Pythia8::Settings* settingsPtr);

bool decay(std::vector<int>& idProd,
std::vector<double>& mProd,
Expand Down
14 changes: 8 additions & 6 deletions GeneratorInterface/Pythia8Interface/plugins/Pythia8Hadronizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,10 @@ bool Pythia8Hadronizer::initializeForInternalPartons() {

bool biasedTauDecayer = fMasterGen->settings.flag("BiasedTauDecayer:filter");
if (biasedTauDecayer) {
if (!fBiasedTauDecayer.get())
fBiasedTauDecayer.reset(new BiasedTauDecayer(
&(fMasterGen->info), &(fMasterGen->settings), &(fMasterGen->particleData), &(fMasterGen->rndm)));
if (!fBiasedTauDecayer.get()) {
Pythia8::Info localInfo = fMasterGen->info;
fBiasedTauDecayer.reset(new BiasedTauDecayer(&localInfo, &(fMasterGen->settings)));
}
std::vector<int> handledParticles;
handledParticles.push_back(15);
fMasterGen->setDecayPtr(fBiasedTauDecayer, handledParticles);
Expand Down Expand Up @@ -566,9 +567,10 @@ bool Pythia8Hadronizer::initializeForExternalPartons() {

bool biasedTauDecayer = fMasterGen->settings.flag("BiasedTauDecayer:filter");
if (biasedTauDecayer) {
if (!fBiasedTauDecayer.get())
fBiasedTauDecayer.reset(new BiasedTauDecayer(
&(fMasterGen->info), &(fMasterGen->settings), &(fMasterGen->particleData), &(fMasterGen->rndm)));
if (!fBiasedTauDecayer.get()) {
Pythia8::Info localInfo = fMasterGen->info;
fBiasedTauDecayer.reset(new BiasedTauDecayer(&localInfo, &(fMasterGen->settings)));
}
std::vector<int> handledParticles;
handledParticles.push_back(15);
fMasterGen->setDecayPtr(fBiasedTauDecayer, handledParticles);
Expand Down
6 changes: 2 additions & 4 deletions GeneratorInterface/Pythia8Interface/src/BiasedTauDecayer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ using namespace Pythia8;
// leptonic decays
//

BiasedTauDecayer::BiasedTauDecayer(const Info* infoPtr,
Settings* settingsPtr,
ParticleData* particleDataPtr,
Rndm* rndmPtr) {
BiasedTauDecayer::BiasedTauDecayer(Info* infoPtr, Settings* settingsPtr) {
Copy link

Choose a reason for hiding this comment

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

Hi @smrenna . I seems to overlook something. Where do we propagate Settings* settingsPtr to P8, or differently asked, what happens to this argument in BiasedTauDecayer ?

decayer = TauDecays();
decayer.initInfoPtr(*infoPtr);
decayer.init();
filter_ = settingsPtr->flag("BiasedTauDecayer:filter");
eDecays_ = settingsPtr->flag("BiasedTauDecayer:eDecays");
Expand Down
44 changes: 44 additions & 0 deletions GeneratorInterface/Pythia8Interface/test/biasedTauDecayer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#example gen fragment that takes a gridapack which produces
#ttH events with inclusive top decays and undecayed higgs at lhe level
#and selects resonance decays such that events have at least four leptons (electrons, muons, taus)

import FWCore.ParameterSet.Config as cms

process = cms.Process("PROD")

process.load("Configuration.StandardSequences.SimulationRandomNumberGeneratorSeeds_cff")

# link to cards:
# https://github.com/cms-sw/genproductions/blob/0d4b4288fa053d9a8aef5c6e123b66bf94c3aee8/bin/Powheg/production/V2/13TeV/Higgs/ttH_inclusive_NNPDF30_13TeV_M125/ttH_inclusive_NNPDF30_13TeV_M125.input

process.source = cms.Source("LHESource",
fileNames = cms.untracked.vstring('file:powheg-Ztautau.lhe')
)

from Configuration.Generator.Pythia8CommonSettings_cfi import *
from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import *
from Configuration.Generator.Pythia8PowhegEmissionVetoSettings_cfi import *

process.generator = cms.EDFilter("Pythia8HadronizerFilter",
maxEventsToPrint = cms.untracked.int32(20),
pythiaPylistVerbosity = cms.untracked.int32(1),
filterEfficiency = cms.untracked.double(1.0),
pythiaHepMCVerbosity = cms.untracked.bool(False),
comEnergy = cms.double(13000.),
PythiaParameters = cms.PSet(
pythia8CommonSettingsBlock,
pythia8CUEP8M1SettingsBlock,
processParameters = cms.vstring(
'BiasedTauDecayer:filter = on',
'PartonLevel:MPI = off'
),
parameterSets = cms.vstring('pythia8CommonSettings',
'pythia8CUEP8M1Settings',
'processParameters'
)
)
)

process.p = cms.Path(process.generator)