Analysis  version 7.0 - august 2014
SpecHMean.hh
Go to the documentation of this file.
1 //======================================================================
2 /*! \file SpecHMean.hh
3  *
4  * Include file for class SpecHMean.
5  */
6 //======================================================================
7 
8 #ifndef SPEC_HMEAN_HH
9 #define SPEC_HMEAN_HH
10 
11 #include "SpecHSum.hh"
12 
13 
14 //======================================================================
15 /*! \class SpecHMean
16  *
17  * The class is used to cumulated other spectra or histograms and
18  * divide by the number of incrementations.
19  */
20 class SpecHMean : public SpecHSum
21 {
22 //----------------------------------------------------------------------
23  /*! \object_doc */
25 //----------------------------------------------------------------------
26 
27  protected:
28  TH1 * histo_sum; ///< Pointer to the intermediate cumulated histogram
29  int incr_count; ///< Number of incrementation occurences
30 
31  public:
32 
33 //----------------------------------------------------------------------
34 // CONSTRUCTEUR / AFFECTATION / DESTRUCTEUR
35 //----------------------------------------------------------------------
36 
37  // Constructor
38  SpecHMean ( const string & spec_name, Spectrum * spec );
39  SpecHMean ( const string & spec_name, const TH1 * hptr );
40 
41  // Copy constructor
42  SpecHMean ( const SpecHMean & original );
43 
44  // Destructorr
45  virtual ~SpecHMean ();
46 
47 //----------------------------------------------------------------------
48 
49  protected:
50  virtual TH1 * SetHistoMean ( const TH1 * hptr = NULL );
51 
52  virtual void Reset ( );
53 
54  // incrémentation auto du spectre
55  virtual void IncrementSpectrum ( );
56 
57  public:
58 
59  // Retourne l'identificateur du type de spectre.
60  u_int TypeId ( ) const;
61 
62  // Retourne le nom du type de spectre.
63  string Type ( ) const;
64 
65  const TH1 * GetSumHisto ( ) const; // inline
66  u_int GetIncrementCount ( );
67 
68  // Définition d'un spectre de type donné static Spectrum * NewSpectrumDef ( const string & name, const string & defstr, const EventManager * evt_mgr, int & error ); //---------------------------------------------------------------------- // pour ROOT... public: /*! Définition à usage de ROOT... */ ClassDef(SpecHMean,0); } ; //====================================================================== // METHODES INLINE //====================================================================== /*! Retourne l'identificateur du type de spectre. */ inline u_int SpecHMean::TypeId ( ) const { return (spectrumTypeHMean); } /*! Retourne le nom du type de spectre. */ inline string SpecHMean::Type ( ) const { return (SPECTRUM_TYPE_TXT_HMEAN); } /*! Return the number of incrementations for the average.*/ inline u_int SpecHMean::GetIncrementCount ( ) { return ( incr_count ); } /*! Returns the pointer to the summed histogram for the spectrum.*/ inline const TH1 * SpecHMean::GetSumHisto ( ) const { return ( histo_sum ); } //====================================================================== #endif
69  static Spectrum * NewSpectrumDef ( const string & name,
70  const string & defstr,
71  const EventManager * evt_mgr,
72  int & error );
73 
74 
75 //----------------------------------------------------------------------
76 // pour ROOT...
77  public:
78  /*! Définition à usage de ROOT... */
80 } ;
81 
82 
83 //======================================================================
84 // METHODES INLINE
85 //======================================================================
86 
87 /*! Retourne l'identificateur du type de spectre.
88  */
89 inline u_int SpecHMean::TypeId ( ) const
90  { return (spectrumTypeHMean); }
91 
92 /*! Retourne le nom du type de spectre.
93  */
94 inline string SpecHMean::Type ( ) const
95  { return (SPECTRUM_TYPE_TXT_HMEAN); }
96 
97 /*! Return the number of incrementations for the average.*/
99  { return ( incr_count ); }
100 
101 /*! Returns the pointer to the summed histogram for the spectrum.*/
102 inline const TH1 * SpecHMean::GetSumHisto ( ) const
103  { return ( histo_sum ); }
104 
105 
106 //======================================================================
107 #endif
Definition: SpecHMean.hh:20
int incr_count
Number of incrementation occurences.
Definition: SpecHMean.hh:29
Definition: SpecHSum.hh:19
virtual void IncrementSpectrum()
Definition: SpecHMean.cpp:89
string Type() const
Definition: SpecHMean.hh:94
Definition: Spectrum.hh:222
ClassDef(SpecHMean, 0)
virtual TH1 * SetHistoMean(const TH1 *hptr=NULL)
Definition: SpecHMean.cpp:68
#define SPECTRUM_TYPE_TXT_HMEAN
Nom du type de spectre: event by event averaged histogram.
Definition: Spectrum.hh:118
virtual ~SpecHMean()
Definition: SpecHMean.cpp:58
const TH1 * GetSumHisto() const
Definition: SpecHMean.hh:102
GObject(SpecHMean)
static Spectrum * NewSpectrumDef(const string &name, const string &defstr, const EventManager *evt_mgr, int &error)
Definition: SpecHMean.cpp:125
virtual void Reset()
Definition: SpecHMean.cpp:105
u_int TypeId() const
Definition: SpecHMean.hh:89
TH1 * histo_sum
Pointer to the intermediate cumulated histogram.
Definition: SpecHMean.hh:28
u_int GetIncrementCount()
Definition: SpecHMean.hh:98
Definition: EventManager.hh:59
SpecHMean(const string &spec_name, Spectrum *spec)
Definition: SpecHMean.cpp:20