00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 void test_magF()
00015 {
00016
00017 gROOT->Reset();
00018
00019 if (gClassTable->GetID("TTable") < 0) gSystem->Load("libStar");
00020 gSystem->Load("St_base");
00021 gSystem->Load("StChain");
00022 gSystem->Load("St_Tables");
00023 gSystem->Load("StUtilities");
00024 gSystem->Load("StarMagField");
00025 gSystem->Load("StMagF");
00026 gSystem->Load("StDetectorDbMaker.so");
00027 gSystem->Load("StTpcDb");
00028 gSystem->Load("StDbUtilities");
00029 gSystem->Load("StDbLib");
00030 gSystem->Load("StDbBroker");
00031 gSystem->Load("St_db_Maker");
00032 gSystem->Load("StarClassLibrary");
00033 gSystem->Load("StEvent");
00034 gSystem->Load("StFtpcLaserMaker");
00035 gSystem->Load("libftpc_Tables");
00036 gSystem->Load("StFtpcClusterMaker");
00037 gSystem->Load("StFtpcTrackMaker");
00038
00039
00040
00041
00042
00043
00044 Float_t pt[3] = new Float_t;
00045 Float_t B[3] = new Float_t;
00046
00047
00048
00049 Float_t Br=0;
00050 Float_t Bz=0;
00051
00052 for (int i=0;i<3;i++)
00053 {
00054 pt[i]=B[i]=0;
00055
00056 }
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066 cout<<endl;
00067
00068
00069 StMagUtilities *magf=new StMagUtilities(2,1,0);
00070
00071
00072
00073
00074
00075 cout<<endl;
00076
00077 cout<<"2D B-field :"<<endl;
00078 magf->BField(&pt[],&B[]);
00079 cout<<endl;
00080
00081 printf(" xyz = %7.2f %7.2f %7.2f Bxyz= %7.4f %7.4f %7.4f \n", pt[0],pt[1],pt[2],B[0],B[1],B[2]);
00082
00083 Float_t r=0;
00084 const Float_t z=275;
00085
00086 cout<<endl;
00087 for (int k=0;k<31;k++)
00088 {
00089 r=(float) k;
00090 magf->BrBzField(r,z,Br,Bz);
00091
00092
00093
00094 }
00095
00096 cout<<endl;
00097
00098
00099
00100 for (int i=0;i<3;i++)
00101 {
00102 pt[i]=B[i]=0;
00103
00104 }
00105
00106 cout<<"3D B-field :"<<endl;
00107 magf->B3DField(&pt[],&B[]);
00108
00109 cout<<endl;
00110
00111 printf(" xyz = %7.2f %7.2f %7.2f Bxyz= %7.4f %7.4f %7.4f \n", pt[0],pt[1],pt[2],B[0],B[1],B[2]);
00112
00113 cout<<endl;
00114 delete magf;
00115
00116 }