Project
Loading...
Searching...
No Matches
ALICE3MagneticField.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
15
16#ifndef ALICEO2_FIELD_ALICE3MAGNETICFIELD_H_
17#define ALICEO2_FIELD_ALICE3MAGNETICFIELD_H_
18
19#include "FairField.h" // for FairField
20#include "Rtypes.h" // for ClassDef
21
22namespace o2
23{
24namespace field
25{
26
30{
31 public:
33 {
34 fType = 2;
35 init();
36 }
37
38 ~ALICE3MagneticField() override = default;
39
41 Double_t GetBx(Double_t x, Double_t y, Double_t z) override
42 {
43 double xyz[3] = {x, y, z}, b[3];
45 return b[0];
46 }
47
49 Double_t GetBy(Double_t x, Double_t y, Double_t z) override
50 {
51 double xyz[3] = {x, y, z}, b[3];
53 return b[1];
54 }
55
57 Double_t GetBz(Double_t x, Double_t y, Double_t z) override
58 {
59 double xyz[3] = {x, y, z}, b[3];
61 return b[2];
62 }
63
66 void Field(const Double_t* __restrict__ point, Double_t* __restrict__ bField) override;
67
68 private:
69 // defining a function type, that could be initialized during runtime from a ROOT macro
70 // to ease fast R&D prototyping
71 typedef std::function<void(const double* __restrict__, double* __restrict__)> FieldEvalFcn;
72 FieldEvalFcn mJITFieldFunction;
73
74 void init();
75 void initJITFieldFunction();
76
77 // ClassDefOverride(o2::field::ALICE3MagneticField, 1)
78};
79
80} // end namespace field
81} // end namespace o2
82
83#endif
Double_t GetBx(Double_t x, Double_t y, Double_t z) override
X component, avoid using since slow.
Double_t GetBy(Double_t x, Double_t y, Double_t z) override
Y component, avoid using since slow.
~ALICE3MagneticField() override=default
void Field(const Double_t *__restrict__ point, Double_t *__restrict__ bField) override
Double_t GetBz(Double_t x, Double_t y, Double_t z) override
Z component.
GLint GLenum GLint x
Definition glcorearb.h:403
GLboolean GLboolean GLboolean b
Definition glcorearb.h:1233
GLint y
Definition glcorearb.h:270
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...