Skip to content

Commit

Permalink
Merge pull request #5639 from bendavid/gentaufix_53x
Browse files Browse the repository at this point in the history
add (and enable) option to override SPINUP in lhe file for Pythia8 tau decays
  • Loading branch information
davidlange6 committed Oct 3, 2014
2 parents 8534dbf + af2c290 commit 1413707
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
Expand Up @@ -9,5 +9,6 @@
'ParticleDecays:limitTau0 = on',
'ParticleDecays:tau0Max = 10',
'ParticleDecays:allowPhotonRadiation = on',
'ParticleDecays:tauIgnoreSpinUpCMSSW = on',
)
)
Expand Up @@ -67,6 +67,9 @@ bool LHAupLesHouches::setEvent(int inProcId, double mRecalculate)

unsigned int iscale = 0;
for(int i = 0; i < hepeup.NUP; i++) {
//override spinup flag if so configured
double spinup = (std::abs(hepeup.IDUP[i])==15 && ignoreTauSpinUp_) ? 9. : hepeup.SPINUP[i];

//retrieve scale corresponding to each particle
double scalein = -1.;

Expand All @@ -87,7 +90,7 @@ bool LHAupLesHouches::setEvent(int inProcId, double mRecalculate)
hepeup.PUP[i][0], hepeup.PUP[i][1],
hepeup.PUP[i][2], hepeup.PUP[i][3],
hepeup.PUP[i][4], hepeup.VTIMUP[i],
hepeup.SPINUP[i],scalein);
spinup, scalein);
}

infoPtr->eventAttributes->clear();
Expand Down
Expand Up @@ -21,7 +21,7 @@

class LHAupLesHouches : public Pythia8::LHAup {
public:
LHAupLesHouches() {;}
LHAupLesHouches() : ignoreTauSpinUp_(false) {;}

//void loadRunInfo(const boost::shared_ptr<lhef::LHERunInfo> &runInfo)
void loadRunInfo(lhef::LHERunInfo* runInfo)
Expand All @@ -30,12 +30,16 @@ class LHAupLesHouches : public Pythia8::LHAup {
//void loadEvent(const boost::shared_ptr<lhef::LHEEvent> &event)
void loadEvent(lhef::LHEEvent* event)
{ this->event = event; }

void setIgnoreTauSpinUp(bool b) { ignoreTauSpinUp_ = b; }

private:

bool setInit();
bool setEvent(int idProcIn, double mRecalculate = -1.);

bool ignoreTauSpinUp_;

//boost::shared_ptr<lhef::LHERunInfo> runInfo;
lhef::LHERunInfo* runInfo;
//boost::shared_ptr<lhef::LHEEvent> event;
Expand Down
Expand Up @@ -395,7 +395,10 @@ bool Pythia8Hadronizer::initializeForExternalPartons()
} else {

lhaUP.reset(new LHAupLesHouches());
lhaUP->setIgnoreTauSpinUp(fMasterGen->settings.flag("ParticleDecays:tauIgnoreSpinUpCMSSW"));
lhaUP->loadRunInfo(lheRunInfo());



if ( fJetMatchingHook )
{
Expand Down
2 changes: 2 additions & 0 deletions GeneratorInterface/Pythia8Interface/src/Py8InterfaceBase.cc
Expand Up @@ -17,6 +17,8 @@ Py8InterfaceBase::Py8InterfaceBase( edm::ParameterSet const& ps )
fMasterGen.reset(new Pythia);
fDecayer.reset(new Pythia);

fMasterGen->settings.addFlag("ParticleDecays:tauIgnoreSpinUpCMSSW",false);

fMasterGen->readString("Next:numberShowEvent = 0");
fDecayer->readString("Next:numberShowEvent = 0");

Expand Down

0 comments on commit 1413707

Please sign in to comment.