// $Id$ // // File: DMagneticFieldMapConst.cc // Created: Fri Nov 7 04:01:28 EST 2008 // Creator: davidl (on Darwin Amelia.local 8.11.1 i386) // #include using namespace std; #include "DMagneticFieldMapConst.h" //--------------------------------- // DMagneticFieldMapConst (Constructor) //--------------------------------- DMagneticFieldMapConst::DMagneticFieldMapConst(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(); } } //--------------------------------- // DMagneticFieldMapConst (Constructor) //--------------------------------- DMagneticFieldMapConst::DMagneticFieldMapConst(JCalibration *jcalib, string namepath) { this->jcalib = jcalib; if(GetValues(namepath)==0){ _DBG_<<"Error getting JCalibration object for magnetic field!"<jcalib = NULL; this->Br = Br; this->Bphi = Bphi; this->Bz = Bz; } //--------------------------------- // ~DMagneticFieldMapConst (Destructor) //--------------------------------- DMagneticFieldMapConst::~DMagneticFieldMapConst() { } //--------------------------------- // GetValues //--------------------------------- int DMagneticFieldMapConst::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; Br = vals["Br"]; Bphi = vals["Bphi"]; Bz = vals["Bz"]; cout<<" Br="<