ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/cbrown/Development/Plotting/ZbAnalysis.C
Revision: 1.3
Committed: Thu Jul 12 13:05:16 2012 UTC (12 years, 9 months ago) by buchmann
Content type: text/plain
Branch: MAIN
Changes since 1.2: +4 -3 lines
Log Message:
making the jzb foundation shush for the z+b analysis

File Contents

# Content
1 #include <iostream>
2 #include <vector>
3 #include <sys/stat.h>
4 #include <getopt.h>
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include "Modules/GeneralToolBox.C"
8 #include "Modules/SampleClass.C"
9 #include "Modules/setTDRStyle.C"
10 #include "Modules/Setup.C"
11 //#include "Modules/Poisson_Calculator.C"
12 #include "Modules/ActiveSamples.C"
13 //#include "Modules/PeakFinder.C"
14 //#include "Modules/UpperLimitsWithShape.C"
15 //#include "Modules/Plotting_Functions.C"
16 //#include "Modules/LimitCalculation.C"
17 //#include "Modules/ResultModule.C"
18 //#include "Modules/CrossSectionReader.C"
19 //#include "Modules/Systematics.C"
20 //#include "Modules/SugarCoating.C"
21 //#include "Modules/ExclusionPlot.C"
22 //#include "Modules/SUSYScan.C"
23
24 #include "Modules/ValueClass.C"
25 #include "Modules/ZbTools.C"
26
27
28 #include <TCut.h>
29 #include <TROOT.h>
30 #include <TCanvas.h>
31 #include <TMath.h>
32 #include <TColor.h>
33 #include <TPaveText.h>
34 #include <TRandom.h>
35 #include <TH1.h>
36 #include <TH2.h>
37 #include <TF1.h>
38 #include <TSQLResult.h>
39
40 #ifndef Verbosity
41 #define Verbosity 0
42 #endif
43 #ifndef HUSH
44 #define HUSH 1
45 #endif
46
47 using namespace PlottingSetup;
48
49
50 void usage(int passed=0 ) {
51 std::cout << "USAGE : " << std::endl;
52 std::cout << "You can use different options when running this program : " << std::endl;
53 std::cout << std::endl;
54 std::cout << "\033[1;34m all\033[0m \t\t All processes of the standard workflow" << std::endl;
55 std::cout << "\033[1;34m png\033[0m \t\t Save all plots as pngs (also available: --pdf, --root, --eps, --C) standard: png&pdf" << std::endl;
56 std::cout << std::endl;
57 std::cout << "\033[1;34m dir (d)\033[0m\t Directory where all plots will be saved" << std::endl;
58 std::cout << std::endl;
59 std::cout << std::endl;
60 exit(-1);
61 }
62
63
64 int main (int argc, char ** argv)
65 {
66 int do_all=true;
67
68 int savepdf=true;
69 int saveC=true;
70 int saveRoot=true;
71 int savepng=true;
72 int saveeps=false;
73
74 std::string directory="";
75 int option_iterator;
76 int option_counter=0;
77 bool moreoptions=true;
78
79 string jzbcuts_string="";
80
81 while(moreoptions) {
82 static struct option long_options[] =
83 {
84 /* These options set a flag. */
85 {"all", no_argument, &do_all, 1},
86 {"png", no_argument, &savepng,1},
87 {"eps", no_argument, &saveeps,1},
88 {"pdf", no_argument, &savepdf,1},
89 {"root", no_argument, &saveRoot,1},
90 {"C", no_argument, &saveC,1},
91 /* The following options store values.*/
92 {"dir", required_argument, 0, 'd'},
93 {0, 0, 0, 0}
94 };
95 int option_index = 0;
96 option_iterator = getopt_long(argc, argv, "d:",long_options, &option_index);
97 if(option_iterator == -1) moreoptions=false;
98 else {
99 option_counter++;
100 switch (option_iterator)
101 {
102 case 0:
103 if (long_options[option_index].flag != 0)
104 break;
105 printf ("option %s", long_options[option_index].name);
106 if (optarg)
107 printf (" with arg %s", optarg);
108 printf ("\n");
109 break;
110 case 'd':
111 directory=(std::string)optarg;
112 std::cout<<"Option directory was passed with argument " << optarg << std::endl;
113 break;
114 case '?':
115 usage(option_iterator);
116 break;
117 default:
118 usage(option_iterator);
119 }
120 }
121 }
122
123 if(directory!="") PlottingSetup::directoryname=directory;
124 if(option_counter==0) usage();
125
126 PlottingSetup::publicmode=true; // suppressing the whole JZB header
127
128
129 ///----------------------------------- BELOW THIS LINE: NO MORE OPTIONS BUT ACTUAL FUNCTION CALLS! ---------------------------------------------------------
130 gROOT->SetStyle("Plain");
131 bool do_fat_line=false; // if you want to have HistLineWidth=1 and FuncWidth=1 as it was before instead of 2
132 setTDRStyle(do_fat_line);
133 gStyle->SetTextFont(42);
134 bool showList=true;
135 set_directory(directoryname);//Indicate the directory name where you'd like to save the output files in Setup.C
136 set_treename("events");//you can set the treename here to be used; options are "events" (for reco) for "PFevents" (for particle flow)
137
138 PlottingSetup::RestrictToMassPeak=true;
139
140 define_samples(showList,allsamples,signalsamples,scansample,raresample,systsamples,qcdsamples);
141 setlumi(luminosity);
142 setessentialcut(essential);//this sets the essential cut; this one is used in the draw command so it is AUTOMATICALLY applied everywhere. IMPORTANT: Do NOT store weights here!
143 stringstream resultsummary;
144
145 do_png(savepng);
146 do_pdf(savepdf);
147 do_eps(saveeps);
148 do_C(saveC);
149 do_root(saveRoot);
150
151
152
153
154
155
156
157
158 write_warning(__FUNCTION__,"Everything missing so far goes here: ");
159 cout << " Still need to carry out cross - checks" << endl;
160 cout << " Still need to define errors in final plot " << endl;
161 cout << " Still need to make PU cut " << endl;
162
163
164 do_basic_ZB_analysis();
165 return 0;
166 }
167
168
169