ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/cbrown/AnalysisFramework/Plotting/various_studies.C
(Generate patch)

Comparing UserCode/cbrown/AnalysisFramework/Plotting/various_studies.C (file contents):
Revision 1.2 by buchmann, Thu Jul 14 06:25:39 2011 UTC vs.
Revision 1.28 by buchmann, Wed Sep 28 13:22:16 2011 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines