ra4_macros  bede988c286599a3a84b77a4d788ac0a971e89f9
gamma_params.cpp
Go to the documentation of this file.
1 #include "gamma_params.hpp"
2 
3 #include <cmath>
4 
5 #include "utilities.hpp"
6 
8  n_effective_(0.),
9  weight_(0.){
10 }
11 
12 GammaParams::GammaParams(double n_effective, double weight):
13  n_effective_(n_effective),
14  weight_(weight){
15 }
16 
17 void GammaParams::SetYieldAndUncertainty(double yield, double uncertainty){
18  if(yield > 0.){
19  n_effective_ = (yield*yield)/(uncertainty*uncertainty);
20  weight_ = uncertainty*uncertainty/yield;
21  }else{
22  n_effective_ = 0.;
23  weight_ = uncertainty;
24  }
25 }
26 
27 void GammaParams::SetNEffectiveAndWeight(double n_effective, double weight){
28  n_effective_ = n_effective;
29  weight_ = weight;
30 }
31 
32 double GammaParams::Yield() const{
33  return n_effective_*weight_;
34 }
35 
36 void GammaParams::Yield(double yield){
38 }
39 
40 double GammaParams::Uncertainty() const{
41  return sqrt(n_effective_)*weight_;
42 }
43 
44 void GammaParams::Uncertainty(double uncertainty){
45  SetYieldAndUncertainty(Yield(), uncertainty);
46 }
47 
48 double GammaParams::NEffective() const{
49  return n_effective_;
50 }
51 
52 void GammaParams::NEffective(double n_effective){
53  SetNEffectiveAndWeight(n_effective, Weight());
54 }
55 
56 double GammaParams::Weight() const{
57  return weight_;
58 }
59 
60 void GammaParams::Weight(double weight){
62 }
63 
65  if(NEffective() == 0. && gp.NEffective() == 0.){
67  }else{
69  }
70  return *this;
71 }
72 
74  return (gp1 += gp2);
75 }
double Weight() const
double weight_
GammaParams & operator+=(const GammaParams &gp)
void SetYieldAndUncertainty(double yield, double uncertainty)
double Yield() const
double n_effective_
double Uncertainty() const
double NEffective() const
GammaParams operator+(GammaParams gp1, GammaParams gp2)
void SetNEffectiveAndWeight(double n_effective, double weight)
long double AddInQuadrature(long double x, long double y)
Definition: utilities.cpp:212