Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:15:01

0001 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0002   Asymmetry Class.
0003   Loads asymmetry parameterization into TF2 object.
0004   Persistent between events to minimize disk I/O.
0005   Handles fitting of Monte-Carlo asymmetry data,
0006   extrapolation between fits.
0007   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
0008 
0009 #ifndef Asymmetry_H
0010 #define Asymmetry_H
0011 
0012 #include <vector>
0013 #include "TF1.h"
0014 
0015 using namespace std;
0016 
0017 class Asymmetry
0018 {
0019 private:
0020 
0021   char * root_filepath;     // Name of .root file with Raws and/or
0022                             // parameters
0023   char * AsyNameStr;        // Name of asymmetry
0024                             // (must match branch name)
0025 
0026   int nQsq;                 // Number of Qsq values
0027   vector<double> Qsq_Vec;   // Qsq values
0028   vector<TF1*> AsyFunction; // Asymmetry Functions
0029 
0030   char * FuncForm;          // General form of function to fit data
0031 
0032   int nPars;                // Number of pars in fitting function
0033 
0034 
0035   double Extrap(double x0, double x1, double x2,
0036                 double y1, double y2);
0037                             // Extrapolation function
0038 
0039 public:
0040   Asymmetry(char * in_AsyName, char * in_Func,
0041             vector<double> in_Qsq = vector<double>(),
0042             bool refit = true);
0043 
0044   int SetPars(vector<double> in_Qsq);            // Set Pars from file
0045 
0046   int Parameterize();       // Set pars from fitting
0047 
0048   int Parameterize(vector<double> in_Qsq);
0049                             // Use only specified Qsq values
0050 
0051   double GetAsyAmp(double Qsq, double tp);
0052                             // Return asymmetry amplitude
0053 
0054   // void SetFunc(const string& fitfunc, int n);
0055                             // Sets the fitting function from string
0056 
0057   void PrintPars();
0058 
0059 };
0060 #endif