1 |
#ifndef PAMVMCFIELDMGR_H |
#ifndef PAMVMCFIELDMGR_H |
2 |
#define PAMVMCFIELDMGR_H |
#define PAMVMCFIELDMGR_H |
3 |
#include <iostream> |
#include <iostream> |
4 |
|
#include <RVersion.h> |
5 |
|
|
6 |
#include "TString.h" |
#include "TString.h" |
7 |
|
|
17 |
#include "TrkParams.h" |
#include "TrkParams.h" |
18 |
#endif |
#endif |
19 |
|
|
|
class PamVMCFieldMgr: public TObject { |
|
20 |
|
|
21 |
|
#if ROOT_VERSION_CODE >= 333572 |
22 |
|
#include <TVirtualMagField.h> |
23 |
|
class PamVMCFieldMgr: public TVirtualMagField |
24 |
|
#else |
25 |
|
class PamVMCFieldMgr: public TObject |
26 |
|
#endif |
27 |
|
{ |
28 |
private: |
private: |
29 |
|
|
30 |
static PamVMCFieldMgr * fm; |
static PamVMCFieldMgr * fm; |
51 |
#endif |
#endif |
52 |
} |
} |
53 |
|
|
|
void Field(const Double_t* x, Double_t* b) const { |
|
|
|
|
54 |
|
|
55 |
|
void Field(const Double_t* x, Double_t* B) { |
56 |
|
|
57 |
#ifdef PAMFIELD |
#ifdef PAMFIELD |
58 |
float xm[3]={x[0],x[1],x[2]-ZCAL-CALS3-ZSPEBP-HORMG}; |
float xm[3]={x[0],x[1],x[2]-ZCAL-CALS3-ZSPEBP-HORMG}; |
59 |
|
|
60 |
b[0] = TrkParams::GetBX((float *)xm)*10; |
B[0] = TrkParams::GetBX((float *)xm)*10; |
61 |
b[1] = TrkParams::GetBY((float *)xm)*10; |
B[1] = TrkParams::GetBY((float *)xm)*10; |
62 |
b[2] = TrkParams::GetBZ((float *)xm)*10; |
B[2] = TrkParams::GetBZ((float *)xm)*10; |
63 |
|
|
64 |
#else |
#else |
65 |
if(x) { |
if(x) { |
66 |
for (Int_t i=0; i<3; i++) b[i] = 0.0; |
for (Int_t i=0; i<3; i++) B[i] = 0.0; |
67 |
} else { |
} else { |
68 |
b[0]=b[1]=b[2]=0.0; |
B[0]=B[1]=B[2]=0.0; |
69 |
} |
} |
70 |
#endif |
#endif |
71 |
|
|
72 |
} |
} |
73 |
|
|
74 |
void Field(const Float_t* x, Float_t* b) const { |
|
75 |
|
void Field(const Float_t* x, Float_t* b) { |
76 |
|
|
77 |
|
|
78 |
#ifdef PAMFIELD |
#ifdef PAMFIELD |
81 |
b[0] = TrkParams::GetBX((float *)xm)*10; |
b[0] = TrkParams::GetBX((float *)xm)*10; |
82 |
b[1] = TrkParams::GetBY((float *)xm)*10; |
b[1] = TrkParams::GetBY((float *)xm)*10; |
83 |
b[2] = TrkParams::GetBZ((float *)xm)*10; |
b[2] = TrkParams::GetBZ((float *)xm)*10; |
84 |
|
|
85 |
#else |
#else |
86 |
if(x) { |
if(x) { |
87 |
for (Int_t i=0; i<3; i++) b[i] = 0.0; |
for (Int_t i=0; i<3; i++) b[i] = 0.0; |
88 |
} else { |
} else { |
89 |
b[0]=b[1]=b[2]=0.0; |
b[0]=b[1]=b[2]=0.0; |
90 |
} |
} |
91 |
#endif |
#endif |
92 |
|
|
93 |
} |
} |
94 |
|
|
95 |
}; |
}; |
96 |
|
|
97 |
#endif |
#endif |