// $Id$ // // File: DMagneticFieldMapPSConst.cc // #include using namespace std; #include "DMagneticFieldMapPSConst.h" //--------------------------------- // DMagneticFieldMapPSConst (Constructor) //--------------------------------- DMagneticFieldMapPSConst::DMagneticFieldMapPSConst(JApplication *japp, string namepath) { int runnumber = 1; jcalib = japp->GetJCalibration(runnumber); if(GetValues(namepath, runnumber)==0){ _DBG_<<"Error getting JCalibration object for magnetic field!"<Quit(); } } //--------------------------------- // DMagneticFieldMapPSConst (Constructor) //--------------------------------- DMagneticFieldMapPSConst::DMagneticFieldMapPSConst(JCalibration *jcalib, string namepath) { this->jcalib = jcalib; if(GetValues(namepath)==0){ _DBG_<<"Error getting JCalibration object for magnetic field!"<jcalib = NULL; this->Bx = Bx; this->By = By; this->Bz = Bz; } //--------------------------------- // ~DMagneticFieldMapPSConst (Destructor) //--------------------------------- DMagneticFieldMapPSConst::~DMagneticFieldMapPSConst() { } //--------------------------------- // GetValues //--------------------------------- int DMagneticFieldMapPSConst::GetValues(string namepath, int runnumber, string context) { /// Read the parameters for the constant magnetic field map from the calibration database. if(!jcalib)return 0; cout<<"Reading Constant Magnetic field values from "< vals; jcalib->Get(namepath, vals); if(vals.size()==0)return 0; Bx = vals["Bx"]; By = vals["By"]; Bz = vals["Bz"]; cout<<" Bx="<