BFieldPlugin.cxx
Go to the documentation of this file.
1 #include "BFieldPlugin.h"
2 
3 #include "Helpers/XmlHelper.h"
4 
5 #include "CoreUtils/ServiceUtil.h"
6 
7 namespace gar {
8  namespace gar_pandora {
9 
11  {
12  /* no op */
13  }
14 
15  //------------------------------------------------------------------------------------------------------------------------------------------
16 
17  float BFieldPlugin::GetBField(const pandora::CartesianVector &positionVector) const
18  {
19  auto const *fieldService = gar::providerFrom<mag::MagneticFieldService>();
20  G4ThreeVector PosVec(positionVector.GetX(), positionVector.GetY(), positionVector.GetZ());
21  G4ThreeVector magfield = fieldService->FieldAtPoint(PosVec);
22  return magfield[0];
23  }
24 
25  //------------------------------------------------------------------------------------------------------------------------------------------
26 
27  pandora::StatusCode BFieldPlugin::Initialize()
28  {
29  /* nop */
30  return pandora::STATUS_CODE_SUCCESS;
31  }
32 
33  //------------------------------------------------------------------------------------------------------------------------------------------
34 
35  pandora::StatusCode BFieldPlugin::ReadSettings(const pandora::TiXmlHandle /*xmlHandle*/)
36  {
37  /* nop */
38  return pandora::STATUS_CODE_SUCCESS;
39  }
40  }
41 }
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
float GetBField(const pandora::CartesianVector &positionVector) const
pandora::StatusCode Initialize()
General GArSoft Utilities.