Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:18:26

0001 /* Copyright 2008-2010, Technische Universitaet Muenchen,
0002    Authors: Christian Hoeppner & Sebastian Neubert & Johannes Rauch
0003 
0004    This file is part of GENFIT.
0005 
0006    GENFIT is free software: you can redistribute it and/or modify
0007    it under the terms of the GNU Lesser General Public License as published
0008    by the Free Software Foundation, either version 3 of the License, or
0009    (at your option) any later version.
0010 
0011    GENFIT is distributed in the hope that it will be useful,
0012    but WITHOUT ANY WARRANTY; without even the implied warranty of
0013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014    GNU Lesser General Public License for more details.
0015 
0016    You should have received a copy of the GNU Lesser General Public License
0017    along with GENFIT.  If not, see <http://www.gnu.org/licenses/>.
0018 */
0019 
0020 
0021 #include "GFRaveMagneticField.h"
0022 #include <FieldManager.h>
0023 
0024 #include <iostream>
0025 
0026 
0027 namespace genfit {
0028 
0029 GFRaveMagneticField *
0030 GFRaveMagneticField::copy() const{
0031   return new GFRaveMagneticField(*this);
0032 }
0033 
0034 
0035 rave::Vector3D
0036 GFRaveMagneticField::inTesla ( const rave::Point3D & position) const
0037 {
0038   TVector3 pos(position.x(), position.y(), position.z());
0039 
0040   TVector3 B = FieldManager::getInstance()->getFieldVal(pos); // magnetic field in kGauss
0041   B *= 1.E-1;
0042 
0043   return rave::Vector3D (B.X(), B.Y(), B.Z());
0044 }
0045 
0046 
0047 } /* End of namespace genfit */