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.3 by buchmann, Thu Jul 14 15:50:58 2011 UTC vs.
Revision 1.23 by buchmann, Fri Sep 2 06:23:10 2011 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines