evtgen is hosted by Hepforge, IPPP Durham
EvtGen  2.0.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
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 
23 #include "EvtGenBase/EvtComplex.hh"
24 #include "EvtGenBase/EvtPDL.hh"
25 #include "EvtGenBase/EvtPatches.hh"
26 #include "EvtGenBase/EvtReport.hh"
28 
29 #include <iostream>
30 #include <math.h>
31 #include <stdlib.h>
32 using std::endl;
33 
34 void EvtNeutrinoParticle::init( EvtId part_n, const EvtVector4R& p4 )
35 {
36  _validP4 = true;
37  setp( p4 );
38  setpart_num( part_n );
39 
40  double e, px, py, pz;
41  e = p4.get( 0 );
42  px = p4.get( 1 );
43  py = p4.get( 2 );
44  pz = p4.get( 3 );
45 
46  if ( EvtPDL::getStdHep( part_n ) == 0 ) {
47  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
48  << "Error in EvtNeutrinoParticle::init, part_n=" << part_n.getId()
49  << endl;
50  }
51 
52  if ( EvtPDL::getStdHep( part_n ) > 0 ) {
53  double beta, alpha, p2, norm;
54 
55  // See Sakurai p. 167-169
56  // and Renton p. 126
57 
58  p2 = px * px + py * py + pz * pz;
59 
60  beta = acos( pz / sqrt( p2 ) );
61  alpha = atan2( py, px );
62 
63  norm = sqrt( 2 * e );
64 
65  double cosb, sinb, cosa, sina;
66 
67  cosb = cos( 0.5 * beta );
68  sinb = sin( 0.5 * beta );
69 
70  cosa = cos( 0.5 * alpha );
71  sina = sin( 0.5 * alpha );
72 
73  spinor_parent.set( -norm * sinb * EvtComplex( cosa, -sina ),
74  norm * cosb * EvtComplex( cosa, sina ),
75  norm * sinb * EvtComplex( cosa, -sina ),
76  -norm * cosb * EvtComplex( cosa, sina ) );
77 
78  } else {
79  px = -p4.get( 1 );
80  py = -p4.get( 2 );
81  pz = -p4.get( 3 );
82 
83  double pn, sqrpn;
84 
85  pn = e;
86  sqrpn = sqrt( pn - pz );
87 
88  spinor_parent.set( ( 1.0 / sqrpn ) * EvtComplex( px, -py ),
89  EvtComplex( sqrpn, 0.0 ),
90  ( -1.0 / sqrpn ) * EvtComplex( px, -py ),
91  -EvtComplex( sqrpn, 0.0 ) );
92  }
93 
94  setLifetime();
95 }
96 
98 {
99  return spinor_parent;
100 }
101 
103 {
104  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
105  << "Tried to get neutrino spinor in restframe";
106  EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "Will terminate execution.";
107 
108  ::abort();
109 
110  return spinor_rest;
111 }
112 
114 {
115  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
116  << "rotateToHelicityBasis not implemented for neutrino.";
117  EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "Will terminate execution.";
118 
119  ::abort();
120 
121  EvtSpinDensity rho;
122  return rho;
123 }
124 
126  double ) const
127 {
128  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
129  << "rotateToHelicityBasis(alpha,beta,gama) not implemented for neutrino.";
130  EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "Will terminate execution.";
131 
132  ::abort();
133 
134  EvtSpinDensity R;
135  R.setDiag( 1 );
136 
137  return R;
138 }
void setDiag(int n)
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=0)
Definition: EvtReport.cpp:33
EvtSpinDensity rotateToHelicityBasis() const override
void init(EvtId part_n, const EvtVector4R &p4) override
EvtDiracSpinor spNeutrino() const override
Definition: EvtId.hh:27
EvtDiracSpinor spParentNeutrino() const override
void setp(double e, double px, double py, double pz)
Definition: EvtParticle.hh:437
double get(int i) const
Definition: EvtVector4R.hh:162
void setLifetime()
void set(const EvtComplex &sp0, const EvtComplex &sp1, const EvtComplex &sp2, const EvtComplex &sp3)
int getId() const
Definition: EvtId.hh:42
EvtDiracSpinor spinor_rest
EvtDiracSpinor spinor_parent
static int getStdHep(EvtId id)
Definition: EvtPDL.cpp:362
void setpart_num(EvtId particle_number)
Definition: EvtParticle.hh:449