/[PAMELA software]/PamCAL/field.C
ViewVC logotype

Contents of /PamCAL/field.C

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Mon Nov 12 10:19:53 2007 UTC (17 years ago) by nikolas
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/plain
adding more and more files

1
2 void BX ( Double_t &K){
3 return pamfield->GetBX((float *)K)
4 }
5
6 void Field(){
7 TString PL = gSystem->Getenv("PAM_LIB");
8 gSystem->Load(PL+"/libyoda.so");
9 gSystem->Load(PL+"/libDarthVader.so");
10 gSystem->Load(PL+"/libPamLevel2.so");
11 TString Calib=gSystem->Getenv("PAM_CALIB");
12 TrkLevel2* pamfield = new TrkLevel2();
13 pamfield->LoadField(Calib+"/trk-param/field_param-0/");
14 //Double_t K[3]=(.0,.0,-30.);
15 // pamfield->GetBX((float *)x);
16 // pamfield->GetBY((float *)x);
17 // pamfield->GetBZ((float *)x);
18 const Int_t n = 200;
19 Double_t x[n];
20 Double_t Bx[n];
21 Double_t By[n];
22 Double_t Bz[n];
23 Double_t K[3]=(.0,.0,.0);
24 for (Int_t i=0; i<n; i++){
25 x[i]=-100+i;
26
27
28 // K[0]=x[i];
29 Bx[i]=pamfield->GetBX((float *)K);
30 By[i]=pamfield->GetBY((float *)K);
31 Bz[i]=pamfield->GetBZ((float *)K);
32 // delete K;
33 }
34 TGraph *bx = new TGraph(n,x,Bx);
35 TGraph *by = new TGraph(n,x,By);
36 TGraph *bz = new TGraph(n,x,Bz);
37 TMultiGraph *mg = new TMultiGraph();
38 mg->Add(bx);
39 mg->Add(by);
40 mg->Add(bz);
41 TCanvas *c = new TCanvas("Mag","Magnetic Field",200,10,600,400);
42 mg->Draw("AC");
43 }

  ViewVC Help
Powered by ViewVC 1.1.23