Line data Source code
1 : //--------------------------------------------------------------------------
2 : //
3 : // Environment:
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.
7 : //
8 : // Copyright Information: See EvtGen/COPYRIGHT
9 : // Copyright (C) 2011 University of Warwick, UK
10 : //
11 : // Description: Use the Tauola external generator for tau decays
12 : //
13 : // Modification history:
14 : //
15 : // John Back May 2011 Module created
16 : //
17 : //------------------------------------------------------------------------
18 :
19 : #include "EvtGenBase/EvtPatches.hh"
20 :
21 : #include "EvtGenBase/EvtParticle.hh"
22 :
23 : #include "EvtGenExternal/EvtTauola.hh"
24 :
25 : #include "EvtGenExternal/EvtExternalGenFactory.hh"
26 : #include "EvtGenModels/EvtAbsExternalGen.hh"
27 : #include "EvtGenBase/EvtDecayBase.hh"
28 :
29 : #include <string>
30 : #include <iostream>
31 : #include <cmath>
32 :
33 0 : EvtTauola::EvtTauola() {
34 :
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.
38 0 : _tauolaEngine = 0;
39 :
40 0 : }
41 :
42 0 : EvtTauola::~EvtTauola() {}
43 :
44 : std::string EvtTauola::getName(){
45 :
46 0 : return "TAUOLA";
47 :
48 : }
49 :
50 : EvtDecayBase* EvtTauola::clone(){
51 :
52 0 : return new EvtTauola();
53 :
54 0 : }
55 :
56 :
57 : void EvtTauola::init(){
58 :
59 :
60 0 : }
61 :
62 : void EvtTauola::initProbMax(){
63 :
64 0 : noProbMax();
65 :
66 0 : }
67 :
68 : void EvtTauola::decay( EvtParticle *p ){
69 :
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.
73 :
74 0 : if (_tauolaEngine == 0) {
75 0 : _tauolaEngine = EvtExternalGenFactory::getInstance()->getGenerator(EvtExternalGenFactory::TauolaGenId);
76 0 : }
77 :
78 0 : if (_tauolaEngine != 0) {
79 0 : _tauolaEngine->doDecay(p);
80 0 : }
81 :
82 0 : }
|