30 #include "TPolyLine.h"
100 Peak1D(
const char* name,
const char* title);
101 Peak1D(TPolyLine* polyline);
108 virtual void Copy(TObject &o)
const;
112 virtual void Fit(TH1 *
histo, Option_t* optFit =
"RN", Option_t* optBkg =
"pol1");
115 virtual void FitCombined(TH1 *
histo, TList* peakList, Option_t* optFit =
"RN", Option_t* optBkg =
"pol1");
118 void FitMenu(
const char* nameFunc =
"gaus", Option_t* optFit =
"RN", Option_t* optBkg =
"pol1");
121 virtual void Print(Option_t* opt =
"f")
const;
131 virtual void Area(Option_t *opt =
"h");
135 void SetPeak(Double_t pos, Double_t height, Double_t fwhm, Double_t intensity=0);
143 virtual void SetPosition(
const Double_t position, Option_t* axis =
"X");
145 virtual void SetFWHM(
const Double_t FWHM, Option_t* axis =
"X");
147 void SetBackground(Double_t bgLeft1, Double_t bgLeft2, Double_t bgRight1,Double_t bgRight2,
148 Double_t bgLevelLeft1, Double_t bgLevelLeft2, Double_t bgLevelRight1,Double_t bgLevelRight2);
151 void SetBackground( Double_t bgLeft1, Double_t bgLeft2, Double_t bgRight1, Double_t bgRight2,
const TH1* );
156 virtual Double_t
GetPosition(Option_t* axis =
"X")
const;
158 virtual Double_t
GetFWHM(Option_t* axis =
"X")
const;
180 double Landau(
double*xx,
double*pp);
182 double Gaus(
double*xx,
double*pp);
193 void WithBkg(Bool_t with_bg =
true);
219 virtual TMarker*
GetMarker(Int_t markerId);
235 virtual Int_t
Compare(
const TObject *obj)
const;
243 {
return TVector2(fBkgLeft1, fBkgLeft2); }
245 {
return TVector2(fBkgRight1, fBkgRight2); }
250 if ( x < fBkgLeft1 || x > fBkgRight2 )
252 if ( x <= fBkgLeft2 || x >= fBkgRight1 )
278 virtual void Paint(Option_t* opt =
"");
279 virtual void Draw(Option_t* opt =
"");
285 virtual void PaintFor(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax);
288 virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
295 Double_t
Bkg(Double_t* x, Double_t* par);
299 void SetPeakPoints();
302 void SetPeakPoints(TPolyLine* polyline);
314 void SetModified(TPolyLine &p, Bool_t modif =
true);
316 Bool_t IsModified(TPolyLine &p);
319 void InitPeakMarkers();
321 void ShiftPolyline(TPolyLine &, Double_t, Double_t);
323 void SetAllPointsinPolyline(TPolyLine &, Double_t x = 0.0, Double_t y = 0.0);
326 void FitIsWithBkg(TH1* h, Option_t* optFit);
337 Double_t fBkgLevelLeft1;
338 Double_t fBkgLevelLeft2;
339 Double_t fBkgLevelRight1;
340 Double_t fBkgLevelRight2;
341 Double_t fBkgIntegral;
342 Double_t fPeakIntegral;
343 Double_t fPeakIntegralError;
344 Double_t fSubPeakIntegral;
400 TGraph *fEfficiencyGraph;
401 TF1 *fEfficiencyFunc;
403 Float_t fRefAreaError;
404 Float_t fEffRelError;
406 void SetEfficiencyGraph(TGraph *gr, Float_t EffRelError = 0.1){fEfficiencyGraph = gr; fRefArea = 1; fRefAreaError = 0.;fEffRelError = EffRelError;}
407 void SetEfficiencyFunc(TF1 *f, Float_t EffRelError = 0.1){fEfficiencyFunc = f; fRefArea = 1; fRefAreaError = 0.;fEffRelError = EffRelError;}
408 void SetRefArea(Float_t a, Float_t ea){fRefArea = a; fRefAreaError = ea;}
static Color_t fgLineColorPeak[]
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Handle event in pad.
virtual void PaintFor(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax)
set attribute to paint this gate on the given histogram
void FitMenu(const char *nameFunc="gaus", Option_t *optFit="RN", Option_t *optBkg="pol1")
Fit with given function and background.
virtual void SetLineColorPeak(Color_t color)
virtual EDrawAs GetDrawAs() const
to know the current display mode
void SetEfficiencyGraph(TGraph *gr, Float_t EffRelError=0.1)
static void SetDefaultMarkerColor(Color_t c)
Set default marker color.
void SetPeak(Double_t pos, Double_t height, Double_t fwhm, Double_t intensity=0)
Set peak members.
double Landau(double *xx, double *pp)
Landau Fonction.
static void SetDefaultFuncColor(Color_t c)
Set default function color.
virtual TF1 * SignalAndBkgFunction()
Access to signal+Bkg function. Signa + Bkg must be set first, parameter are copied ! ...
void WithBkg(Bool_t with_bg=true)
toggle background (fit and display)
TPolyLine fCopyPolyline
current polyline
virtual void SetPosition(const Double_t position, Option_t *axis="X")
Set Position of peak.
GammaSourceRay * GetGammaSourceRay()
virtual void SetFWHM(const Double_t FWHM, Option_t *axis="X")
Set FWHM of peak.
static Color_t fgMarkerColor
double Gaus(double *xx, double *pp)
Gaus Fonction.
void SetRefArea(Float_t a, Float_t ea)
TF1 * ExtractBkgFromDTGStep(TString Name)
Bool_t IsWithBkg() const
Test if peak defined with background.
void SetEfficiencyFunc(TF1 *f, Float_t EffRelError=0.1)
virtual void SetFillColorBkg(Color_t color)
Set line attribute for bkg.
bool IsDrawAs(EDrawAs mode)
To test the draw mod ex: IsDrawAs(kGate)
Base class for a Log message.
static Style_t fgFillStylePeak
virtual void SetFillStylePeak(Style_t style)
static const Int_t fgkPointsPeak
pointer to signal+ bkg function
Double_t GetPeakIntegral() const
Get integral of peak after calling area method.
Double_t SignalAndBkg(Double_t *x, Double_t *par)
functions used to really fit
header file for GwLogMessage.cpp
static Color_t GetDefaultFuncColor()
Get default function color.
virtual TF1 * PeakFunction()
Access to peak function ... don't delete it !
GammaSourceRay * fGammaSourceRay
Double_t Bkg(Double_t *x, Double_t *par)
virtual void Browse(TBrowser *)
void SetPeakIntegralError(Double_t IntErr)
virtual Color_t GetLineColorPeak()
Get line peak color.
virtual void Fit(TH1 *histo, Option_t *optFit="RN", Option_t *optBkg="pol1")
Fit peak with background.
Double_t GetSubPeakIntegral() const
Get integral of background under peak after calling area method.
static Color_t GetDefaultMarkerColor()
Get default marker color.
static const Int_t fgkPointsBkg
virtual Double_t GetFWHM(Option_t *axis="X") const
Get FWHM of peak.
const TVector2 GetBkgRight() const
TList fMarkerList
current polyline before modification
virtual void Paint(Option_t *opt="")
Paint method.
virtual TF1 * SignalFunction()
Access to signal function ... don't delete it !
virtual Double_t GetPosition(Option_t *axis="X") const
Get position of peak.
virtual TMarker * GetMarker(Int_t markerId)
Get marker for a given Id.
virtual void Print(Option_t *opt="f") const
Print current peak.
virtual TF1 * BkgFunction()
Access to signal function ... don't delete it !
void SetHeight(const Double_t height)
Set height of peak.
void SetPeakFromFit()
Set peak members + polyline.
virtual void SetLineWidthPeak(Width_t width)
static Color_t fgFuncColor
virtual Double_t GetBinWidth()
Double_t GetBkgIntegral() const
Get integral of background after calling area method.
double DoubleTailedGaussian(double *xx, double *pp)
Double tailed gaussian (Dino like)
static const Int_t fgkPeakIdx
void SetMarkerColor(Int_t color)
Set marker color of the peak polyline.
double DoubleSidedCrystalBallFct(double *xx, double *pp)
Double Sided Crystal Ball Fonction.
virtual void SetBinWidth(Double_t width)
BinWidth of the fitted histogram for area correction.
Double_t GetBase() const
Get base of peakM.
virtual void Area(Option_t *opt="h")
to get the Area (+bkg) of this peak
virtual void SetFillStyleBkg(Style_t style)
A BasePeak is defined by a height, intensity and a dimension of the peak.
Double_t GetPeakIntegralError() const
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance to object.
virtual void SetLineColorBkg(Color_t color)
virtual Int_t Compare(const TObject *obj) const
static Color_t fgLineColorBkg
A graphical interface for placing schematic peak onto a 1D histogram with a given position...
void SetIntensity(const Double_t intensity)
Set Intensity of peak.
virtual void FitCombined(TH1 *histo, TList *peakList, Option_t *optFit="RN", Option_t *optBkg="pol1")
Fit multi-defined peak with a common background.
virtual void SetDrawAs(EDrawAs d)
Set drawing flag.
const TVector2 GetBkgLeft() const
Get background limits.
virtual void SetLineWidthBkg(Width_t width)
Short_t IsPointInBkg(Double_t x, Double_t=0)
to determine if a point is in bg. 0 likely in peak, 1 in bg, 2 outside bg
virtual TF1 * SetSignalFunction(const char *nameFunc="gaus", TH1 *h=0x0)
Set pre-defined function to fit the signal.
double DoubleTailedStepedGaussian(double *xx, double *pp)
Double tailed gaussian with step (Dino like)
TF1 * fFitCombined
pointer to signal+ bkg function
virtual void Copy(TObject &o) const
Assignment operator.
virtual TF1 * SetBkgFunction(const char *nameFunc="-")
Set pre-defined function for background during fit.
virtual Bool_t IsSortable() const
Sort.
void SetGammaSourceRay(GammaSourceRay *gsr)
virtual void Draw(Option_t *opt="")
virtual void SetFillColorPeak(Color_t color)
Set line attribute for peak.
static Style_t fgFillStyleBkg
virtual TF1 * GetSigFunction()
Get signal function.
virtual void SetDrawOption(Option_t *option="")
void SetBackground(Double_t bgLeft1, Double_t bgLeft2, Double_t bgRight1, Double_t bgRight2, Double_t bgLevelLeft1, Double_t bgLevelLeft2, Double_t bgLevelRight1, Double_t bgLevelRight2)
Set background limits.