ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/RootMacros/rootlogon.C
(Generate patch)

Comparing UserCode/RootMacros/rootlogon.C (file contents):
Revision 1.1 by anderson, Sat Sep 6 18:58:12 2008 UTC vs.
Revision 1.2 by chawon, Thu Mar 11 07:05:34 2010 UTC

# Line 1 | Line 1
1   {
2 < /* If a rootlogon.C file exists in the same
3 <  * directory as where ROOT is being started,
4 <  * all commands in it will be run first.
5 <  * Michael Anderson, July 2007
6 <  */
7 <
8 < const char* defaultFileToOpen = "PhotonJet20-200.root";
9 < //const char* defaultFileToOpen = "PhotonJet200-500.root";
10 < //const char* defaultFileToOpen = "JetET110.root";
11 < //const char* defaultFileToOpen = "single_electron.root";
12 < //const char* defaultFileToOpen = "single_pi0.root";
13 <
14 < gROOT->SetStyle("Plain");
15 <
16 < // Change settings on plotting histograms
17 < //gStyle->SetOptStat(111111);      // This will cause overflow and underflow to be shown
18 < gStyle->SetOptFit();               // Show fitting values in legend
19 < //gStyle->SetHistLineWidth(2);     // Set the line width to 2 pixels
20 < //gStyle->SetTitleFontSize(0.035); // Shrink Histogram Title Size
21 < //gStyle->SetPalette(1);           // Make 2D plots pretty ->Draw("colz")
22 <
23 < // Load macros so that you can call them
24 < //  from the command line within ROOT.
25 < // Can load other scripts in other directories with something like:
26 < //   G__loadfile("~/RootMacros/entryCount.C");
27 < G__loadfile("~/RootMacros/entryCount.C");    // Counts entries in histograms
28 < G__loadfile("~/RootMacros/PlotFromTTree.C"); // Plots from TTree into histogram
29 < G__loadfile("~/RootMacros/Plot2hists1D.C");  // Plots 2 histograms onto same plot
30 < G__loadfile("~/RootMacros/Plot3hists1D.C");  // Plots 3 histograms onto same plot
31 < G__loadfile("~/RootMacros/Divide2hists1D.C");// Divides 2 histograms and plots result
32 < G__loadfile("~/RootMacros/setAxes.C");       // Sets the x and y axis titles for 1-D and 2-D histograms
33 < G__loadfile("~/RootMacros/setTitleAxes.C");  // Sets the main and axis titles for 1-D and 2-D histograms
34 < G__loadfile("~/RootMacros/ProfileBeforeNAfter.C");
35 < G__loadfile("~/RootMacros/PlotMeanVsXaxis.C");
36 <
37 < // Load a root file - Must be done before making canvas & histograms
38 < cout << "Trying to open default file, " << defaultFileToOpen  << endl;
39 < TFile *file1 = new TFile(defaultFileToOpen);
40 < if (file1.IsZombie()) {
41 <   cout << "You can set a default file to open in the rootlogon.C" << endl;
42 < }
43 <
44 < // Create a default canvas and histogram of 640x480 pixels
45 < // These are used by PlotFromTTree.C, Plot2hists1D.C
46 < TCanvas *c1 = new TCanvas("c1","testCanvas",640,480);
47 < TH1 *h1     = new TH1F("h1","Blah",20,-5,5);
48 < TH1 *h2     = new TH1F("h2","Blah",20,-5,5);
49 < TH2F *h2d   = new TH2F("h2d","Blah",20,-5,5,20,-5,5);
50 <
51 < // Run other logon scripts
52 < //gROOT->Macro("rootlogon-CmsTDR.C");
2 > //cout << endl << "Welcome to my rootlogon.C" << endl;
3 > //cout << "For approved plots use: gROOT->SetStyle(\"BABAR\");"
4 > //cout << "For approved plots use: gROOT->SetStyle(\"RENO\");"
5 > //<< endl << endl;
6 >
7 > //..BABAR style from RooLogon.C in workdir
8 > //TStyle *babarStyle= new TStyle("BABAR","BaBar approved plots style");
9 > //RENO style  
10 >
11 > gSystem->Load("libFWCoreFWLite.so");
12 > AutoLibraryLoader::enable();
13 >
14 >
15 > TStyle *gStyle= new TStyle("RENO","Reno approved plots style");
16 >
17 > // use plain black on white colors
18 > gStyle->SetFrameBorderMode(0);
19 > gStyle->SetCanvasBorderMode(0);
20 > gStyle->SetPadBorderMode(0);
21 > gStyle->SetPadColor(0);
22 > gStyle->SetCanvasColor(0);
23 > gStyle->SetStatColor(0);
24 > gStyle->SetFillColor(0);
25 >
26 > // set the paper & margin sizes
27 > gStyle->SetPaperSize(20,26);
28 > gStyle->SetPadTopMargin(0.05);
29 > gStyle->SetPadRightMargin(0.05);
30 > gStyle->SetPadBottomMargin(0.16);
31 > gStyle->SetPadLeftMargin(0.12);
32 >
33 > // use large Times-Roman fonts
34 > gStyle->SetTextFont(132);
35 > gStyle->SetTextSize(0.08);
36 > gStyle->SetLabelFont(132,"x");
37 > gStyle->SetLabelFont(132,"y");
38 > gStyle->SetLabelFont(132,"z");
39 > gStyle->SetLabelSize(0.05,"x");
40 > gStyle->SetTitleSize(0.06,"x");
41 > gStyle->SetLabelSize(0.05,"y");
42 > gStyle->SetTitleSize(0.06,"y");
43 > gStyle->SetLabelSize(0.05,"z");
44 > gStyle->SetTitleSize(0.06,"z");
45 >
46 > // use bold lines and markers
47 > gStyle->SetMarkerStyle(20);
48 > gStyle->SetHistLineWidth(1.85);
49 > //gStyle->SetHistLineWidth(3.85);
50 > gStyle->SetLineStyleString(2,"[12 12]"); // postscript dashes
51 >
52 > // get rid of X error bars and y error bar caps
53 > gStyle->SetErrorX(0.001);
54 >
55 > // do not display any of the standard histogram decorations
56 > gStyle->SetOptTitle(0);
57 > gStyle->SetOptStat(0);
58 > gStyle->SetOptFit(0);
59 >
60 > // put tick marks on top and RHS of plots
61 > gStyle->SetPadTickX(1);
62 > gStyle->SetPadTickY(1);
63 >
64 > gROOT->SetStyle("Plain");
65 > //gStyle->SetOptStat(1100);
66 > gStyle->SetOptStat(1);
67 > gStyle->SetOptFit(1111);
68 > gStyle->SetPadTickX(1);
69 > gStyle->SetPadTickY(1);
70   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines