BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcPatRec/PatBField/src/BField.cxx
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: BField.cxx,v 1.2 2008/09/17 08:30:39 zhangy Exp $
4//
5// Description:
6// Class BField; encapsulates the magnetic field.
7//
8// See header for more info.
9//
10// Environment:
11// Software developed for the BESIII Detector at BEPCII
12//
13// Author List:
14// Bob Jacobsen Original Author
15// Zhang Yao Only keep nominal field
16//
17// Copyright Information:
18// Copyright (C) 1995 Lawrence Berkeley Laboratory
19//
20//------------------------------------------------------------------------
21
22//-----------------------
23// This Class's Header --
24//-----------------------
25#include "PatBField/BField.h"
26#include "MdcGeom/Constants.h"
27#include <iostream>
28
30
31const double BField::cmTeslaToGeVc = Constants::c / 1.0E13;
32const double BField::gaussToTesla = 1000.;
33
34// constructor
35BField::BField( IBesMagFieldSvc* magSvc ) { m_pIMF = magSvc; }
36
37// destroy
39
40// field z of nominal field
41double BField::bFieldZ() const { return m_pIMF->getReferField() * gaussToTesla; }
42
43void BField::print() const {
44 std::cout << "Default constant field" << std::endl;
45 std::cout << "nominal Field: " << bFieldNominal() << std::endl;
46}
47
48double BField::bFieldNominal() const { return bFieldZ(); }
virtual double getReferField()=0