WCSim
rootwc.C
Go to the documentation of this file.
2 {
3  TRint* rint = dynamic_cast<TRint*>(gApplication);
4  if (!rint) return;
5 
6  rint->SetPrompt("RootWC: For all your WCSim needs [%d] ");
7 }
8 
9 void t2k_style()
10 {
11  // T2K style definition
12  // Adopted from BaBar collaboration
13  // Add the following lines to the start of your rootlogon.C file
14  TStyle *t2kStyle= new TStyle("T2K","T2K approved plots style");
15 
16  // use plain black on white colors
17  t2kStyle->SetFrameBorderMode(0);
18  t2kStyle->SetCanvasBorderMode(0);
19  t2kStyle->SetPadBorderMode(0);
20  t2kStyle->SetPadColor(0);
21  t2kStyle->SetCanvasColor(0);
22  t2kStyle->SetStatColor(0);
23  //t2kStyle->SetFillColor(0); // this doesn't seem to be over-ridable
24  t2kStyle->SetLegendBorderSize(1);
25 
26  // set the paper & margin sizes
27  t2kStyle->SetPaperSize(20,26);
28  t2kStyle->SetPadTopMargin(0.05);
29  t2kStyle->SetPadRightMargin(0.05);
30  t2kStyle->SetPadBottomMargin(0.16);
31  t2kStyle->SetPadLeftMargin(0.13);
32 
33  // use large Times-Roman fonts
34  t2kStyle->SetTextFont(132);
35  t2kStyle->SetTextSize(0.08);
36  t2kStyle->SetLabelFont(132,"x");
37  t2kStyle->SetLabelFont(132,"y");
38  t2kStyle->SetLabelFont(132,"z");
39  t2kStyle->SetLabelSize(0.05,"x");
40  t2kStyle->SetTitleSize(0.06,"x");
41  t2kStyle->SetLabelSize(0.05,"y");
42  t2kStyle->SetTitleSize(0.06,"y");
43  t2kStyle->SetLabelSize(0.05,"z");
44  t2kStyle->SetTitleSize(0.06,"z");
45  t2kStyle->SetLabelFont(132,"t");
46  t2kStyle->SetTitleFont(132,"x");
47  t2kStyle->SetTitleFont(132,"y");
48  t2kStyle->SetTitleFont(132,"z");
49  t2kStyle->SetTitleFont(132,"t");
50  t2kStyle->SetTitleFillColor(0);
51  t2kStyle->SetTitleX(0.25);
52  t2kStyle->SetTitleFontSize(0.08);
53  t2kStyle->SetTitleFont(132,"pad");
54 
55  // use bold lines and markers
56  t2kStyle->SetMarkerStyle(20);
57  t2kStyle->SetHistLineWidth(2);
58  t2kStyle->SetLineStyleString(2,"[12 12]"); // postscript dashes
59 
60  // get rid of X error bars and y error bar caps
61  t2kStyle->SetErrorX(0.001);
62 
63  // do not display any of the standard histogram decorations
64  t2kStyle->SetOptTitle(0);
65  t2kStyle->SetOptStat(0);
66  t2kStyle->SetOptFit(0);
67 
68  // put tick marks on top and RHS of plots
69  t2kStyle->SetPadTickX(1);
70  t2kStyle->SetPadTickY(1);
71 
72  //add the stat box
73  t2kStyle->SetOptFit(1); // show fit results
74  t2kStyle->SetOptStat(1100); // show mean & RMS only
75  //t2kStyle->SetStatStyle(0); //make stat boxes see through
76  //t2kStyle->SetStatBorderSize(0);
77  //t2kStyle->SetTextFont(42); //less bold
78 
79  // Add a greyscale palette for 2D plots
80  /*
81  int ncol=50;
82  double dcol = 1./float(ncol);
83  double gray = 1;
84  TColor **theCols = new TColor*[ncol];
85  for (int i=0;i<ncol;i++) theCols[i] = new TColor(999-i,0.0,0.7,0.7);
86  for (int j = 0; j < ncol; j++) {
87  theCols[j]->SetRGB(gray,gray,gray);
88  gray -= dcol;
89  }
90  int ColJul[100];
91  for (int i=0; i<100; i++) ColJul[i]=999-i;
92  t2kStyle->SetPalette(ncol,ColJul);
93  */
94 
95  //Define a nicer color palette (red->blue)
96  //Uncomment these lines for a color palette (default is B&W)
97  t2kStyle->SetPalette(1,0); // use the nice red->blue palette
98  const Int_t NRGBs = 5;
99  const Int_t NCont = 255;
100 
101  Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
102  Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
103  Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
104  Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
105  TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
106  t2kStyle->SetNumberContours(NCont);
107 
108 }//End of definition of t2kStyle
109 
110 void rootwc()
111 {
112  TString script_dir = gSystem->Getenv("WCSIM_BUILD_DIR");
113  script_dir += "/bin/rootwc/";
114 
115  TString curr_dir = gSystem->pwd();
116 
117  gSystem->cd(script_dir.Data());
118 
119  gROOT->ProcessLine(".x $WCSIM_BUILD_DIR/bin/rootwc-files/loadincs.C");
120  gROOT->ProcessLine(".x $WCSIM_BUILD_DIR/bin/rootwc-files/loadlibs.C");
121 
122  gSystem->cd(curr_dir.Data());
123 
124  change_prompt();
125 
126  t2k_style();
127  gROOT->SetStyle("T2K");
128 }
void t2k_style()
Definition: rootwc.C:9
G4Colour blue(0.0, 0.0, 1.0)
G4Colour green(0.0, 1.0, 0.0)
G4Colour red(1.0, 0.0, 0.0)
void change_prompt()
Definition: rootwc.C:1
void rootwc()
Definition: rootwc.C:110