17 #ifndef STFCSPULSEANA_H
18 #define STFCSPULSEANA_H
23 #include "TLegendEntry.h"
25 #include "TGraphAsymmErrors.h"
26 #include "TMultiGraph.h"
30 #include "TPaveText.h"
31 #include "TPaveStats.h"
33 #include "StFcsDbMaker/StFcsDbPulse.h"
41 explicit StFcsPulseAna( TGraph* Sig, std::string name =
"StFcsPulseAna");
47 virtual void Copy(TObject& obj)
const;
48 virtual TObject*
Clone(
const char* newname)
const;
52 virtual Int_t AnalyzeForNoisyPeak(){
return PeakAna::AnalyzeForNoisyPeak(); }
55 static void GetMBPars(
const double& xpeak,
const double& xrise,
const double& yh,
const double& ped,
double& height,
double& scale );
57 virtual TGraphAsymmErrors*
GetData()
const{
return (TGraphAsymmErrors*)
mG_Data;}
59 const char*
GetName()
const {
return mName.c_str();}
60 std::string&
Name() {
return mName;}
61 const std::string&
Name()
const {
return mName;}
69 Int_t
Sum(Int_t Start, Int_t End);
71 Double_t
GausFit(Int_t Start=0,Int_t End=0);
74 Double_t
MBFit(Int_t Start=0,Int_t End=0);
75 Double_t
PulseFit(Int_t Start=0, Int_t End=0);
77 void SetFitPars(TF1*& func,
int start=-1,
int end=-1);
79 static void FillAdc(TGraphAsymmErrors* g,
unsigned short& counter,
int Start,
unsigned short* adcdata);
80 static int SumDep0(TGraphAsymmErrors* gdata,
int Start,
int ped=0);
81 static int SumDep0Mod(TGraphAsymmErrors* gdata,
int Start,
int ped=0);
95 virtual StFcsPulseAna*
DrawCopy(Option_t* opt=
"",
const char* name_postfix =
"_copy", TGraph* graph=0)
const;
97 virtual void Print(Option_t* opt=
"")
const;
virtual TGraphAsymmErrors * GetData() const
Overwrite from PeakAna to type convert for StFcsWaveformFitMaker.
void SignalMBPars(double &height, double &scale)
Figure out the height and scale of a Maxwell-Boltzmann distribution that approximates the signal...
void SetZS()
Call this for ZS data which uses thresholds that are relevant for that. (like 0 baseline and 0...
StFcsDbPulse * mDbPulse
Pointer to StFcsDbPulse.
virtual TObject * Clone(const char *newname) const
Clones internal graph as opposed to just copying the pointer.
static int SumDep0Mod(TGraphAsymmErrors *gdata, int Start, int ped=0)
Test my modified sum method to DEP board.
const std::string & Name() const
Double_t MBFit(Int_t Start=0, Int_t End=0)
Fit a Maxwell-Boltzmann distribution to mFoundPeak and return the integral minus the baseline...
virtual void MergeByProbability(std::vector< PeakWindow > &merged) const
Overwritten from PeakAna::MergeByProbability() to change merge criteria.
void ResetSum()
Only resets variables related to finding the sum.
TGraph * mG_Data
TGraph that stores the x,y data.
TF1 * mF1_BaselineFit
Gaussian function to fit to mH1_Baseline to determine baseline.
Double_t PulseFit(Int_t Start=0, Int_t End=0)
Fit the pulse shape defined in StFcsDbPulse::multiPulseShape() to all peaks and return the integral o...
Double_t GausFit(Int_t Start=0, Int_t End=0)
Do a Gaussian fit on mFoundPeak and return the integral subtracted by the baseline.
void AnalyzeForPedestal()
Analyze graph data to determine baseline internally.
static void GetMBPars(const double &xpeak, const double &xrise, const double &yh, const double &ped, double &height, double &scale)
Get parameters for a Maxwell Boltzmann distribution from above based on the 4 const parameters...
void SetBaseline(Double_t base, Double_t sigma)
void SetFitSignal(TF1 *func)
static void FillAdc(TGraphAsymmErrors *g, unsigned short &counter, int Start, unsigned short *adcdata)
Needed for SumDep0, et al. It basically fills in tb vs. adc sequentially so all timebins from a given...
virtual void Copy(TObject &obj) const
Internal method use Clone instead.
virtual Int_t AnalyzeForPeak()
Main analysis method for finding peaks.
virtual StFcsPulseAna * DrawCopy(Option_t *opt="", const char *name_postfix="_copy", TGraph *graph=0) const
Clone and draw, see PeakAna::Draw() for options.
void ResetFinder()
Resets all histograms and values.
Int_t SumWindow()
Sum the ADC in the peak defined by mFoundPeak and subtract the baseline.
void Init()
Initialize everything to zero except signal and background histograms.
void SetFitPars(TF1 *&func, int start=-1, int end=-1)
Set the parameters of an external TF1 function that has the form of StFcsDbPulse::multiPulseShape(), optionally only set fit paramaters for peaks from index start up to and including end.
virtual ~StFcsPulseAna()
Destructor.
bool FindBaseline()
Does Gaussian fitting to mH1_Baseline to determine baseline.
TH1F * BaselineHist() const
const char * GetName() const
virtual void Print(Option_t *opt="") const
Print class variables.
static int SumDep0(TGraphAsymmErrors *gdata, int Start, int ped=0)
Test of sum method in DEP board.
StFcsPulseAna()
Default constructor.
TF1 * mF1_SignalFit
Function to fit to the data.
void setDbPulse(StFcsDbPulse *p)
virtual Int_t AnalyzeForPeak()
Overwritten from PeakAna to process peak tunneling after finding all peaks.
void SetBaselineFit(TF1 *func)
void ResetBaseline()
Resets baseline values.
StFcsPulseAna & operator=(const StFcsPulseAna &rhs)
Assignment operator.
TF1 * BaselineFit() const
double SumMB()
Integral of an approximated Maxwell-Boltzmann distribution minus the baseline.
TH1F * mH1_Baseline
Histogram that holds projection of mG_Data for baseline determination.
Int_t Sum(Int_t Start, Int_t End)
Add raw ADC within a given range and subtract the baseline.
static double MaxwellBoltzmannDist(double *x, double *p)
Maxwell Boltzmann Distribution function.