BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Calibration/CalibData/include/CalibData/RangeBase.h
Go to the documentation of this file.
1// $Header: /bes/bes/BossCvs/Calibration/CalibData/CalibData/RangeBase.h,v 1.1.1.1 2005/10/17
2// 06:13:32 maqm Exp $
3#ifndef CalibData_RangeBase_h
4#define CalibData_RangeBase_h
5namespace CalibData {
6
7 /**
8 Base class for per crystal-face-range Calorimeter calibration data
9 or for per tile-pmt-range ACD calibration data
10 */
11 class RangeBase {
12
13 public:
15 virtual ~RangeBase() {}
16
17 /// Derived classes will do a dynamic cast of argument, which
18 /// must be of same type, and then a deep copy.
19 virtual void update( RangeBase* ) {}
20
21 // Only put in default impl. because not all derived classes need
22 // to do this at all. Don't force them to put in dummy definition.
23 // Otherwise would be pure virtual, since derived classes which do
24 // need this have to do it themselves.
25 // Might be better to do this with a factory pattern.
26 virtual void makeNew( RangeBase** ) {}
27 };
28
29 /**
30 Generally speaking each value in a calorimeter calibration comes
31 with an associated uncertainty. Put them together with this
32 little class
33 */
34
35 class ValSig {
36 public:
37 ValSig( float val = -1, float sig = -1 ) : m_val( val ), m_sig( sig ) {}
38 ValSig( const ValSig& other ) {
39 m_val = other.m_val;
40 m_sig = other.m_sig;
41 }
42 bool isDefined() const { return ( m_sig >= 0.0 ); }
43 float getVal() const { return m_val; }
44 float getSig() const { return m_sig; }
45
46 void setUndefined() {
47 m_val = -1.0;
48 m_sig = -1;
49 }
50 float m_val;
51 float m_sig;
52 };
53} // namespace CalibData
54#endif