ATLAS Offline Software
BFieldCacheZR.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //
6 // BFieldCacheZR.h
7 //
8 // Cashe of one bin of the magnetic field map.
9 // Defined by ranges in z, r, and the (Bz, Br) vectors at the 4 corners of the
10 // "bin".
11 //
12 // Masahiro Morii, Harvard University
13 //
14 #ifndef BFIELDCACHEZR_H
15 #define BFIELDCACHEZR_H
16 
18 #include "CxxUtils/restrict.h"
19 #include <cmath>
20 
22 {
23 public:
24  // invalidate this cache, so that inside() will fail
25  void invalidate();
26  // set the z, r range that defines the bin
27  void setRange(double zmin, double zmax, double rmin, double rmax);
28  // set the field values at each corner (rescale for current scale factor)
29  void setField(int i, const BFieldVectorZR& field, double scaleFactor = 1.0);
30  // set the multiplicative factor for the field vectors
31  // test if (z, r) is inside this bin
32  bool inside(double z, double r) const;
33  // interpolate the field and return B[3].
34  // also compute field derivatives if deriv[9] is given.
35  void getB(const double* ATH_RESTRICT xyz,
36  double r,
37  double* ATH_RESTRICT B,
38  double* ATH_RESTRICT deriv = nullptr) const;
39 
40 private:
41  // default unphysical boundaries, so that inside() will fail
42  double m_zmin{0}, m_zmax{-1}; // bin range in z
43  double m_rmin{0}, m_rmax{-1}; // bin range in r
44  double m_invz{-1}, m_invr{-1}; // 1/(bin size) in z, r
45  double m_field[2][4]; // (Bz,Br) at 4 corners of the bin
46 };
48 #endif
beamspotman.r
def r
Definition: beamspotman.py:676
PixelAthClusterMonAlgCfg.zmin
zmin
Definition: PixelAthClusterMonAlgCfg.py:169
BFieldCacheZR::m_field
double m_field[2][4]
Definition: BFieldCacheZR.h:45
xyz
#define xyz
ReadOfcFromCool.field
field
Definition: ReadOfcFromCool.py:48
BFieldCacheZR::setField
void setField(int i, const BFieldVectorZR &field, double scaleFactor=1.0)
ATH_RESTRICT
#define ATH_RESTRICT
Definition: restrict.h:31
BFieldCacheZR::m_zmin
double m_zmin
Definition: BFieldCacheZR.h:42
BFieldCacheZR::m_rmax
double m_rmax
Definition: BFieldCacheZR.h:43
lumiFormat.i
int i
Definition: lumiFormat.py:85
z
#define z
BFieldCacheZR::m_invr
double m_invr
Definition: BFieldCacheZR.h:44
BFieldCacheZR::getB
void getB(const double *ATH_RESTRICT xyz, double r, double *ATH_RESTRICT B, double *ATH_RESTRICT deriv=nullptr) const
Definition: BFieldCacheZR.cxx:9
PixelAthClusterMonAlgCfg.zmax
zmax
Definition: PixelAthClusterMonAlgCfg.py:169
BFieldCacheZR
Definition: BFieldCacheZR.h:22
BFieldVectorZR.h
BFieldCacheZR::inside
bool inside(double z, double r) const
BFieldCacheZR::m_zmax
double m_zmax
Definition: BFieldCacheZR.h:42
BFieldCacheZR.icc
restrict.h
Macro wrapping the nonstandard restrict keyword.
dqt_zlumi_alleff_HIST.B
B
Definition: dqt_zlumi_alleff_HIST.py:110
BFieldCacheZR::m_invz
double m_invz
Definition: BFieldCacheZR.h:44
BFieldCacheZR::setRange
void setRange(double zmin, double zmax, double rmin, double rmax)
BFieldCacheZR::m_rmin
double m_rmin
Definition: BFieldCacheZR.h:43
BFieldCacheZR::invalidate
void invalidate()
BFieldVectorZR
Definition: BFieldVectorZR.h:19