CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
Calibration/CalibData/CalibData-00-01-09/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 06:13:32 maqm Exp $
2#ifndef CalibData_RangeBase_h
3#define CalibData_RangeBase_h
4namespace CalibData {
5
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 /**
31 Generally speaking each value in a calorimeter calibration comes
32 with an associated uncertainty. Put them together with this
33 little class
34 */
35
36 class ValSig {
37 public:
38 ValSig(float val=-1, float sig=-1) : m_val(val), m_sig(sig) {}
39 ValSig(const ValSig& other) {m_val = other.m_val; m_sig = other.m_sig;}
40 bool isDefined( ) const {return (m_sig >= 0.0); }
41 float getVal() const {return m_val;}
42 float getSig() const {return m_sig;}
43
44 void setUndefined() {m_val= -1.0; m_sig = -1;}
45 float m_val;
46 float m_sig;
47 };
48}
49#endif