ROOT  6.06/09
Reference Guide
TSpectrumTransform.h
Go to the documentation of this file.
1 // @(#)root/spectrum:$Id$
2 // Author: Miroslav Morhac 25/09/06
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 #ifndef ROOT_TSpectrumTransform
12 #define ROOT_TSpectrumTransform
13 
14 //////////////////////////////////////////////////////////////////////////
15 // //
16 // TSpectrumTransform //
17 // //
18 // Class to carry out transforms of 1D spectra, its filtering and //
19 // enhancement. It allows to calculate classic Fourier, Cosine, Sin, //
20 // Hartley, Walsh, Haar transforms as well as mixed transforms (Fourier-//
21 // Walsh, Fourier-Haar, Walsh-Haar, Cosine-Walsh, Cosine-Haar, Sin-Walsh//
22 // and Sin-Haar). All the transforms are fast. //
23 // //
24 //////////////////////////////////////////////////////////////////////////
25 
26 #ifndef ROOT_TNamed
27 #include "TNamed.h"
28 #endif
29 
30 class TH1;
31 
32 class TSpectrumTransform : public TNamed {
33 
34 protected:
35  Int_t fSize; //length of transformed data
36  Int_t fTransformType; //type of transformation (Haar, Walsh, Cosine, Sine, Fourier, Hartley, Fourier-Walsh, Fourier-Haar, Walsh-Haar, Cosine-Walsh, Cosine-Haar, Sine-Walsh, Sine-Haar)
37  Int_t fDegree; //degree of mixed transform, applies only for Fourier-Walsh, Fourier-Haar, Walsh-Haar, Cosine-Walsh, Cosine-Haar, Sine-Walsh, Sine-Haar transforms
38  Int_t fDirection; //forward or inverse transform
39  Int_t fXmin; //first channel of filtered or enhanced region
40  Int_t fXmax; //last channel of filtered or enhanced region
41  Double_t fFilterCoeff; //value set in the filtered region
42  Double_t fEnhanceCoeff; //multiplication coefficient applied in enhanced region;
43 
44 public:
45  enum {
61  };
64  virtual ~TSpectrumTransform();
65 
66 protected:
67  void BitReverse(Double_t *working_space,Int_t num);
68  void BitReverseHaar(Double_t *working_space,Int_t shift,Int_t num,Int_t start);
69  void Fourier(Double_t *working_space,Int_t num,Int_t hartley,Int_t direction,Int_t zt_clear);
70  Int_t GeneralExe(Double_t *working_space,Int_t zt_clear,Int_t num,Int_t degree,Int_t type);
71  Int_t GeneralInv(Double_t *working_space,Int_t num,Int_t degree,Int_t type);
72  void Haar(Double_t *working_space,Int_t num,Int_t direction);
73  void Walsh(Double_t *working_space,Int_t num);
74 
75 public:
76  void Enhance(const Double_t *source, Double_t *destVector);
77  void FilterZonal(const Double_t *source, Double_t *destVector);
78  void SetDirection(Int_t direction);
79  void SetEnhanceCoeff(Double_t enhanceCoeff);
80  void SetFilterCoeff(Double_t filterCoeff);
81  void SetRegion(Int_t xmin, Int_t xmax);
82  void SetTransformType(Int_t transType, Int_t degree);
83  void Transform(const Double_t *source, Double_t *destVector);
84 
85  ClassDef(TSpectrumTransform,1) //Spectrum Transformer, it calculates classic orthogonal 1D transforms
86 };
87 
88 
89 #endif
90 
virtual ~TSpectrumTransform()
destructor
float xmin
Definition: THbookFile.cxx:93
void SetTransformType(Int_t transType, Int_t degree)
SETTER FUNCION.
int Int_t
Definition: RtypesCore.h:41
Advanced 1-dimentional orthogonal transform functions.
#define ClassDef(name, id)
Definition: Rtypes.h:254
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
void Transform(const Double_t *source, Double_t *destVector)
ONE-DIMENSIONAL TRANSFORM FUNCTION This function transforms the source spectrum.
void SetEnhanceCoeff(Double_t enhanceCoeff)
SETTER FUNCION.
void FilterZonal(const Double_t *source, Double_t *destVector)
ONE-DIMENSIONAL FILTER ZONAL FUNCTION This function transforms the source spectrum.
Int_t GeneralInv(Double_t *working_space, Int_t num, Int_t degree, Int_t type)
AUXILIARY FUNCION // // This function calculates inverse generalized (mixed) transforms // Function p...
void SetRegion(Int_t xmin, Int_t xmax)
SETTER FUNCION.
void Haar(Double_t *working_space, Int_t num, Int_t direction)
AUXILIARY FUNCION // // This function calculates Haar transform of a part of data // Function paramet...
float xmax
Definition: THbookFile.cxx:93
void BitReverse(Double_t *working_space, Int_t num)
AUXILIARY FUNCION // // This function carries out bir-reverse reordering of data // Function paramete...
Int_t GeneralExe(Double_t *working_space, Int_t zt_clear, Int_t num, Int_t degree, Int_t type)
AUXILIARY FUNCION // // This function calculates generalized (mixed) transforms of different degrees/...
double Double_t
Definition: RtypesCore.h:55
int type
Definition: TGX11.cxx:120
The TH1 histogram class.
Definition: TH1.h:80
void SetFilterCoeff(Double_t filterCoeff)
SETTER FUNCION.
void Enhance(const Double_t *source, Double_t *destVector)
ONE-DIMENSIONAL ENHANCE ZONAL FUNCTION This function transforms the source spectrum.
void Fourier(Double_t *working_space, Int_t num, Int_t hartley, Int_t direction, Int_t zt_clear)
AUXILIARY FUNCION // // This function calculates Fourier based transform of a part of data // Functio...
void Walsh(Double_t *working_space, Int_t num)
AUXILIARY FUNCION // // This function calculates Walsh transform of a part of data // Function parame...
void SetDirection(Int_t direction)
SETTER FUNCION.
void BitReverseHaar(Double_t *working_space, Int_t shift, Int_t num, Int_t start)
AUXILIARY FUNCION // // This function carries out bir-reverse reordering for Haar transform // Functi...