CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
sim::Field Class Referencefinal

#include <Field.h>

Inheritance diagram for sim::Field:

Public Member Functions

 Field (const MagneticField *f, double d)
 
void GetFieldValue (const G4double p[], G4double b[3]) const override
 
 ~Field () override
 

Private Attributes

double oldb [3]
 
double oldx [3]
 
const MagneticFieldtheCMSMagneticField
 
double theDelta
 

Detailed Description

Definition at line 13 of file Field.h.

Constructor & Destructor Documentation

◆ Field()

Field::Field ( const MagneticField f,
double  d 
)

Definition at line 10 of file Field.cc.

References mps_fire::i, oldb, and oldx.

10  : G4MagneticField(), theCMSMagneticField(f), theDelta(d) {
11  for (int i = 0; i < 3; ++i) {
12  oldx[i] = 1.0e12;
13  oldb[i] = 0.0;
14  }
15 }
const MagneticField * theCMSMagneticField
Definition: Field.h:20
double oldb[3]
Definition: Field.h:24
double f[11][100]
d
Definition: ztail.py:151
double theDelta
Definition: Field.h:21
double oldx[3]
Definition: Field.h:23

◆ ~Field()

Field::~Field ( )
override

Definition at line 17 of file Field.cc.

17 {}

Member Function Documentation

◆ GetFieldValue()

void sim::Field::GetFieldValue ( const G4double  p[],
G4double  b[3] 
) const
inlineoverride

Definition at line 28 of file Field.h.

References funct::abs(), ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), MagneticField::inTesla(), oldb, oldx, theCMSMagneticField, theDelta, and findQualityFiles::v.

28  {
29  if (std::abs(oldx[0] - xyz[0]) > theDelta || std::abs(oldx[1] - xyz[1]) > theDelta ||
30  std::abs(oldx[2] - xyz[2]) > theDelta) {
31  constexpr float lunit = (1.0 / CLHEP::cm);
32  GlobalPoint ggg((float)(xyz[0]) * lunit, (float)(xyz[1]) * lunit, (float)(xyz[2]) * lunit);
34 
35  constexpr float btesla = CLHEP::tesla;
36  oldb[0] = (v.x() * btesla);
37  oldb[1] = (v.y() * btesla);
38  oldb[2] = (v.z() * btesla);
39  oldx[0] = xyz[0];
40  oldx[1] = xyz[1];
41  oldx[2] = xyz[2];
42  }
43 
44  bfield[0] = oldb[0];
45  bfield[1] = oldb[1];
46  bfield[2] = oldb[2];
47 }
const MagneticField * theCMSMagneticField
Definition: Field.h:20
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
double oldb[3]
Definition: Field.h:24
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double theDelta
Definition: Field.h:21
double oldx[3]
Definition: Field.h:23

Member Data Documentation

◆ oldb

double sim::Field::oldb[3]
mutableprivate

Definition at line 24 of file Field.h.

Referenced by Field(), and GetFieldValue().

◆ oldx

double sim::Field::oldx[3]
mutableprivate

Definition at line 23 of file Field.h.

Referenced by Field(), and GetFieldValue().

◆ theCMSMagneticField

const MagneticField* sim::Field::theCMSMagneticField
private

Definition at line 20 of file Field.h.

Referenced by GetFieldValue().

◆ theDelta

double sim::Field::theDelta
private

Definition at line 21 of file Field.h.

Referenced by GetFieldValue().