ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/cbrown/Development/Plotting/ZbAnalysis.C
Revision: 1.10
Committed: Mon Jan 7 14:40:32 2013 UTC (12 years, 4 months ago) by buchmann
Content type: text/plain
Branch: MAIN
Changes since 1.9: +3 -10 lines
Log Message:
Removed ticked-off to-do items

File Contents

# User Rev Content
1 buchmann 1.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 buchmann 1.8 #include "Modules/JSON/JSONSampleLoader.C"
13 buchmann 1.1 #include "Modules/ActiveSamples.C"
14     //#include "Modules/PeakFinder.C"
15     //#include "Modules/UpperLimitsWithShape.C"
16     //#include "Modules/Plotting_Functions.C"
17     //#include "Modules/LimitCalculation.C"
18     //#include "Modules/ResultModule.C"
19     //#include "Modules/CrossSectionReader.C"
20     //#include "Modules/Systematics.C"
21     //#include "Modules/SugarCoating.C"
22     //#include "Modules/ExclusionPlot.C"
23     //#include "Modules/SUSYScan.C"
24    
25     #include "Modules/ValueClass.C"
26     #include "Modules/ZbTools.C"
27    
28    
29     #include <TCut.h>
30     #include <TROOT.h>
31     #include <TCanvas.h>
32     #include <TMath.h>
33     #include <TColor.h>
34     #include <TPaveText.h>
35     #include <TRandom.h>
36     #include <TH1.h>
37     #include <TH2.h>
38     #include <TF1.h>
39     #include <TSQLResult.h>
40    
41     #ifndef Verbosity
42     #define Verbosity 0
43     #endif
44     #ifndef HUSH
45     #define HUSH 1
46     #endif
47    
48     using namespace PlottingSetup;
49    
50    
51     void usage(int passed=0 ) {
52     std::cout << "USAGE : " << std::endl;
53     std::cout << "You can use different options when running this program : " << std::endl;
54 buchmann 1.7 std::cout << "\033[1;34m Full (f)\033[0m \t\t Run the FULL analysis including all systematics etc. " << std::endl;
55 buchmann 1.1 std::cout << std::endl;
56     std::cout << "\033[1;34m all\033[0m \t\t All processes of the standard workflow" << std::endl;
57     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;
58     std::cout << std::endl;
59     std::cout << "\033[1;34m dir (d)\033[0m\t Directory where all plots will be saved" << std::endl;
60     std::cout << std::endl;
61     std::cout << std::endl;
62     exit(-1);
63     }
64    
65    
66     int main (int argc, char ** argv)
67     {
68     int do_all=true;
69    
70     int savepdf=true;
71     int saveC=true;
72     int saveRoot=true;
73     int savepng=true;
74     int saveeps=false;
75 buchmann 1.7 int do_Full=false;
76 buchmann 1.1
77     std::string directory="";
78     int option_iterator;
79     int option_counter=0;
80     bool moreoptions=true;
81    
82     string jzbcuts_string="";
83    
84     while(moreoptions) {
85     static struct option long_options[] =
86     {
87     /* These options set a flag. */
88     {"all", no_argument, &do_all, 1},
89     {"png", no_argument, &savepng,1},
90     {"eps", no_argument, &saveeps,1},
91     {"pdf", no_argument, &savepdf,1},
92     {"root", no_argument, &saveRoot,1},
93     {"C", no_argument, &saveC,1},
94 buchmann 1.7 {"full", no_argument, &do_Full,1},
95 buchmann 1.1 /* The following options store values.*/
96     {"dir", required_argument, 0, 'd'},
97     {0, 0, 0, 0}
98     };
99     int option_index = 0;
100 buchmann 1.7 option_iterator = getopt_long(argc, argv, "d:f",long_options, &option_index);
101 buchmann 1.1 if(option_iterator == -1) moreoptions=false;
102     else {
103     option_counter++;
104     switch (option_iterator)
105     {
106     case 0:
107     if (long_options[option_index].flag != 0)
108     break;
109     printf ("option %s", long_options[option_index].name);
110     if (optarg)
111     printf (" with arg %s", optarg);
112     printf ("\n");
113     break;
114     case 'd':
115     directory=(std::string)optarg;
116     std::cout<<"Option directory was passed with argument " << optarg << std::endl;
117     break;
118 buchmann 1.7 case 'f':
119     do_Full=true;
120 buchmann 1.6 break;
121 buchmann 1.1 case '?':
122     usage(option_iterator);
123     break;
124     default:
125     usage(option_iterator);
126     }
127     }
128     }
129    
130     if(directory!="") PlottingSetup::directoryname=directory;
131     if(option_counter==0) usage();
132    
133 buchmann 1.3 PlottingSetup::publicmode=true; // suppressing the whole JZB header
134 buchmann 1.1
135     ///----------------------------------- BELOW THIS LINE: NO MORE OPTIONS BUT ACTUAL FUNCTION CALLS! ---------------------------------------------------------
136     gROOT->SetStyle("Plain");
137     bool do_fat_line=false; // if you want to have HistLineWidth=1 and FuncWidth=1 as it was before instead of 2
138     setTDRStyle(do_fat_line);
139     gStyle->SetTextFont(42);
140     bool showList=true;
141     set_directory(directoryname);//Indicate the directory name where you'd like to save the output files in Setup.C
142     set_treename("events");//you can set the treename here to be used; options are "events" (for reco) for "PFevents" (for particle flow)
143    
144     PlottingSetup::RestrictToMassPeak=true;
145    
146 buchmann 1.5 //define_Zb_samples(showList,allsamples,signalsamples,scansample,raresample,systsamples,qcdsamples);
147 buchmann 1.9 IsZbAnalysis=true;
148     IsWZAnalysis=false;
149     IsJZBAnalysis=false;
150 buchmann 1.5 write_warning(__FUNCTION__,"Need to adapt sample collection!");
151     define_samples(showList,allsamples,signalsamples,scansample,raresample,systsamples,qcdsamples,comparesamples);
152 buchmann 1.1 setlumi(luminosity);
153 buchmann 1.6 setessentialcut(essential&&TCut("id1==id2"));//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!
154 buchmann 1.1 stringstream resultsummary;
155    
156     do_png(savepng);
157     do_pdf(savepdf);
158     do_eps(saveeps);
159     do_C(saveC);
160     do_root(saveRoot);
161    
162    
163 buchmann 1.10 write_warning(__FUNCTION__,"Using preliminary weights!");
164     //cutWeight=TCut("(weight*(weight<1000)*(is_data+(!is_data)*((id1==id2)*0.95+(id1!=id2)*0.94)))");
165     cutWeight=TCut("(weight*(weight<1000)*(is_data+(!is_data)*((id1==id2&&id1==0)*0.95+(id1==id2&&id1==1)*0.88+(id1!=id2)*0.92)))");
166 buchmann 1.7 do_basic_ZB_analysis(do_Full);
167 buchmann 1.1 return 0;
168     }
169    
170    
171    
172 buchmann 1.5
173