TGo4FitPeakFinder.h

Go to the documentation of this file.
00001 // $Id: TGo4FitPeakFinder.h 478 2009-10-29 12:26:09Z linev $
00002 //-----------------------------------------------------------------------
00003 //       The GSI Online Offline Object Oriented (Go4) Project
00004 //         Experiment Data Processing at EE department, GSI
00005 //-----------------------------------------------------------------------
00006 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH
00007 //                     Planckstr. 1, 64291 Darmstadt, Germany
00008 // Contact:            http://go4.gsi.de
00009 //-----------------------------------------------------------------------
00010 // This software can be used under the license agreements as stated
00011 // in Go4License.txt file which is part of the distribution.
00012 //-----------------------------------------------------------------------
00013 
00014 #ifndef TGO4FITPEAKFINDER_H
00015 #define TGO4FITPEAKFINDER_H
00016 
00017 #include "TGo4FitterAction.h"
00018 
00019 #include "TArrayD.h"
00020 
00021 class TGo4Fitter;
00022 class TGo4FitData;
00023 
00030 class TGo4FitPeakFinder : public TGo4FitterAction {
00031    public:
00032 
00036       TGo4FitPeakFinder();
00037 
00042       TGo4FitPeakFinder(const char* Name, const char* DataName = 0, Bool_t ClearModels = kFALSE, Int_t PolOrder = -1);
00043 
00047       virtual ~TGo4FitPeakFinder();
00048 
00049       void SetDataName(const char* name) { fxDataName = name; }
00050       const char* GetDataName() { return fxDataName.Data(); }
00051       void SetClearModels(Bool_t clear) { fbClearModels = clear; }
00052       Bool_t GetClearModels() { return fbClearModels; }
00053 
00054 
00055       void SetupPolynomialBackground(Int_t PolynomOrder);
00056 
00057       void SetupForFirst(Double_t MaxAmplFactor, Double_t MinWidth, Double_t MaxWidth);
00058 
00059       void SetupForSecond(Double_t LineWidth);
00060 
00061       void SetupForThird(Double_t NoiseFactor, Double_t NoiseMinimum, Int_t ChannelSum);
00062 
00063       virtual void DoAction(TGo4FitterAbstract* Fitter);
00064 
00065       virtual Bool_t CanChangeFitter() const { return kTRUE; }
00066 
00067       // Following functions directly changes single parameters of peakfinders.
00068       // Normally you should not use them, because some or all of them can be changed later on
00069       // You should use Setup... routines to configure specific peakfinder
00070 
00071       void SetUsePolynom(Bool_t use) { fbUsePolynom = use; }
00072       Bool_t GetUsePolynom() { return fbUsePolynom; }
00073       void SetPolynomOrder(Int_t order) { fiPolynomOrder = order; }
00074       Int_t GetPolynomOrder() { return fiPolynomOrder; }
00075 
00076       void SetPeakFinderType(Int_t typ) { fiPeakFinderType = typ; }
00077       Int_t GetPeakFinderType() { return fiPeakFinderType; }
00078 
00079       void Set0MaxAmplFactor(Double_t factor) { fd0MaxAmplFactor = factor; }
00080       Double_t Get0MaxAmplFactor() { return fd0MaxAmplFactor; }
00081       void Set0MinWidth(Double_t min) { fd0MinWidth = min; }
00082       Double_t Get0MinWidth() { return fd0MinWidth; }
00083       void Set0MaxWidth(Double_t max) { fd0MaxWidth = max; }
00084       Double_t Get0MaxWidth() { return fd0MaxWidth; }
00085 
00086       void Set1LineWidth(Double_t width) { fd1LineWidth = width; }
00087       Double_t Get1LineWidth() { return fd1LineWidth; }
00088 
00089       void Set2NoiseFactor(Double_t factor) { fd2NoiseFactor = factor; }
00090       Double_t Get2NoiseFactor() { return fd2NoiseFactor; }
00091       void Set2NoiseMinimum(Double_t min) { fd2NoiseMinimum = min; }
00092       Double_t Get2NoiseMinimum() { return fd2NoiseMinimum; }
00093       void Set2ChannelSum(Int_t sum) { fi2ChannelSum = sum; }
00094       Int_t Get2ChannelSum() { return fi2ChannelSum; }
00095 
00096 
00097 
00101       virtual void Print(Option_t* option) const;
00102 
00103     private:
00104 
00105       void ROOTPeakFinder(TGo4Fitter* fitter,
00106                           TGo4FitData* data,
00107                           Int_t PolynomOrder,
00108                           Double_t Sigma);
00109 
00110 
00118       void SergeyLinevPeakFinder(TGo4Fitter* fitter,
00119                                  TGo4FitData* data,
00120                                  Int_t PolOrder,
00121                                  Double_t AmplThreshold,
00122                                  Double_t MinWidth,
00123                                  Double_t MaxWidth);
00124 
00129       void HansEsselPeakFinder(TGo4Fitter* fitter,
00130                                TGo4FitData* data,
00131                                Int_t MaxNumPeaks = 50,
00132                                Int_t ChannelSum = 1,
00133                                Double_t NoiseFactor = 2.,
00134                                Double_t NoiseMinimum = 10.,
00135                                Int_t MinimasOrder = -1);
00136 
00137       static void DefinePolynom(Int_t size,              // number of experim points
00138                                 Double_t* bins,          // arrray of bins
00139                                 Double_t* scales,        // array of scale values
00140                                 TArrayD& Coef,           // array of polynomial coefficients
00141                                 Double_t* weight = 0,    // statistical weight of each bin
00142                                 Double_t* backgr = 0,    // background values
00143                                 Char_t* use = 0);        // usage of each points
00144 
00145       static void DefinePolynomEx(Int_t size, Double_t* bins, Double_t* scales, Double_t* weight, Double_t* backgr,
00146                                   Int_t lbound, Int_t rbound, TArrayD& Coef);
00147 
00148 
00149       static Double_t CalcPolynom(const TArrayD& Coef, Double_t x);
00150 
00151 
00152       Int_t fiPeakFinderType;   // 0 - by S.Linev,  1 - ROOT TSpectrum , 2 - by H.Essel
00153 
00154       TString fxDataName;
00155 
00156       Bool_t fbClearModels;
00157 
00158       Bool_t fbUsePolynom;
00159       Int_t  fiPolynomOrder;
00160 
00161       Double_t fd0MinWidth;
00162       Double_t fd0MaxWidth;
00163       Double_t fd0MaxAmplFactor;
00164 
00165       Double_t fd1LineWidth;
00166 
00167       Double_t fd2NoiseFactor;
00168       Double_t fd2NoiseMinimum;
00169       Int_t  fi2ChannelSum;
00170 
00171    ClassDef(TGo4FitPeakFinder,1)
00172 };
00173 
00174 #endif // TGO4FITPEAKFINDER_H

Generated on Thu Oct 28 15:54:12 2010 for Go4-Fitpackagev4.04-2 by  doxygen 1.5.1