StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Example_plot_Btot.C
1 // $Id: Example_plot_Btot.C,v 1.2 2006/08/15 21:42:52 jeromel Exp $
2 // $Log: Example_plot_Btot.C,v $
3 // Revision 1.2 2006/08/15 21:42:52 jeromel
4 // Fix rhic -> rhic.bnl.gov
5 //
6 // Revision 1.1 2000/01/24 21:29:21 love
7 // Installed example of POISSON field calculation plotting macro
8 //
9 // Revision 1.1 2000/1/24 22:00:30 love
10 
11 //=======================================================================
12 // owner: Bill Love
13 // An example of using the ROOT Ntuple to make a plot of the POISSON
14 // calculation of the STAR Magnet Full Field.
15 //=======================================================================
16 {
17  gROOT->Reset();
18 // Open the root file with bz, br, bt versus r and z in 10 cm steps.
19  TFile f("/afs/rhic.bnl.gov/star/data/samples/POIzto6m.root");
20 // Set a small circle plotting symbol and plot total field vs z at r = 90.
21  ntb->SetMarkerStyle(24);
22  ntb->SetMarkerSize(.6);
23  ntb->Draw("bt:z","r<95 && r>85");
24 // change to a black dot and add another r value (190).
25  ntb->SetMarkerStyle(20);
26  ntb->Draw("bt:z","r<195 && r>185","same");
27 // change to an open square and do the largest r (280 cm)
28  ntb->SetMarkerStyle(25);
29  ntb->Draw("bt:z"," r>275","same");
30 // Label the plot nicely.
31  text = new TLatex(420,-950,"z(cm)");
32  text->SetTextSize(0.05);
33  text->SetLineWidth(2);
34  text->Draw();
35  text = new TLatex(-56,11000,"Btot");
36  text->SetTextSize(0.05);
37  text->SetLineWidth(2);
38  text->Draw();
39  text = new TLatex(38,10750,"STAR Magnet");
40  text->SetTextSize(0.05);
41  text->SetLineWidth(2);
42  text->Draw();
43  text = new TLatex(38,10000,"POISSON calculation");
44  text->SetTextSize(0.05);
45  text->SetLineWidth(2);
46  text->Draw();
47  text = new TLatex(336,10780,"r = 90");
48  text->SetTextSize(0.05);
49  text->SetLineWidth(2);
50  text->Draw();
51  text = new TLatex(326,5000,"r = 190");
52  text->SetTextSize(0.05);
53  text->SetLineWidth(2);
54  text->Draw();
55  text = new TLatex(170,2000,"r = 280");
56  text->SetTextSize(0.05);
57  text->SetLineWidth(2);
58  text->Draw();
59  printf (" to exit type .q\n");
60 }