Skip to content

Commit

Permalink
set decay time in the right place for the antiparticle
Browse files Browse the repository at this point in the history
  • Loading branch information
slava77devel committed Nov 23, 2016
1 parent 861258a commit 4763674
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions GeneratorInterface/Pythia8Interface/plugins/Py8PtGun.cc
Expand Up @@ -91,16 +91,18 @@ bool Py8PtGun::generatePartonsAndHadronize()
(fMasterGen->event).append( -particleID, 23, 0, 101, -px, -py, -pz, ee, mass );
} else if (fabs(particleID) == 21){ // gluons
(fMasterGen->event).append( 21, 23, 102, 101, -px, -py, -pz, ee, mass );
} else if ( (fMasterGen->particleData).isParticle( -particleID ) ) {
(fMasterGen->event).append( -particleID, 1, 0, 0, -px, -py, -pz, ee, mass );
} else {
(fMasterGen->event).append( particleID, 1, 0, 0, -px, -py, -pz, ee, mass );
int eventSize = (fMasterGen->event).size()-1;
// -log(flat) = exponential distribution
double tauTmp = -(fMasterGen->event)[eventSize].tau0() * log(randomEngine().flat());
(fMasterGen->event)[eventSize].tau( tauTmp );
if ( (fMasterGen->particleData).isParticle( -particleID ) ) {
(fMasterGen->event).append( -particleID, 1, 0, 0, -px, -py, -pz, ee, mass );
} else {
(fMasterGen->event).append( particleID, 1, 0, 0, -px, -py, -pz, ee, mass );
}
int eventSize = (fMasterGen->event).size()-1;
// -log(flat) = exponential distribution
double tauTmp = -(fMasterGen->event)[eventSize].tau0() * log(randomEngine().flat());
(fMasterGen->event)[eventSize].tau( tauTmp );
}
}
}
}

if ( !fMasterGen->next() ) return false;
Expand Down

0 comments on commit 4763674

Please sign in to comment.