C++ Interface to Tauola
src/tauolaCInterfaces/Tauola.h
1 #ifndef _Tauola_h_included_
2 #define _Tauola_h_included_
3 
4 /**
5  * @class Tauola
6  *
7  * @brief Controls the configuration, initialization of Tauola.
8  *
9  * The Tauola class provides a wrapper to the TAUOLA common block
10  * responsible for setting up TAUOLA. They should then configure Tauola
11  * via the set method and then call initialize(). This is a static class.
12  *
13  * @author Nadia Davidson
14  * @date 16th June 2008
15  */
16 
17 #include <iostream>
18 #include "TauolaParticle.h"
19 #include "f_Init.h"
20 #include "f_Variables.h"
21 
22 namespace Tauolapp
23 {
24 
25 class TauolaEvent;
26 class TauolaParticle;
27 
28 class Tauola{
29 
30  public:
31 
32  static const int NS1=100,NS2=100,NS3=100,NCOS=21;
33 
34  /** Units */
35  static enum MomentumUnits { DEFAULT_MOMENTUM=-1, MEV, GEV } momentumUnit;
36  static enum LengthUnits { DEFAULT_LENGTH =-1, MM , CM } lengthUnit;
37 
38  /** Set output units (default Tauola::GEV and Tauola::MM). */
39  static void setUnits(MomentumUnits m,LengthUnits l);
40 
41  /** Set tau lifetime (in mm). */
42  static void setTauLifetime(double t);
43 
44  /** Decay Modes */
45  enum { All=0, ElectronMode, MuonMode, PionMode,
46  RhoMode, A1Mode, KMode, KStarMode };
47 
48  /** Structure for switching the computation of spin correlation.
49  By default all spin correlations are turned on. */
50  struct Particles
51  {
52  bool GAMMA,
53  Z0,
54  HIGGS,
55  HIGGS_H,
56  HIGGS_A,
57  HIGGS_PLUS,
58  HIGGS_MINUS,
59  W_PLUS,
60  W_MINUS;
61  void setAll(bool flag) { GAMMA=Z0=HIGGS=HIGGS_H=HIGGS_A=HIGGS_PLUS=HIGGS_MINUS=W_PLUS=W_MINUS=flag; }
62  };
63  static Particles spin_correlation;
64 
65  /** Initalize Tauola with the parameters previously set via the
66  setter methods */
67  static void initialize();
68 
69  /** DEPRECATED: Use 'initialize' instead. */
70  static void initialise();
71 
72  /** Change currents used by Tauola.
73  mode = 0 (default) - use CLEO currents
74  mode = 1 use RChL currents for 3pi and Belle currents for 2pi */
75  static void setNewCurrents(int mode);
76 
77  /** Substitute build-in generator with external one */
78  static void setRandomGenerator( double (*gen)() );
79 
80  /** Set seed for TAUOLA-FORTRAN random number generator */
81  static void setSeed( int ijklin, int ntotin, int ntot2n ) { rmarin_(&ijklin,&ntotin,&ntot2n); }
82 
83  static void setRedefineTauMinus( void (*fun)(TauolaParticle *) );
84  static void setRedefineTauPlus ( void (*fun)(TauolaParticle *) );
85 
86  /** Tau gun. Takes one particle that's already inside an event record and produces it's decay.
87  The tau provided may be undecayed first, or left intact if it already has daughters.
88  If the polarization three-vector is provided it will be used to construct m_R matrix. */
89  static void decayOne(TauolaParticle *tau, bool undecay=false, double polx=0,double poly=0, double polz=0);
90 
91  /** to check if Tauola was Intitailzed */
92  static bool getIsTauolaIni();
93 
94  /** Checks if we are using decayOne() */
95  static bool isUsingDecayOne();
96 
97  /** Checks if we are using boost routine for decayOne */
98  static bool isUsingDecayOneBoost();
99 
100  /** Set boost routine for decayOne(). Refer to documentation for more details. */
101  static void setBoostRoutine( void (*boost)(TauolaParticle*, TauolaParticle *) );
102 
103  /** Execute boost routine for decayOne() */
104  static void decayOneBoost(TauolaParticle *mother, TauolaParticle *target);
105 
106  /** Return polarization vector used by decayOne() */
107  static const double* getDecayOnePolarization();
108 
109  /** Set the pdg id of the particle to decay (should be 15 or -15) */
110  static void setDecayingParticle(int pdg_id);
111 
112  /** Return the pdg id of the particle to decay */
113  static int getDecayingParticle();
114 
115  /** Set the decay mode of all particle with pdg id the same
116  as the one given in setDecayingParticle(). firstDecayMode=0
117  is default and allows all decay modes. */
118  static void setSameParticleDecayMode(int firstDecayMode);
119 
120  /** Set the decay mode of all particle with opposite charge
121  to the one given in setDecayingParticle(). secondDecayMode=0
122  is default and allows all decay modes. */
123  static void setOppositeParticleDecayMode(int secondDecayMode);
124 
125  /** Switch for bremssthahlung in leptonic tau decays */
126  static void setRadiation(bool rad);
127 
128  /** Cut-Off parameter of radition. Above that value photon is explicitly generated */
129  static void setRadiationCutOff(double rad_cut_off);
130 
131  /** Initialization of some constants related to QED corrections.
132  Variable iniphy_param is at present dummy. It is prepared to be transmitted
133  to some old style production code and is kept for backward compatibility */
134  static void setInitializePhy(double iniphy);
135 
136  /** DEPRECATED: Use 'setInitializePhy' instead. */
137  static void setInitialisePhy(double iniphy);
138 
139  /** Set branching fraction for i-th channel. Can be reused several times during the run. */
140  static void setTauBr(int i, double value);
141 
142  static void setTaukle(double bra1, double brk0, double brk0b, double brks);
143 
144  static double getHiggsScalarPseudoscalarMixingAngle();
145 
146  /** set the mixing angle. coupling: tau~(cos(phi)+isin(phi)gamma5)tau */
147  static void setHiggsScalarPseudoscalarMixingAngle(double angle);
148 
149  /** Get mass of the tau used by interface. */
150  static double getTauMass();
151 
152  /** Modify Higgs Scalar-Pseudoscalar PDG id (default is 35). */
153  static void setHiggsScalarPseudoscalarPDG(int pdg_id);
154 
155  /** Get Higgs Scalar-Pseudoscalar PDG id. */
157 
158  static int getHelPlus();
159 
160  static int getHelMinus();
161 
162  static double getEWwt();
163 
164  static double getEWwt0();
165 
166  static void setEWwt(double wt, double wt0);
167 
168  static void setHelicities(int Minus, int Plus);
169 
170  static void setEtaK0sPi(int eta, int k, int pi);
171 
172  static void getBornKinematics(int *incoming_pdg_id, int *outgoing_pdg_id, double *invariant_mass_squared,double *cosTheta);
173 
174  static void summary();
175 
176 public:
177 
178  static double table11A[NS1][NCOS][4][4],table1A[NS1][NCOS][4][4],table2A[NS1][NCOS][4][4];
179  static double wtable11A[NS1][NCOS],wtable1A[NS1][NCOS],wtable2A[NS1][NCOS];
180  static double w0table11A[NS1][NCOS],w0table1A[NS1][NCOS],w0table2A[NS1][NCOS];
181 
182  static double table11B[NS2][NCOS][4][4],table1B[NS2][NCOS][4][4],table2B[NS2][NCOS][4][4];
183  static double wtable11B[NS2][NCOS],wtable1B[NS2][NCOS],wtable2B[NS2][NCOS];
184  static double w0table11B[NS2][NCOS],w0table1B[NS2][NCOS],w0table2B[NS2][NCOS];
185 
186  static double table11C[NS3][NCOS][4][4],table1C[NS3][NCOS][4][4],table2C[NS3][NCOS][4][4];
187  static double wtable11C[NS3][NCOS],wtable1C[NS3][NCOS],wtable2C[NS3][NCOS];
188  static double w0table11C[NS3][NCOS],w0table1C[NS3][NCOS],w0table2C[NS3][NCOS];
189  static double sminA,smaxA,sminB,smaxB,sminC,smaxC;
190 
191  static int ion[3];
192 
193  // c*tau in milimeters, survival probablility P(t)=exp(-t/lifetime)
194  static double tau_lifetime;
195  static double momentum_conservation_threshold;
196 
197  //born kinematic variables
198  static int buf_incoming_pdg_id, buf_outgoing_pdg_id;
199  static double buf_invariant_mass_squared, buf_cosTheta;
200  static double buf_R[4][4]; //density matrix
201 
202  //pointer to random generator function
203  static double (*randomDouble)();
204 
205  static void (*redefineTauPlusProperties)(TauolaParticle *);
206  static void (*redefineTauMinusProperties)(TauolaParticle *);
207 
208  private:
209 
210  /** Calculate the charge of particle with code 'idhep'.
211  The code of the particle is defined by the Particle Data
212  Group in Phys. Lett. B204 (1988) 1.
213  NOTE: Code taken from Photos++, file: PhotosUtilities.cxx, function: PHOCHA */
214  static double particleCharge(int idhep);
215 
216  /** Fill 'array' indices from 'beg' to 'end' with 'value' */
217  static void fill_val(int beg, int end, double* array, double value);
218 
219  /** Default generator used in Tauola */
220  static double defaultRandomGenerator();
221  static void defaultRedPlus(TauolaParticle *);
222  static void defaultRedMinus(TauolaParticle *);
223 
224  /** Are we using decayOne() ? */
225  static bool m_is_using_decay_one;
226  /** decayOne() polarization vector */
227  static double m_decay_one_polarization[3];
228  /** Boost routine used by decayOne() */
230 
231  static bool m_is_initialized;
232  static int m_pdg_id;
233  static int m_firstDecayMode;
234  static int m_secondDecayMode;
235  static bool m_rad;
236  static double m_rad_cut_off;
237  static double m_iniphy;
238  static double m_higgs_scalar_pseudoscalar_mix;
239  static int m_higgs_scalar_pseudoscalar_pdg;
240  static double m_wtEW;
241  static double m_wtEW0;
242  static int m_helPlus;
243  static int m_helMinus;
244 };
245 
246 } // namespace Tauolapp
247 #endif
248 
Abstract base class for containing the event information.
Abstract base class for particle in the event. This class also handles boosting.
Controls the configuration, initialization of Tauola.
static void setOppositeParticleDecayMode(int secondDecayMode)
static void setSameParticleDecayMode(int firstDecayMode)
static void setHiggsScalarPseudoscalarMixingAngle(double angle)
static bool getIsTauolaIni()
static bool isUsingDecayOne()
static void setNewCurrents(int mode)
static double particleCharge(int idhep)
static void setRadiationCutOff(double rad_cut_off)
static void setTauBr(int i, double value)
static const double * getDecayOnePolarization()
static void setRadiation(bool rad)
static void setUnits(MomentumUnits m, LengthUnits l)
static double m_decay_one_polarization[3]
static void initialise()
static void setInitialisePhy(double iniphy)
static void fill_val(int beg, int end, double *array, double value)
static void setInitializePhy(double iniphy)
static int getHiggsScalarPseudoscalarPDG()
static void setRandomGenerator(double(*gen)())
static bool m_is_using_decay_one
static void initialize()
static bool isUsingDecayOneBoost()
static void decayOneBoost(TauolaParticle *mother, TauolaParticle *target)
static void setDecayingParticle(int pdg_id)
static void setBoostRoutine(void(*boost)(TauolaParticle *, TauolaParticle *))
static double defaultRandomGenerator()
static void setTauLifetime(double t)
static void decayOne(TauolaParticle *tau, bool undecay=false, double polx=0, double poly=0, double polz=0)
static void setHiggsScalarPseudoscalarPDG(int pdg_id)
static void(* m_decay_one_boost_routine)(TauolaParticle *, TauolaParticle *)
static void setSeed(int ijklin, int ntotin, int ntot2n)
static double getTauMass()
static int getDecayingParticle()