PandaRoot
CAFieldValue.h
Go to the documentation of this file.
1 //-*- Mode: C++ -*-
2 // *****************************************************************************
3 // *
4 // @Autors: I.Kulakov; M.Zyzak; I.Kisel *
5 // @e-mail: I.Kulakov@gsi.de; M.Zyzak@gsi.de; I.Kisel@compeng.uni-frankfurt.de *
6 // *
7 // *****************************************************************************
8 
9 #ifndef CAFieldValue_H
10 #define CAFieldValue_H
11 
12 #ifdef PANDA_FTS
13 
14 class CAFieldValue {
15 
16  //* parameters of the magnetic field
17 
18  public:
19  CAFieldValue() : x(Vc::Zero), y(Vc::Zero), z(Vc::Zero){};
20 
21  float_v x, y, z;
22 
23  void Combine(CAFieldValue &B, float_v w)
24  {
25  x += w * (B.x - x);
26  y += w * (B.y - y);
27  z += w * (B.z - z);
28  }
29 
30  void UpdateValue(const CAFieldValue &B, const float_m &mask)
31  {
32  x(mask) = B.x;
33  y(mask) = B.y;
34  z(mask) = B.z;
35  };
36 
37  friend ostream &operator<<(ostream &out, CAFieldValue &B) { return out << B.x << endl << B.y << endl << B.z << endl; };
38 };
39 
40 #else // PANDA_FTS
41 
42 struct CAFieldValue {
43  public:
44  CAFieldValue() : fcBz(0) {}
45 
46  CAFieldValue(float f) : fcBz(f) {}
47  operator float() const { return fcBz; }
48 
49  private:
50  float fcBz;
51 };
52 
53 #endif // PANDA_FTS
54 
55 #endif
std::ostream & operator<<(std::ostream &o, const PndEventInfo &)
float f
Definition: P4_F32vec4.h:20
basic_ostream< char, char_traits< char > > ostream
CAFieldValue(float f)
Definition: CAFieldValue.h:46