FairRoot/PandaRoot
PndFieldAdaptor.cxx
Go to the documentation of this file.
1 //-----------------------------------------------------------
2 // File and Version Information:
3 // $Id$
4 //
5 // Description:
6 // Implementation of class PndFieldAdaptor
7 // see PndFieldAdaptor.hh for details
8 //
9 // Environment:
10 // Software developed for the PANDA Detector at FAIR.
11 //
12 // Author List:
13 // Sebastian Neubert TUM (original author)
14 //
15 //
16 //-----------------------------------------------------------
17 
18 // Panda Headers ----------------------
19 
20 // This Class' Header ------------------
21 #include "PndFieldAdaptor.h"
22 
23 // C/C++ Headers ----------------------
24 #include "assert.h"
25 #include<iostream>
26 
27 // Collaborating Class Headers --------
28 #include "FairField.h"
29 
30 // Class Member definitions -----------
31 
32 
34  : fField(field)
35 {}
36 
37 TVector3
38 PndFieldAdaptor::get(const TVector3& pos) const {
39  assert(fField!=NULL);
40  Double_t x[3];
41  x[0] = pos.X();
42  x[1] = pos.Y();
43  x[2] = pos.Z();
44 
45  Double_t f[3];
46  fField->GetFieldValue(x,f);
47  //std::cout << "PndFieldAdapter::get() field at "
48  // <<x[0]<<","<<x[1]<<","<<x[2]<<" has value "
49  // <<f[0]<<","<<f[1]<<","<<f[2]<<std::endl;
50  return TVector3(f[0],f[1],f[2]);
51 }
52 
TVector3 pos
PndMultiField * fField
Definition: sim_emc_apd.C:97
FairField * fField
Double_t
TFile * f
Definition: bump_analys.C:12
Double_t x
ClassImp(PndAnaContFact)
TVector3 get(const TVector3 &) const
override this is you concrete implementation