MARLEY (Model of Argon Reaction Low Energy Yields) v2.0.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
Loading...
Searching...
No Matches
LeptonFactors.hh
1
4//
5// This file is part of MARLEY (Model of Argon Reaction Low Energy Yields)
6//
7// MARLEY is free software: you can redistribute it and/or modify it under the
8// terms of version 3 of the GNU General Public License as published by the
9// Free Software Foundation.
10//
11// For the full text of the license please see COPYING or
12// visit http://opensource.org/licenses/GPL-3.0
13//
14// Please respect the MCnet academic usage guidelines. See GUIDELINES
15// or visit https://www.montecarlonet.org/GUIDELINES for details.
16
17#pragma once
18
19// MARLEY includes
20#include "marley/NuclearResponses.hh"
21
22namespace marley {
23
24 class LeptonFactors {
25
26 public:
27
28 LeptonFactors() {}
29
30 LeptonFactors( double vCC, double vLL, double vCL, double vT,
31 double vTprime ) : vCC_( vCC ), vLL_( vLL ), vCL_( vCL ),
32 vT_( vT ), vTprime_( vTprime ) {}
33
34 inline double vCC() const { return vCC_; }
35 inline double vLL() const { return vLL_; }
36 inline double vCL() const { return vCL_; }
37 inline double vT() const { return vT_; }
38 inline double vTprime() const { return vTprime_; }
39
40 inline void set_vCC( double val ) { vCC_ = val; }
41 inline void set_vLL( double val ) { vLL_ = val; }
42 inline void set_vCL( double val ) { vCL_ = val; }
43 inline void set_vT( double val ) { vT_ = val; }
44 inline void set_vTprime( double val ) { vTprime_ = val; }
45
46 // Scalar product with the corresponding nuclear responses.
47 // Guard each term so that a zero nuclear response yields a zero
48 // contribution even when the corresponding lepton factor is NaN.
49 // Note that NaN * 0 == NaN rather than 0, which would silently corrupt
50 // the result.
53 inline double operator*( const NuclearResponses& nr ) {
54 double product = 0.;
55 double rcc = nr.RCC();
56 double rll = nr.RLL();
57 double rcl = nr.RCL();
58 double rt = nr.RT();
59 double rtp = nr.RTprime();
60 if ( rcc != 0. ) product += this->vCC_ * rcc;
61 if ( rll != 0. ) product += this->vLL_ * rll;
62 if ( rcl != 0. ) product += this->vCL_ * rcl;
63 if ( rt != 0. ) product += this->vT_ * rt;
64 if ( rtp != 0. ) product += this->vTprime_ * rtp;
65 return product;
66 }
67
68 protected:
69 double vCC_ = 0.;
70 double vLL_ = 0.;
71 double vCL_ = 0.;
72 double vT_ = 0.;
73 double vTprime_ = 0.;
74 };
75
76}
double operator*(const NuclearResponses &nr)