GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Gw::GSPlayer Class Reference

Most of the methods relies on graphical approach. More...

#include <GSPlayer.h>

Inheritance diagram for Gw::GSPlayer:

Public Member Functions

virtual void AddPeak (BasePeak *peak)
 Add a peak to the current collection (at the end) More...
 
virtual TH1 * Background (const TH1 *histo, Option_t *)
 Compute the background for that histogram. More...
 
virtual TH1 * Background (Option_t *opt="")
 Compute the background for the histogram in the current pad. More...
 
 ClassDef (GSPlayer, 0)
 
 ClassDef (BaseSpectrumPlayer, 1)
 
virtual Int_t CollectPeaks (Option_t *opt="")
 Collect the peaks from the current pad. More...
 
Bool_t Connect (TCanvas *c=0x0)
 Connect the Canvas to this to collect events. More...
 
Bool_t Disconnect (TCanvas *c=0x0)
 Connect the Canvas to this to collect events. More...
 
virtual void DoBackground (TH1 *histo, Option_t *opt="")
 Apply background substraction for that histogram. More...
 
virtual void DoBackground (Option_t *opt="")
 Apply background substraction for current histogram in pad. More...
 
virtual Int_t FindPeaks (TH1 *histo, Option_t *opt="")
 Find peak in current histo graphically. More...
 
virtual Int_t FindPeaks (Option_t *opt="")
 Find peak in current histo graphically. More...
 
virtual void FitAll (const char *nameFunc="DTGaus", Option_t *optFit="RN", Option_t *optBkg="Step")
 Fit all peaks using the spectrum in the current pad. More...
 
virtual const TF1 * GetDefaultPeakWidth () const
 Get formula that gives the with as a function of energy. More...
 
virtual TParameter< Double_t > GetDoubleParameter (TString)
 
virtual TParameter< Int_t > GetIntParameter (TString)
 To get the parameters. More...
 
virtual PeakCreatorGetPeakCreator ()
 
virtual TSeqCollection * GetPeakList () const
 Return the current collection of peaks. More...
 
 GSPlayer ()
 
void HandleMovement (Int_t eventType, Int_t eventX, Int_t eventY, TObject *)
 Handle Movement. More...
 
virtual void PopupFitMenu ()
 Popup AddLink menu. More...
 
virtual void Print (Option_t *opt="") const
 Print out informations concerning the parameters of that player. More...
 
virtual Bool_t RenamePeak (const Char_t *baseName="Peak", Bool_t force=false)
 Sort all peaks and rename them. More...
 
void SetDefaultPeakFWHM (const char *="PCG_FWHM")
 to change the definition of the formula for the width More...
 
virtual void SetHelpsPrintActive (bool on)
 
virtual Bool_t SetParameter (const char *name, Double_t value)
 To change the parameters for that algorithm. More...
 
virtual Bool_t SetParameter (const char *name, Int_t value)
 To change the parameters for that algorithm. More...
 
virtual Bool_t SetParameter (const char *name, const TObject *value)
 
virtual void SetPeakList (TSeqCollection *col=0x0)
 set collection More...
 
virtual void ShowPeakList () const
 Show the list of peaks on the current pad. More...
 
virtual void SortPeakList (const Char_t *parName="Position", Bool_t sortDes=false)
 sort peak list More...
 
virtual ~GSPlayer ()
 

Protected Member Functions

Int_t GetLastX ()
 set/get fLastX/fLastY More...
 
Int_t GetLastY ()
 
Bool_t IsInRange (TH1 *h, BasePeak *peak)
 check if peak is in range of drawn spectrum More...
 
void SetLastXY (Int_t lastX, Int_t lastY)
 

Protected Attributes

TContextMenu * fContextMenu
 context menu in canvas More...
 
PeakCreatorfCreator
 default PeakCreator More...
 
LogMessage fLog
 log message More...
 

Detailed Description

Most of the methods relies on graphical approach.

Below an example of fitting in a 152Eu source spectrum:

TCanvas* c1 = new TCanvas("c1","titre",10,10,700,500);
c1->Draw();
db.Open("toto", "rad:$PWD");
TH1F* h = new TH1F();
h->SetName("Eu152.spe");
db >> *h;
h->SetAxisRange(2100, 2400);
h->Draw(); // draw the spectrum of 152Eu in the given range.
GSPlayer* s = new GSPlayer();
// place the peaks using 'a' key
// or use FindPeaks() method: press 's' whenever the line pointed a peak you want to add
s->FitAll(); // fits the peaks with gaussian shape with a linear background

The FitAll(..) method fits all the positionned peaks in the spectrum. Peaks separated less than 2*fwhm (default wise fwhm = 6) are fitting with the CombinedFit(...) method.

// You can also defined background by pressing key 'b' to set each point of the background spline
s->Background() // fit the background point with a TSpline
s->DoBackground // fit the background point with a TSpline & removed background from current histogramm

Definition at line 46 of file GSPlayer.h.


The documentation for this class was generated from the following files: