GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Counter.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2004 by Olivier Stezowski *
3  * stezow(AT)ipnl.in2p3.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * aLong_t with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 
23 #ifndef ADF_Counter
24 #define ADF_Counter
25 #define ADF_COUNTER_H ADF_Counter
26 
27 #ifndef ADF_ADFConfig
28 #include "ADFConfig.h"
29 #endif
30 
31 #include <iostream>
32 #include <string>
33 
34 namespace ADF
35 {
36 
38 
42 class Counter
43 {
44 private:
45  Double_t fRangeMin, fRangeMax;
46 private:
47  std::string fUnits;
48 private:
49  ULong64_t fN;
50  Double_t fValue, fValueMin, fValueMax;
51 
52 public:
53  Counter(Double_t, Double_t, const Char_t *unit = "");
54  virtual ~Counter() {;}
55 
56  Double_t GetValue() const { return fValue; }
57 
58  Double_t GetMean() const { if ( fN == 0uL ) return 0.0; return fValue/fN; }
59  Double_t GetMin() const { return fValueMin; };
60  Double_t GetMax() const { return fValueMax; };
61 
62  void operator +=(Double_t value);
63  void operator ++() { fN++; }
64 
65  void operator =(const Counter &);
66 
67  void Print(std::ostream &out = std::cout) const;
68 };
69 
70 } // namespace ADF
71 #endif
72 
void operator=(const Counter &)
Definition: Counter.cpp:41
void operator++()
Definition: Counter.h:63
A Counter.
Definition: Counter.h:42
UInt_t value[MaxValue]
Definition: ReadDaqAlone.C:29
Counter(Double_t, Double_t, const Char_t *unit="")
Definition: Counter.cpp:29
Double_t GetMean() const
Definition: Counter.h:58
Double_t GetValue() const
Definition: Counter.h:56
Double_t GetMax() const
Definition: Counter.h:60
void operator+=(Double_t value)
Definition: Counter.cpp:32
to set informations about the ADF configuration
virtual ~Counter()
Definition: Counter.h:54
void Print(std::ostream &out=std::cout) const
Definition: Counter.cpp:53
Double_t GetMin() const
Definition: Counter.h:59