PandaRoot
CAFieldValue.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 //-*- Mode: C++ -*-
14 // *****************************************************************************
15 // *
16 // @Autors: I.Kulakov; M.Zyzak; I.Kisel *
17 // @e-mail: I.Kulakov@gsi.de; M.Zyzak@gsi.de; I.Kisel@compeng.uni-frankfurt.de *
18 // *
19 // *****************************************************************************
20 
21 #ifndef CAFieldValue_H
22 #define CAFieldValue_H
23 
24 #ifdef PANDA_FTS
25 
26 class CAFieldValue {
27 
28  //* parameters of the magnetic field
29 
30  public:
31  CAFieldValue() : x(Vc::Zero), y(Vc::Zero), z(Vc::Zero){};
32 
33  float_v x, y, z;
34 
35  void Combine(CAFieldValue &B, float_v w)
36  {
37  x += w * (B.x - x);
38  y += w * (B.y - y);
39  z += w * (B.z - z);
40  }
41 
42  void UpdateValue(const CAFieldValue &B, const float_m &mask)
43  {
44  x(mask) = B.x;
45  y(mask) = B.y;
46  z(mask) = B.z;
47  };
48 
49  friend ostream &operator<<(ostream &out, CAFieldValue &B) { return out << B.x << endl << B.y << endl << B.z << endl; };
50 };
51 
52 #else // PANDA_FTS
53 
54 struct CAFieldValue {
55  public:
56  CAFieldValue() : fcBz(0) {}
57 
58  CAFieldValue(float f) : fcBz(f) {}
59  operator float() const { return fcBz; }
60 
61  private:
62  float fcBz;
63 };
64 
65 #endif // PANDA_FTS
66 
67 #endif
std::ostream & operator<<(std::ostream &o, const PndEventInfo &)
float f
Definition: P4_F32vec4.h:32
basic_ostream< char, char_traits< char > > ostream
CAFieldValue(float f)
Definition: CAFieldValue.h:58