23 #ifndef Gw_BaseSpectrumPlayer
24 #define Gw_BaseSpectrumPlayer
32 #ifndef ROOT_TParameter
33 #include "TParameter.h"
45 #ifndef Gw_PeakCreator
74 TSeqCollection *fPeakList;
76 TList *fInnerPeakList;
83 bool fIsHelpsPrintActive;
94 {fLastX = lastX; fLastY = lastY;}
117 Bool_t
Connect(TCanvas *c = 0x0);
139 {
return fPeakList; }
148 virtual void SetPeakList(TSeqCollection *col = 0x0);
154 virtual Bool_t
RenamePeak(
const Char_t* baseName =
"Peak", Bool_t force =
false);
157 virtual void FitAll(
const char* nameFunc =
"DTGaus", Option_t* optFit =
"RN", Option_t* optBkg =
"Step");
163 virtual Int_t
FindPeaks(Option_t* opt =
"");
169 virtual void SortPeakList(
const Char_t* parName =
"Position", Bool_t sortDes =
false);
172 virtual TH1 *
Background(
const TH1 *, Option_t* ) {
return 0x0; }
200 virtual void Print(Option_t* opt =
"")
const;
203 void HandleMovement(Int_t eventType, Int_t eventX, Int_t eventY, TObject*);
void SetDefaultPeakFWHM(const char *="PCG_FWHM")
to change the definition of the formula for the width
header file for PeakCreator.cpp
ClassDef(BaseSpectrumPlayer, 1)
virtual void SortPeakList(const Char_t *parName="Position", Bool_t sortDes=false)
sort peak list
header file for PadManager.cpp
virtual void DoBackground(TH1 *histo, Option_t *opt="")
Apply background substraction for that histogram.
virtual Bool_t RenamePeak(const Char_t *baseName="Peak", Bool_t force=false)
Sort all peaks and rename them.
BaseSpectrumPlayer to work on spectra.
LogMessage fLog
log message
BaseSpectrumPlayer()
default constructor
TF1 * GetDefaultPeakFWHM()
void SetLastXY(Int_t lastX, Int_t lastY)
virtual Bool_t SetParameter(const char *, Int_t)
Bool_t Disconnect(TCanvas *c=0x0)
Connect the Canvas to this to collect events.
Base class for a Log message.
header file for GwLogMessage.cpp
virtual Int_t FindPeaks(Option_t *opt="")
Find peaks from the histo in the current pad and store them in the current collection.
virtual void SetHelpsPrintActive(bool on)
virtual void PopupFitMenu()
Popup AddLink menu.
virtual PeakCreator * GetPeakCreator()
PeakCreator * fCreator
default PeakCreator
TContextMenu * fContextMenu
context menu in canvas
virtual ~BaseSpectrumPlayer()
virtual void DoBackground(Option_t *opt="")
Apply background substraction for current histogram in pad.
void HandleMovement(Int_t eventType, Int_t eventX, Int_t eventY, TObject *)
Handle Movement.
Bool_t IsInRange(TH1 *h, BasePeak *peak)
check if peak is in range of drawn spectrum
virtual const TF1 * GetDefaultPeakWidth() const
Get formula that gives the with as a function of energy.
Int_t GetLastX()
set/get fLastX/fLastY
virtual void SetPeakList(TSeqCollection *col=0x0)
set collection
virtual void Print(Option_t *opt="") const
Print out informations concerning the parameters of that player.
virtual TSeqCollection * GetPeakList() const
Return the current collection of peaks.
virtual void AddPeak(BasePeak *peak)
Add a peak to the current collection (at the end)
virtual Int_t CollectPeaks(Option_t *opt="")
Collect the peaks from the current pad.
A BasePeak is defined by a height, intensity and a dimension of the peak.
virtual TParameter< Double_t > GetDoubleParameter(TString)
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.
virtual void ShowPeakList() const
Show the list of peaks on the current pad.
static TH1 * GetHisto(TVirtualPad *pad=0x0, Option_t *op="")
look for an histogram into the pad
virtual TH1 * Background(const TH1 *, Option_t *)
Compute the background for that histogram.
virtual TParameter< Int_t > GetIntParameter(TString)
To get the parameters.
virtual Bool_t SetParameter(const char *, Double_t)
To change the parameters for that algorithm.
Bool_t Connect(TCanvas *c=0x0)
Connect the Canvas to this to collect events.