GamR  0.0.0
GammaROOT
Loading...
Searching...
No Matches
TDPAD.hh
Go to the documentation of this file.
1#ifndef GAMROOT_SPECT_TDPAD_HH
2#define GAMROOT_SPECT_TDPAD_HH
3
4/* STD */
5#include <string>
6#include <vector>
7
8/* ROOT */
9#include <TF1.h>
10#include <TH1.h>
11
12/*GamR */
13#include <toolkit/Gate.hh>
14#include <nucleus/Transition.hh>
15
16
17namespace GamR {
18 namespace AngDist {
19 TH1D *RatioFunction(TH1 *h1, TH1 *h2);
20 TH1D *RatioFunction(TH1 *h1, TH1 *h2, const char *name);
21 TH1D *RatioFunction(TH2 *h1, TH2 *h2, GamR::TK::Gate peak, GamR::TK::Gate background);
22 TH1D *RatioFunction(TH2 *h1, TH2 *h2, GamR::TK::Gate peak, GamR::TK::Gate background, const char *name);
23 TH1D *RatioFunction(TH2 *h1, TH2 *h2, GamR::Nucleus::Transition peak);
24 TH1D *RatioFunction(TH2 *h1, TH2 *h2, GamR::Nucleus::Transition peak, const char *name);
25 TH1D *AutoCorrelation(TH1 *h1);
26 TH1D *AutoCorrelation(TH1 *h1, const char *name);
27 TH1D *AutoCorrelation(TH1 *h1, double start, double stop);
28 TH1D *AutoCorrelation(TH1 *h1, double start, double stop, const char *name);
29
33 class SpinPrec {
34 private:
35 double gfac;
36 double amp;
37 double theta;
38 double B;
39 double mun = 5.050786; // in J/T*1e27
40 double hbar = 1.0545726; // e-7, in J.s*1e27
41 double tstart;
42 bool tdir;
43 TF1 *func;
44
45 public:
46 SpinPrec(double g, double a, double thet, double b, double ts, bool td);
47 double GetOmega() { return -gfac * mun * B / hbar * 0.01; }
48 double SetTheta(double ang)
49 {
50 theta = ang * 3.141592 / 180;
51 func->FixParameter(1, theta);
52 return theta;
53 }
54 double SetG(double g)
55 {
56 gfac = g;
57 func->SetParameter(2, gfac);
58 return gfac;
59 }
60 double SetB(double b)
61 {
62 B = b;
63 func->FixParameter(4, B);
64 return B;
65 }
66 double SetAmp(double a)
67 {
68 amp = a;
69 func->SetParameter(0, amp);
70 return amp;
71 }
72 double SetTStart(double ts)
73 {
74 tstart = ts;
75 func->FixParameter(7, tstart);
76 return tstart;
77 }
78 bool SetTDir(bool dir)
79 {
80 tdir = dir;
81 if (dir) {
82 func->FixParameter(6, 1.0);
83 } else {
84 func->FixParameter(6, -1.0);
85 };
86 return tdir;
87 }
88 double GetG() { return gfac; }
89 double GetAmp() { return amp; }
90 double GetB() { return B; }
91 double GetTheta() { return theta; }
92 double GetTStart() { return tstart; }
93 bool GetTDir() { return tdir; }
94 TF1 *GetFunc();
95 };
96
97 } // namespace AngDist
98} // namespace GamR
99
100#endif
double SetB(double b)
Definition TDPAD.hh:60
SpinPrec(double g, double a, double thet, double b, double ts, bool td)
Definition TDPAD.cc:243
bool SetTDir(bool dir)
Definition TDPAD.hh:78
double SetTStart(double ts)
Definition TDPAD.hh:72
double SetTheta(double ang)
Definition TDPAD.hh:48
double SetG(double g)
Definition TDPAD.hh:54
double SetAmp(double a)
Definition TDPAD.hh:66
TH1D * RatioFunction(TH1 *h1, TH1 *h2)
Definition TDPAD.cc:37
TH1D * AutoCorrelation(TH1 *h1, double start, double stop)
Definition TDPAD.cc:142
Definition Gain.cc:19