1 //--------------------------------------------------------------------------
4 // This software is part of the EvtGen package developed jointly
5 // for the BaBar and CLEO collaborations. If you use all or part
6 // of it, please give an appropriate acknowledgement.
8 // Copyright Information: See EvtGen/COPYRIGHT
9 // Copyright (C) 2011 University of Warwick, UK
11 // Description: Use the Tauola external generator for tau decays
13 // Modification history:
15 // John Back May 2011 Module created
17 //------------------------------------------------------------------------
19 #include "EvtGenBase/EvtPatches.hh"
21 #include "EvtGenBase/EvtParticle.hh"
23 #include "EvtGenExternal/EvtTauola.hh"
25 #include "EvtGenExternal/EvtExternalGenFactory.hh"
26 #include "EvtGenModels/EvtAbsExternalGen.hh"
27 #include "EvtGenBase/EvtDecayBase.hh"
33 EvtTauola::EvtTauola() {
35 // Set the Tauola engine to a null pointer at first.
36 // When we do the decay, we retrieve the pointer to the Tauola engine
37 // and use that for all decays. All clones will use the same Tauola engine.
42 EvtTauola::~EvtTauola() {}
44 std::string EvtTauola::getName(){
50 EvtDecayBase* EvtTauola::clone(){
52 return new EvtTauola();
57 void EvtTauola::init(){
62 void EvtTauola::initProbMax(){
68 void EvtTauola::decay( EvtParticle *p ){
70 // We check to see if the Tauola engine has been created before doing the decay.
71 // This should only create the full Tauola engine once, and all clones will
72 // point to the same engine.
74 if (_tauolaEngine == 0) {
75 _tauolaEngine = EvtExternalGenFactory::getInstance()->getGenerator(EvtExternalGenFactory::TauolaGenId);
78 if (_tauolaEngine != 0) {
79 _tauolaEngine->doDecay(p);