-
Notifications
You must be signed in to change notification settings - Fork 1
/
Asymmetry.hxx
60 lines (42 loc) · 1.68 KB
/
Asymmetry.hxx
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
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Asymmetry Class.
Loads asymmetry parameterization into TF2 object.
Persistent between events to minimize disk I/O.
Handles fitting of Monte-Carlo asymmetry data,
extrapolation between fits.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#ifndef Asymmetry_H
#define Asymmetry_H
#include <vector>
#include "TF1.h"
using namespace std;
class Asymmetry
{
private:
char * root_filepath; // Name of .root file with Raws and/or
// parameters
char * AsyNameStr; // Name of asymmetry
// (must match branch name)
int nQsq; // Number of Qsq values
vector<double> Qsq_Vec; // Qsq values
vector<TF1*> AsyFunction; // Asymmetry Functions
char * FuncForm; // General form of function to fit data
int nPars; // Number of pars in fitting function
double Extrap(double x0, double x1, double x2,
double y1, double y2);
// Extrapolation function
public:
Asymmetry(char * in_AsyName, char * in_Func,
vector<double> in_Qsq = vector<double>(),
bool refit = true);
int SetPars(vector<double> in_Qsq); // Set Pars from file
int Parameterize(); // Set pars from fitting
int Parameterize(vector<double> in_Qsq);
// Use only specified Qsq values
double GetAsyAmp(double Qsq, double tp);
// Return asymmetry amplitude
// void SetFunc(const string& fitfunc, int n);
// Sets the fitting function from string
void PrintPars();
};
#endif