]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TEvtGen/EvtGen/EvtGenBase/EvtNeutrinoParticle.cpp
Converting TEvtGen to native cmake
[u/mrichter/AliRoot.git] / TEvtGen / EvtGen / EvtGenBase / EvtNeutrinoParticle.cpp
CommitLineData
da0e9ce3 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) 1998 Caltech, UCSB
10//
11// Module: EvtNeutrinoParticle.cc
12//
13// Description: Class to describe neutrinos
14//
15// Modification history:
16//
17// DJL/RYD September 25, 1996 Module created
18//
19//------------------------------------------------------------------------
20//
21#include "EvtGenBase/EvtPatches.hh"
22#include <iostream>
23#include <math.h>
24#include <stdlib.h>
25#include "EvtGenBase/EvtComplex.hh"
26#include "EvtGenBase/EvtNeutrinoParticle.hh"
27#include "EvtGenBase/EvtVector4R.hh"
28#include "EvtGenBase/EvtPDL.hh"
29#include "EvtGenBase/EvtReport.hh"
30using std::endl;
31
32
33EvtNeutrinoParticle::~EvtNeutrinoParticle(){}
34
35EvtNeutrinoParticle::EvtNeutrinoParticle(){
36
37 return;
38}
39
40void EvtNeutrinoParticle::init(EvtId part_n,const EvtVector4R& p4){
41
42 _validP4=true;
43 setp(p4);
44 setpart_num(part_n);
45
46 double e,px,py,pz;
47 e=p4.get(0);
48 px=p4.get(1);
49 py=p4.get(2);
50 pz=p4.get(3);
51
52 if (EvtPDL::getStdHep(part_n)==0){
53 report(ERROR,"EvtGen") << "Error in EvtNeutrinoParticle::init, part_n="
54 << part_n.getId()<<endl;
55 }
56
57 if (EvtPDL::getStdHep(part_n)>0){
58
59 double beta,alpha,p2,norm;
60
61 // See Sakurai p. 167-169
62 // and Renton p. 126
63
64 p2=px*px+py*py+pz*pz;
65
66 beta=acos(pz/sqrt(p2));
67 alpha=atan2(py,px);
68
69 norm=sqrt(2*e);
70
71 double cosb,sinb,cosa,sina;
72
73 cosb=cos(0.5*beta);
74 sinb=sin(0.5*beta);
75
76 cosa=cos(0.5*alpha);
77 sina=sin(0.5*alpha);
78
79 spinor_parent.set(-norm*sinb*EvtComplex(cosa,-sina),
80 norm*cosb*EvtComplex(cosa,sina),
81 norm*sinb*EvtComplex(cosa,-sina),
82 -norm*cosb*EvtComplex(cosa,sina));
83
84 }
85 else{
86
87 px=-p4.get(1);
88 py=-p4.get(2);
89 pz=-p4.get(3);
90
91 double pn,sqrpn;
92
93 pn=e;
94 sqrpn=sqrt(pn-pz);
95
96 spinor_parent.set((1.0/sqrpn)*EvtComplex(px,-py),
97 EvtComplex(sqrpn,0.0),
98 (-1.0/sqrpn)*EvtComplex(px,-py),
99 -EvtComplex(sqrpn,0.0));
100
101
102 }
103
104 setLifetime();
105
106}
107
108
109EvtDiracSpinor EvtNeutrinoParticle::spParentNeutrino() const {
110
111 return spinor_parent;
112}
113
114EvtDiracSpinor EvtNeutrinoParticle::spNeutrino() const {
115
116 report(ERROR,"EvtGen") << "Tried to get neutrino spinor in restframe";
117 report(ERROR,"EvtGen") << "Will terminate execution.";
118
119 ::abort();
120
121 return spinor_rest;
122}
123
124
125EvtSpinDensity EvtNeutrinoParticle::rotateToHelicityBasis() const{
126
127 report(ERROR,"EvtGen") << "rotateToHelicityBasis not implemented for neutrino.";
128 report(ERROR,"EvtGen") << "Will terminate execution.";
129
130 ::abort();
131
132 EvtSpinDensity rho;
133 return rho;
134
135}
136
137EvtSpinDensity EvtNeutrinoParticle::rotateToHelicityBasis(double,
138 double,
139 double) const{
140
141 report(ERROR,"EvtGen") << "rotateToHelicityBasis(alpha,beta,gama) not implemented for neutrino.";
142 report(ERROR,"EvtGen") << "Will terminate execution.";
143
144 ::abort();
145
146 EvtSpinDensity R;
147 R.setDiag(1);
148
149 return R;
150
151}
152
153
154