EvtGen 2.2.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
Loading...
Searching...
No Matches
EvtNeutrinoParticle.cpp
Go to the documentation of this file.
1
2/***********************************************************************
3* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
4* *
5* This file is part of EvtGen. *
6* *
7* EvtGen 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* EvtGen 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 EvtGen. If not, see <https://www.gnu.org/licenses/>. *
19***********************************************************************/
20
22
24#include "EvtGenBase/EvtPDL.hh"
27
28#include <iostream>
29#include <math.h>
30#include <stdlib.h>
31using std::endl;
32
34{
35 m_validP4 = true;
36 setp( p4 );
37 setpart_num( part_n );
38
39 double e, px, py, pz;
40 e = p4.get( 0 );
41 px = p4.get( 1 );
42 py = p4.get( 2 );
43 pz = p4.get( 3 );
44
45 if ( EvtPDL::getStdHep( part_n ) == 0 ) {
46 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
47 << "Error in EvtNeutrinoParticle::init, part_n=" << part_n.getId()
48 << endl;
49 }
50
51 if ( EvtPDL::getStdHep( part_n ) > 0 ) {
52 double beta, alpha, p2, norm;
53
54 // See Sakurai p. 167-169
55 // and Renton p. 126
56
57 p2 = px * px + py * py + pz * pz;
58
59 beta = acos( pz / sqrt( p2 ) );
60 alpha = atan2( py, px );
61
62 norm = sqrt( 2 * e );
63
64 double cosb, sinb, cosa, sina;
65
66 cosb = cos( 0.5 * beta );
67 sinb = sin( 0.5 * beta );
68
69 cosa = cos( 0.5 * alpha );
70 sina = sin( 0.5 * alpha );
71
72 m_spinor_parent.set( -norm * sinb * EvtComplex( cosa, -sina ),
73 norm * cosb * EvtComplex( cosa, sina ),
74 norm * sinb * EvtComplex( cosa, -sina ),
75 -norm * cosb * EvtComplex( cosa, sina ) );
76
77 } else {
78 px = -p4.get( 1 );
79 py = -p4.get( 2 );
80 pz = -p4.get( 3 );
81
82 double pn, sqrpn;
83
84 pn = e;
85 sqrpn = sqrt( pn - pz );
86
87 m_spinor_parent.set( ( 1.0 / sqrpn ) * EvtComplex( px, -py ),
88 EvtComplex( sqrpn, 0.0 ),
89 ( -1.0 / sqrpn ) * EvtComplex( px, -py ),
90 -EvtComplex( sqrpn, 0.0 ) );
91 }
92
94}
95
100
102{
103 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
104 << "Tried to get neutrino spinor in restframe";
105 EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "Will terminate execution.";
106
107 ::abort();
108
109 return m_spinor_rest;
110}
111
113{
114 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
115 << "rotateToHelicityBasis not implemented for neutrino.";
116 EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "Will terminate execution.";
117
118 ::abort();
119
120 EvtSpinDensity rho;
121 return rho;
122}
123
125 double ) const
126{
127 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
128 << "rotateToHelicityBasis(alpha,beta,gama) not implemented for neutrino.";
129 EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "Will terminate execution.";
130
131 ::abort();
132
134 R.setDiag( 1 );
135
136 return R;
137}
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=nullptr)
Definition EvtReport.cpp:32
@ EVTGEN_ERROR
Definition EvtReport.hh:49
Definition EvtId.hh:27
int getId() const
Definition EvtId.hh:41
EvtDiracSpinor spNeutrino() const override
EvtDiracSpinor spParentNeutrino() const override
EvtDiracSpinor m_spinor_parent
EvtSpinDensity rotateToHelicityBasis() const override
void init(EvtId part_n, const EvtVector4R &p4) override
static int getStdHep(EvtId id)
Definition EvtPDL.cpp:356
void setLifetime()
void setp(double e, double px, double py, double pz)
void setpart_num(EvtId particle_number)
void setDiag(int n)
double get(int i) const