ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/cbrown/AnalysisFramework/Plotting/various_studies.C
Revision: 1.30
Committed: Thu Dec 1 13:35:32 2011 UTC (13 years, 5 months ago) by buchmann
Content type: text/plain
Branch: MAIN
CVS Tags: cbaf_4_98ifb_paper, beforeFR20120418, cbaf_4p7ifb, HEAD
Changes since 1.29: +2 -4 lines
Log Message:
Adapted the way samples are initialized (systematics sample collection added); Selective_Plot_Generator is now the main way to produce plots, not Create_All_Plots anymore

File Contents

# Content
1 /*
2
3 to compile: just run make ... that should take care of it.
4
5 */
6 #include <iostream>
7 #include <vector>
8 #include <sys/stat.h>
9 #include "Modules/GeneralToolBox.C"
10 #include "Modules/SampleClass.C"
11 #include "Modules/Setup.C"
12 #include "Modules/PeakFinder.C"
13 #include "Modules/Poisson_Calculator.C"
14 #include "Modules/setTDRStyle.C"
15 #include "Modules/ActiveSamples.C"
16 #include "Modules/UpperLimitsWithShape.C"
17 #include "Modules/Plotting_Functions.C" //also included for peak finding etc.
18 #include "Modules/LimitCalculation.C"
19 #include "Modules/ResultModule.C"
20 #include "Modules/ExperimentalModule.C"
21 #include "Modules/StudyModule.C" //also included for peak finding etc.
22 #include "Modules/Systematics.C"
23 #include "Modules/CrossSectionReader.C"
24 #include "Modules/SUSYScan.C"
25
26 #include <TCut.h>
27 #include <TROOT.h>
28 #include <TCanvas.h>
29 #include <TMath.h>
30 #include <TColor.h>
31 #include <TPaveText.h>
32 #include <TRandom.h>
33 #include <TH1.h>
34 #include <TH2.h>
35 #include <TF1.h>
36 #include <TSQLResult.h>
37
38 #ifndef Verbosity
39 #define Verbosity 0
40 #endif
41 #ifndef HUSH
42 #define HUSH 1
43 #endif
44
45 using namespace std;
46
47 using namespace PlottingSetup;
48
49 int main()
50 {
51 gROOT->SetStyle("Plain");
52 bool do_fat_line=false; // if you want to have HistLineWidth=1 and FuncWidth=1 as it was before instead of 2
53 setTDRStyle(do_fat_line);
54 gStyle->SetTextFont(42);
55 bool showList=false;
56 set_treename("events");//you can set the treename here to be used; options are "events" (for reco) for "PFevents" (for particle flow)
57 define_samples(showList,allsamples,signalsamples,scansample,raresample,systsamples);
58 setlumi(luminosity);
59 do_png(true);
60 do_pdf(false);
61 do_eps(false);
62 do_C(false);
63 set_directory(directoryname);//Indicate the directory name where you'd like to save the output files in Setup.C
64 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!
65 stringstream resultsummary;
66
67
68 //what to do :
69 bool do_all=false;/// DONE
70 bool do_peak_finding=false; /// DONE
71 bool calculate_pred_and_observed=false; /// DONE
72 bool study_sidebands=false; /// FOR REAL
73 bool do_test=false;/// DONE (just any test you wish)
74 bool do_jzb_correction=false; //use this to find out the correction factor; originally this was done automatically but now you should do this separately and update Modules/Setup.C
75 bool do_find_sideband_definition=false;
76 bool do_pick_up_events=false; ///DONE
77 bool do_ttbar_with_shapes=false;
78 bool do_upper_limits=false;
79 bool do_run_check=false;
80 bool do_kinematic_dist_of_pred_and_obs=false;//former do_plot_list
81
82 bool do_show_dibosons=false;
83
84 bool do_show_rare_samples=true;
85
86 bool overlay_signal=false;
87
88 bool do_efficiency_scan_in_susy_space=false; /// NOW OUTSOURCED TO T3
89 bool requireZ=true;
90
91 bool do_beautiful_ratio_plots=true;
92
93 //**** part 1 : peak finding
94 float MCPeak=0,MCPeakError=0,DataPeak=0,DataPeakError=0,MCSigma=10,DataSigma=10;
95 method=Kostasmethod;//Kostasmethod;//dogaus3sigma;// options: dogaus,doKM,dogaus2sigma,dogaus3sigma
96 if(do_peak_finding||do_show_dibosons||do_show_rare_samples||calculate_pred_and_observed||do_all) find_peaks(MCPeak,MCPeakError, DataPeak, DataPeakError,MCSigma,DataSigma,resultsummary);
97
98 stringstream datajzb;
99 if(DataPeak>0) datajzb<<"("<<jzbvariabledata<<"-"<<TMath::Abs(DataPeak)<<")";
100 else datajzb<<"("<<jzbvariabledata<<"+"<<TMath::Abs(DataPeak)<<")";
101 stringstream mcjzb;
102 if(MCPeak>0) mcjzb<<"("<<jzbvariablemc<<"-"<<TMath::Abs(MCPeak)<<")";
103 else mcjzb<<"("<<jzbvariablemc<<"+"<<TMath::Abs(MCPeak)<<")";
104
105 dout << "With peak correction, we get : " << endl;
106 dout << " Data : " << datajzb.str() << endl;
107 dout << " MC : " << mcjzb.str() << endl;
108
109 if(do_find_sideband_definition) find_sideband_definition();
110
111 if(do_jzb_correction) {
112 find_correction_factors(jzbvariabledata,jzbvariablemc);
113 dout << "Please update Modules/Setup.C to reflect the following values (round them first ... )" <<endl;
114 dout << "Corrected JZB variable definition " << endl << " Data: " << jzbvariabledata << " and MC: " << jzbvariablemc << endl;
115 dout << endl;
116 dout << "If you're feeling lazy, copy & paste this : " << endl;
117 dout << " string jzbvariabledata=\""<<jzbvariabledata<<"\";"<<endl;
118 dout << " string jzbvariablemc=\"" <<jzbvariablemc<<"\";"<<endl;
119 }
120
121 if(study_sidebands) look_at_sidebands(mcjzb.str(),datajzb.str());
122
123 vector<float>jzb_limit_bins;
124 jzb_limit_bins.push_back(50);
125 //jzb_limit_bins.push_back(75);jzb_limit_bins.push_back(100);
126 //jzb_limit_bins.push_back(150);jzb_limit_bins.push_back(200);jzb_limit_bins.push_back(500);
127
128
129 if(do_ttbar_with_shapes) prepare_ttbar_limits(mcjzb.str(),datajzb.str(),DataPeakError,MCPeakError,jzb_limit_bins);
130
131 if(do_upper_limits) calculate_upper_limits(mcjzb.str(),datajzb.str());
132
133 if(do_pick_up_events) {
134
135 dout << "Observed: " << endl;
136 pick_up_events((const char*)(cutmass&&cutOSSF&&cutnJets&&basiccut&&"((jzb[1]+0.06*pt-2.84727)>100)"));
137 dout << "Predicted (JZB<-100) OSSF" << endl;
138 pick_up_events((const char*)(cutmass&&cutOSSF&&cutnJets&&basiccut&&"((jzb[1]+0.06*pt-2.84727)<-100)"));
139 dout << "Predicted (emu, JZB>100) OSOF" << endl;
140 pick_up_events((const char*)(cutmass&&cutOSOF&&cutnJets&&basiccut&&"((jzb[1]+0.06*pt-2.84727)>100)"));
141 dout << "Predicted (emu, JZB<-100) OSOF" << endl;
142 pick_up_events((const char*)(cutmass&&cutOSOF&&cutnJets&&basiccut&&"((jzb[1]+0.06*pt-2.84727)<-100)"));
143 dout << "Predicted (SB emu, JZB>100) OSOF" << endl;
144 pick_up_events((const char*)(sidebandcut&&cutOSOF&&cutnJets&&basiccut&&"((jzb[1]+0.06*pt-2.84727)>100)"));
145 dout << "Predicted (SB emu, JZB<-100) OSOF" << endl;
146 pick_up_events((const char*)(cutOSOF&&cutnJets&&basiccut&&sidebandcut&&"((jzb[1]+0.06*pt-2.84727)<-100)"));
147 dout << "Predicted (SB SF, JZB>100) OSSF" << endl;
148 pick_up_events((const char*)(sidebandcut&&cutOSSF&&cutnJets&&basiccut&&"((jzb[1]+0.06*pt-2.84727)>100)"));
149 dout << "Predicted (SB SF, JZB<-100) OSSF" << endl;
150 pick_up_events((const char*)(sidebandcut&&cutOSSF&&cutnJets&&basiccut&&"((jzb[1]+0.06*pt-2.84727)<-100)"));
151 }
152
153 if(do_run_check) run_check();
154 if(do_show_dibosons) show_dibosons(datajzb.str(),mcjzb.str());
155 if(do_show_rare_samples) show_rare_samples(datajzb.str(),mcjzb.str());
156
157 if(do_kinematic_dist_of_pred_and_obs) kinematic_dist_of_pred_and_obs();
158
159 if(do_test) test();
160
161 vector<float> ratio_binning;
162 ratio_binning.push_back(0);
163 ratio_binning.push_back(5);
164 ratio_binning.push_back(10);
165 ratio_binning.push_back(20);
166 ratio_binning.push_back(50);
167 ratio_binning.push_back(100);
168 ratio_binning.push_back(200);
169 ratio_binning.push_back(350);
170 //ratio_binning.push_back(500);
171 if(do_beautiful_ratio_plots) Poisson_ratio_plots(mcjzb.str(),datajzb.str(),ratio_binning,MCPeakError,DataPeakError);
172
173 write_warning(__FUNCTION__,"Need to remove the next line:");
174 // do_new_prediction_plots(mcjzb.str(),datajzb.str(),DataSigma,MCSigma,overlay_signal);
175
176 // ttbar_sidebands_comparison(mcjzb.str());
177
178 lm0_illustration();
179 return 0;
180 }
181
182