]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STARLIGHT/starlight/src/psifamily.cpp
STARLIGHT code and interface
[u/mrichter/AliRoot.git] / STARLIGHT / starlight / src / psifamily.cpp
1 ///////////////////////////////////////////////////////////////////////////
2 //
3 //    Copyright 2010
4 //
5 //    This file is part of starlight.
6 //
7 //    starlight is free software: you can redistribute it and/or modify
8 //    it under the terms of the GNU General Public License as published by
9 //    the Free Software Foundation, either version 3 of the License, or
10 //    (at your option) any later version.
11 //
12 //    starlight is distributed in the hope that it will be useful,
13 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
14 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 //    GNU General Public License for more details.
16 //
17 //    You should have received a copy of the GNU General Public License
18 //    along with starlight. If not, see <http://www.gnu.org/licenses/>.
19 //
20 ///////////////////////////////////////////////////////////////////////////
21 //
22 // File and Version Information:
23 // $Rev:: 164                         $: revision of last commit
24 // $Author:: odjuvsla                 $: author of last commit
25 // $Date:: 2013-10-06 16:18:08 +0200 #$: date of last commit
26 //
27 // Description:
28 //
29 //
30 //
31 ///////////////////////////////////////////////////////////////////////////
32
33
34 #include <iostream>
35 #include <fstream>
36 #include <cmath>
37
38 #include "psifamily.h"
39
40
41 using namespace std;
42
43
44 psiFamily::psiFamily(beamBeamSystem& bbsystem):Gammaanarrowvm(bbsystem)
45 {
46 //Defining _width and mass...
47  
48
49         // switch(input.prodParticleType()){
50         //      case starlightConstants::JPSI:
51         //        cout << "JPSI goddamnit!" << endl;
52         //                 _width=0.000091;
53         //                 mass=3.09692;
54         //         break;
55         //         case starlightConstants::JPSI2S:
56         //                 _width=0.000337;
57         //                 mass=3.686093;
58         //         break;
59         //      default: cout<<"This PSI Family Member Has Not Been Defined, psiFamily::psiFamily()"<<endl;
60         // }
61
62 }
63
64
65 psiFamily::~psiFamily()
66 { }
67
68
69 double psiFamily::getTheta(starlightConstants::particleTypeEnum)
70 {
71 //should probably merge the psi fmaily back to the vm stuff.
72
73 //This depends on the decay angular distribution
74 //Valid for J/Psi, Psi(2s)?
75 //cout<<"Psi family theta"<<endl;
76 double theta=0.;
77 double xtest=0.;
78 double dndtheta=0.;
79         L200td:
80           theta = starlightConstants::pi*randyInstance.Rndom();//random()/(RAND_MAX+1.0);
81           xtest = randyInstance.Rndom();//random()/(RAND_MAX+1.0);
82           //  Follow distribution for helicity +/-1
83           //  Eq. 19 of J. Breitweg et al., Eur. Phys. J. C2, 247 (1998)//Does Not Apply for J/psi?
84           //  SRK 11/14/2000
85
86           dndtheta = sin(theta)*(1.+((cos(theta))*(cos(theta))));
87           if(xtest > dndtheta)
88             goto L200td;
89         return theta;
90 }
91
92
93 double psiFamily::getDaughterMass(starlightConstants::particleTypeEnum &ipid)
94 {
95         double ytest=0.,mdec=0.;
96         //  decays 50% to e+/e-, 50% to mu+/mu-
97         ytest = randyInstance.Rndom();//random()/(RAND_MAX+1.0);
98         if(ytest >= 0.5)
99         {
100                 mdec = starlightConstants::mel;
101                 ipid = starlightConstants::ELECTRON;
102         }
103         else
104         {
105                 mdec = starlightConstants::muonMass;
106                 ipid = starlightConstants::MUON;
107         }
108         return mdec;
109 }