forked from joaoabcoelho/OscProb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PMNS_NSI.cxx
355 lines (299 loc) · 10.5 KB
/
PMNS_NSI.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
////////////////////////////////////////////////////////////////////////
//
// Implementation of oscillations of neutrinos in matter in a
// three-neutrino framework with NSI.
//
// This class inherits from the PMNS_Fast class
//
////////////////////////////////////////////////////////////////////////
#include "PMNS_NSI.h"
#include "MatrixDecomp/zheevh3.h"
#include <iostream>
#include <cassert>
#include <stdlib.h>
using namespace OscProb;
using namespace std;
//......................................................................
///
/// Constructor. \sa PMNS_Base::PMNS_Base
///
/// This class is restricted to 3 neutrino flavours.
///
PMNS_NSI::PMNS_NSI() : PMNS_Fast(), fEps()
{
SetStdPath();
SetNSI(0.,0.,0.,0.,0.,0.,0.,0.,0.);
SetFermCoup(1,0,0);
}
//......................................................................
///
/// Nothing to clean.
///
PMNS_NSI::~PMNS_NSI(){}
//......................................................................
///
/// Set all NSI parameters at once.
///
/// This will check if value is changing to keep track of whether
/// the eigensystem needs to be recomputed.
///
/// @param eps_ee - The real parameter eps_ee
/// @param eps_emu - The absolute value of the complex parameter eps_emu
/// @param eps_etau - The absolute value of the complex parameter eps_etau
/// @param eps_mumu - The real parameter eps_mumu
/// @param eps_mutau - The absolute value of the complex parameter eps_mutau
/// @param eps_tautau - The real parameter eps_tautau
/// @param delta_emu - The phase of the complex parameter eps_emu in radians
/// @param delta_etau - The phase of the complex parameter eps_etau in radians
/// @param delta_mutau - The phase of the complex parameter eps_mutau in radians
///
void PMNS_NSI::SetNSI(double eps_ee, double eps_emu, double eps_etau,
double eps_mumu, double eps_mutau, double eps_tautau,
double delta_emu, double delta_etau, double delta_mutau)
{
SetEps(0,0, eps_ee, 0);
SetEps(1,1, eps_mumu, 0);
SetEps(2,2, eps_tautau, 0);
SetEps(0,1, eps_emu, delta_emu);
SetEps(0,2, eps_etau, delta_etau);
SetEps(1,2, eps_mutau, delta_mutau);
}
//......................................................................
///
/// Set any given NSI parameter.
///
/// This will check if value is changing to keep track of whether
/// the eigensystem needs to be recomputed.
///
/// Flavours are:\n
/// - 0 = nue, 1 = numu, 2 = nutau
///
/// Requires that flvi < flvj. Will notify you if input is wrong.
/// If flvi > flvj, will assume reverse order and swap flvi and flvj.
///
/// @param flvi - The first flavour index
/// @param flvj - The second flavour index
/// @param val - The absolute value of the parameter
/// @param phase - The complex phase of the parameter in radians
///
void PMNS_NSI::SetEps(int flvi, int flvj, double val, double phase){
if(flvi > flvj){
cout << "First argument should be smaller or equal to second argument" << endl;
cout << "Setting reverse order (Eps_" << flvj << flvi << "). " << endl;
int temp = flvi;
flvi = flvj;
flvj = temp;
}
if(flvi<0 || flvi>2 || flvj < flvi || flvj > 2){
cout << "Eps_" << flvi << flvj << " not valid for " << fNumNus;
cout << " neutrinos. Doing nothing." << endl;
return;
}
complexD h = val;
if(flvi != flvj) h *= complexD(cos(phase), sin(phase));
bool isSame = (fEps[flvi][flvj] == h);
if(!isSame) ClearCache();
fGotES *= isSame;
fEps[flvi][flvj] = h;
}
//......................................................................
///
/// Get any given NSI parameter.
///
/// Flavours are:\n
/// - 0 = nue, 1 = numu, 2 = nutau
///
/// Requires that flvi < flvj. Will notify you if input is wrong.
/// If flvi > flvj, will assume reverse order and swap flvi and flvj.
///
/// @param flvi - The first flavour index
/// @param flvj - The second flavour index
///
complexD PMNS_NSI::GetEps(int flvi, int flvj){
if(flvi > flvj){
cout << "First argument should be smaller or equal to second argument" << endl;
cout << "Setting reverse order (Eps_" << flvj << flvi << "). " << endl;
int temp = flvi;
flvi = flvj;
flvj = temp;
}
if(flvi<0 || flvi>2 || flvj < flvi || flvj > 2){
cout << "Eps_" << flvi << flvj << " not valid for " << fNumNus;
cout << " neutrinos. Returning 0." << endl;
return zero;
}
return fEps[flvi][flvj];
}
//......................................................................
///
/// Set eps_ee parameter
///
/// This will check if value is changing to keep track of whether
/// the eigensystem needs to be recomputed.
///
/// @param a - The value of the real parameter eps_ee
///
void PMNS_NSI::SetEps_ee(double a){ SetEps(0,0, a, 0); }
//......................................................................
///
/// Set eps_mumu parameter
///
/// This will check if value is changing to keep track of whether
/// the eigensystem needs to be recomputed.
///
/// @param a - The value of the real parameter eps_mumu
///
void PMNS_NSI::SetEps_mumu(double a){ SetEps(1,1, a, 0); }
//......................................................................
///
/// Set eps_tautau parameter
///
/// This will check if value is changing to keep track of whether
/// the eigensystem needs to be recomputed.
///
/// @param a - The value of the real parameter eps_tautau
///
void PMNS_NSI::SetEps_tautau(double a){ SetEps(2,2, a, 0); }
//......................................................................
///
/// Set eps_emu parameter
///
/// This will check if value is changing to keep track of whether
/// the eigensystem needs to be recomputed.
///
/// @param a - The absolute value of the parameter eps_emu
/// @param phi - The phase of the complex parameter eps_emu in radians
///
void PMNS_NSI::SetEps_emu (double a, double phi){ SetEps(0,1, a, phi); }
//......................................................................
///
/// Set eps_etau parameter
///
/// This will check if value is changing to keep track of whether
/// the eigensystem needs to be recomputed.
///
/// @param a - The absolute value of the parameter eps_etau
/// @param phi - The phase of the complex parameter eps_etau in radians
///
void PMNS_NSI::SetEps_etau (double a, double phi){ SetEps(0,2, a, phi); }
//......................................................................
///
/// Set eps_mutau parameter
///
/// This will check if value is changing to keep track of whether
/// the eigensystem needs to be recomputed.
///
/// @param a - The absolute value of the parameter eps_mutau
/// @param phi - The phase of the complex parameter eps_mutau in radians
///
void PMNS_NSI::SetEps_mutau (double a, double phi){ SetEps(1,2, a, phi); }
//......................................................................
///
/// Build the full Hamiltonian in matter
///
/// Here we divide the mass squared matrix Hms by the 2E
/// to obtain the vacuum Hamiltonian in eV. Then, the matter
/// potential is added to each flavour pair.
///
void PMNS_NSI::UpdateHam()
{
double lv = 2 * kGeV2eV*fEnergy; // 2*E in eV
double kr2GNe = kK2*M_SQRT2*kGf * fPath.density;
double kr2GNnsi = kr2GNe;
kr2GNe *= fPath.zoa; // Std matter potential in eV
kr2GNnsi *= GetZoACoup(); // NSI matter potential in eV
// Finish build Hamiltonian in matter with dimension of eV
for(int i=0;i<fNumNus;i++){
for(int j=i;j<fNumNus;j++){
if(!fIsNuBar) fHam[i][j] = fHms[i][j]/lv + kr2GNnsi*fEps[i][j];
else fHam[i][j] = conj(fHms[i][j]/lv - kr2GNnsi*fEps[i][j]);
}
}
if(!fIsNuBar) fHam[0][0] += kr2GNe;
else fHam[0][0] -= kr2GNe;
}
//......................................................................
///
/// Set the NSI relative coupling to a given fermion.
/// This factor represents what fraction of the fermion are seen
/// by the interaction.
///
/// @param c - fermion coupling strength
/// @param i - fermion index (0,1,2) -> (e,u,d)
///
void PMNS_NSI::SetCoupByIndex(double c, int i){
bool isSame = (fNSIcoup[i] == c);
if(!isSame) ClearCache();
fGotES *= isSame;
fNSIcoup[i] = c;
}
//......................................................................
///
/// Set the NSI relative coupling to electrons.
/// This factor represents what fraction of the electrons are seen
/// by the interaction.
///
/// @param e - electron coupling strength
///
void PMNS_NSI::SetElecCoup(double e){ SetCoupByIndex(e, 0); }
//......................................................................
///
/// Set the NSI relative coupling to u-quarks.
/// This factor represents what fraction of the u-quarks are seen
/// by the interaction.
///
/// @param u - u-quark coupling strength
///
void PMNS_NSI::SetUpCoup(double u){ SetCoupByIndex(u, 1); }
//......................................................................
///
/// Set the NSI relative coupling to d-quarks.
/// This factor represents what fraction of the d-quarks are seen
/// by the interaction.
///
/// @param d - d-quark coupling strength
///
void PMNS_NSI::SetDownCoup(double d){ SetCoupByIndex(d, 2); }
//......................................................................
///
/// Set the NSI relative couplings to each fermion.
/// These factors represent what fraction of each fermion are seen
/// by the interaction.
///
/// @param e - electron coupling strength
/// @param u - u-quark coupling strength
/// @param d - d-quark coupling strength
///
void PMNS_NSI::SetFermCoup(double e, double u, double d)
{
SetElecCoup(e); // electron coupling
SetUpCoup(u); // u-quark coupling
SetDownCoup(d); // d-quark coupling
}
//......................................................................
///
/// Get the NSI relative coupling to electrons.
///
double PMNS_NSI::GetElecCoup(){ return fNSIcoup[0]; }
//......................................................................
///
/// Get the NSI relative coupling to u-quarks.
///
double PMNS_NSI::GetUpCoup(){ return fNSIcoup[1]; }
//......................................................................
///
/// Get the NSI relative coupling to d-quarks.
///
double PMNS_NSI::GetDownCoup(){ return fNSIcoup[2]; }
//......................................................................
///
/// Get the effective NSI Z/A dependence.
///
double PMNS_NSI::GetZoACoup()
{
return fNSIcoup[0] * fPath.zoa // electrons: Z
+ fNSIcoup[1] * (1 + fPath.zoa) // u-quarks: A + Z
+ fNSIcoup[2] * (2 - fPath.zoa); // d-quarks: 2A - Z
}
////////////////////////////////////////////////////////////////////////