File: TSpectrum2.h

package info (click to toggle)
bornagain 1.18.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 118,800 kB
  • sloc: cpp: 469,684; python: 38,920; xml: 805; awk: 630; sh: 286; ansic: 37; makefile: 25
file content (67 lines) | stat: -rw-r--r-- 3,330 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// @(#)root/spectrum:$Id$
// Author: Miroslav Morhac   17/01/2006

/*************************************************************************
 * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/
#ifndef ROOT_TSpectrum2
#define ROOT_TSpectrum2

#include "spectrum_types.h"
#include <string>

namespace tspectrum {

class TSpectrum2  {
protected:
   Int_t         fMaxPeaks;         ///< Maximum number of peaks to be found
   Int_t         fNPeaks;           ///< number of peaks found
   Double_t      *fPosition;        ///< [fNPeaks] array of current peak positions
   Double_t      *fPositionX;       ///< [fNPeaks] X position of peaks
   Double_t      *fPositionY;       ///< [fNPeaks] Y position of peaks
   Double_t       fResolution;      ///< *NOT USED* resolution of the neighboring peaks
//   TH1           *fHistogram;       ///< resulting histogram
static Int_t      fgAverageWindow;  ///< Average window of searched peaks
static Int_t      fgIterations;     ///< Maximum number of decon iterations (default=3)

public:
   enum {
       kBackIncreasingWindow =0,
       kBackDecreasingWindow =1,
       kBackSuccessiveFiltering =0,
       kBackOneStepFiltering =1
   };

   TSpectrum2();
   TSpectrum2(Int_t maxpositions, Double_t resolution=1); // resolution is *NOT USED*
   virtual ~TSpectrum2();
//   virtual TH1  *Background(const TH1 *hist, Int_t niter=20, Option_t *option="");
//   TH1          *GetHistogram() const {return fHistogram;}
   Int_t         GetNPeaks() const {return fNPeaks;}
   Double_t      *GetPositionX() const {return fPositionX;}
   Double_t      *GetPositionY() const {return fPositionY;}
//   virtual void  Print(Option_t *option="") const;
   virtual Int_t Search(const vec2d& hist, Double_t sigma=2, const std::string& option="", Double_t threshold=0.05);
   static void   SetAverageWindow(Int_t w=3);   //set average window
   static void   SetDeconIterations(Int_t n=3); //set max number of decon iterations
   void          SetResolution(Double_t resolution=1); // *NOT USED*

   //new functions January 2006
   const char   *Background(Double_t **spectrum,Int_t ssizex, Int_t ssizey,Int_t numberIterationsX,Int_t numberIterationsY,Int_t direction,Int_t filterType);
   const char   *SmoothMarkov(Double_t **source, Int_t ssizex, Int_t ssizey, Int_t averWindow);
   const char   *Deconvolution(Double_t **source, Double_t **resp, Int_t ssizex, Int_t ssizey,Int_t numberIterations, Int_t numberRepetitions, Double_t boost);
   Int_t         SearchHighRes(Double_t **source,Double_t **dest, Int_t ssizex, Int_t ssizey, Double_t sigma, Double_t threshold, Bool_t backgroundRemove,Int_t deconIterations, Bool_t markov, Int_t averWindow);

//   static Int_t        StaticSearch(const TH1 *hist, Double_t sigma=2, Option_t *option="goff", Double_t threshold=0.05);
//   static TH1         *StaticBackground(const TH1 *hist,Int_t niter=20, Option_t *option="");

};

} // tspectrum

#endif