121 bool gotAnyTauolaModes(
false );
123 for (
int iPDL = 0; iPDL < nPDL; iPDL++ ) {
127 if (
abs( PDGId ) ==
m_tauPDG && gotAnyTauolaModes ==
false ) {
128 const int aliasInt = particleId.
getAlias();
136 std::vector<double> tauolaModeBFs;
139 double totalTauModeBF( 0.0 );
141 int nNonTauolaModes( 0 );
144 for (
int iMode = 0; iMode < nModes; iMode++ ) {
149 std::string modelName = decayModel->
getName();
150 if ( modelName ==
"TAUOLA" ) {
151 gotAnyTauolaModes =
true;
155 int modeArrayInt = this->
getModeInt( decayModel ) - 1;
158 tauolaModeBFs[modeArrayInt] = BF;
159 totalTauModeBF += BF;
168 if ( gotAnyTauolaModes ==
true && nNonTauolaModes > 0 ) {
170 <<
"Please remove all non-TAUOLA decay modes for particle "
177 if ( totalTauModeBF > 0.0 ) {
179 <<
"Setting TAUOLA BF modes using the definitions for the particle "
183 tauolaModeBFs[iTauMode] /= totalTauModeBF;
184 double modeBF = tauolaModeBFs[iTauMode];
186 <<
"Setting TAUOLA BF for mode " << iTauMode + 1
187 <<
" = " << modeBF << endl;
188 Tauolapp::Tauola::setTauBr( iTauMode + 1, modeBF );
192 <<
"Any other TAUOLA BF modes for other tau particle decay mode definitions will be ignored!"
223 if ( neutPropName ==
"Z0" || neutPropName ==
"Z" ) {
225 }
else if ( neutPropName ==
"Gamma" ) {
227 }
else if ( neutPropName ==
"Higgs" ) {
229 }
else if ( neutPropName ==
"PseudoHiggs" ) {
231 }
else if ( neutPropName ==
"MixedHiggs" ) {
232 m_neutPropType = Tauolapp::Tauola::getHiggsScalarPseudoscalarPDG();
237 <<
"TAUOLA neutral spin propagator PDG id set to " <<
m_neutPropType
243 std::string chargedPropName =
EvtSymTable::get(
"TauolaChargedProp", iErr );
244 if ( chargedPropName ==
"W" ) {
247 }
else if ( chargedPropName ==
"Higgs" ) {
254 <<
"TAUOLA negative charge spin propagator PDG id set to "
260 <<
"TAUOLA positive charge spin propagator PDG id set to "
268 if ( mixString !=
"TauolaHiggsMixingAngle" ) {
269 double mixAngle = std::atof( mixString.c_str() );
271 <<
"TAUOLA Higgs mixing angle set to " << mixAngle <<
" radians"
273 Tauolapp::Tauola::setHiggsScalarPseudoscalarMixingAngle( mixAngle );
278 std::array<double, 4> BRVect{ 0.5, 0.5, 0.5, 0.6667 };
279 for (
int j = 0; j < 4; j++ ) {
280 std::ostringstream o;
282 std::string BRName =
"TauolaBR" + o.str();
286 if ( stringBR != BRName ) {
287 BRVect[j] = std::atof( stringBR.c_str() );
292 <<
"TAUOLA::setTaukle values are " << BRVect[0] <<
", " << BRVect[1]
293 <<
", " << BRVect[2] <<
", " << BRVect[3] << endl;
295 Tauolapp::Tauola::setTaukle( BRVect[0], BRVect[1], BRVect[2], BRVect[3] );
299 std::string currentOption =
EvtSymTable::get(
"TauolaCurrentOption", iErr );
301 if ( currentOption !=
"TauolaCurrentOption" ) {
302 int currentOpt = std::atoi( currentOption.c_str() );
304 <<
"TAUOLA current option = " << currentOpt << endl;
306 Tauolapp::Tauola::setNewCurrents( currentOpt );
351 auto theEvent = std::make_unique<GenEvent>( Units::GEV, Units::MM );
355 theEvent->add_vertex( theVertex );
364 theVertex->add_particle_in( hepMCParent );
369 theVertex->add_particle_in( tauGenInit );
386 std::map<GenParticlePtr, EvtParticle*> tauMap;
390 EvtId origParentId( -1, -1 );
402 for ( iDaug = 0; iDaug < nDaug; iDaug++ ) {
408 theVertex->add_particle_out( hepMCDaughter );
415 if ( theDaughter->
getNDaug() > 0 ) {
418 tauMap[hepMCDaughter] = theDaughter;
422 hepMCDaughter->set_status( Tauolapp::TauolaParticle::STABLE );
431 if ( nTaus > 0 && hepMCParent ) {
446 theVertex->add_particle_out( singleTau );
447 tauMap[singleTau] = tauParticle;
454 static thread_local auto lastSeed{
455 std::numeric_limits<unsigned long int>::max() };
458 Tauolapp::Tauola::setSeed( lastSeed, 0, 0 );
465 Tauolapp::TauolaHepMC3Event tauolaEvent( theEvent.get() );
467 Tauolapp::TauolaHepMCEvent tauolaEvent( theEvent.get() );
471 tauolaEvent.decayTaus();
483 for (
auto aParticle : theEvent->particles() ) {
485 HepMC::GenEvent::particle_iterator eventIter;
486 for ( eventIter = theEvent->particles_begin();
487 eventIter != theEvent->particles_end(); ++eventIter ) {
489 HepMC::GenParticle* aParticle = ( *eventIter );
492 if ( aParticle &&
abs( aParticle->pdg_id() ) ==
m_tauPDG ) {
497 if ( tauEvtParticle ) {
501 tauP4CM.
set( tauP4CM.
get( 0 ), -tauP4CM.
get( 1 ),
502 -tauP4CM.
get( 2 ), -tauP4CM.
get( 3 ) );
507 std::vector<EvtId> daugIdVect;
508 std::vector<EvtVector4R> daugP4Vect;
513 HepMC3::Relatives::DESCENDANTS( endVertex ) ) {
515 HepMC::GenVertex::particle_iterator tauIter;
517 for ( tauIter = endVertex->particles_begin( HepMC::descendants );
518 tauIter != endVertex->particles_end( HepMC::descendants );
520 HepMC::GenParticle* tauDaug = ( *tauIter );
526 if ( daugDecayVtx ) {
531 int tauDaugPDG = tauDaug->pdg_id();
533 daugIdVect.push_back( daugId );
536 double tauDaug_px = tauDaugP4.px();
537 double tauDaug_py = tauDaugP4.py();
538 double tauDaug_pz = tauDaugP4.pz();
539 double tauDaug_E = tauDaugP4.e();
541 EvtVector4R daugP4( tauDaug_E, tauDaug_px, tauDaug_py,
543 daugP4Vect.push_back( daugP4 );
548 int nDaug = daugIdVect.size();
553 for ( iDaug = 0; iDaug < nDaug; iDaug++ ) {
557 EvtId theDaugId = daugIdVect[iDaug];
561 theDaugPart->
init( theDaugId, theDaugP4 );
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
std::string getName() const
EvtParticle * getDaug(const int i)
void deleteDaughters(bool keepChannel=false)
EvtVector4R getP4Lab() const
EvtParticle * getParent() const
void makeDaughters(size_t ndaug, const EvtId *id)