ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/cbrown/AnalysisFramework/Plotting/various_studies.C
Revision: 1.14
Committed: Thu Jul 28 15:30:38 2011 UTC (13 years, 9 months ago) by buchmann
Content type: text/plain
Branch: MAIN
Changes since 1.13: +8 -2 lines
Log Message:
Added quick diboson study

File Contents

# User Rev Content
1 buchmann 1.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/PeakFinder.C"
12     #include "Modules/Poisson_Calculator.C"
13     #include "Modules/setTDRStyle.C"
14     #include "Modules/ActiveSamples.C"
15     #include "Modules/UpperLimitsWithShape.C"
16     #include "Modules/Setup.C"
17 buchmann 1.8 #include "Modules/external/cl95cms.c"
18 buchmann 1.1 #include "Modules/Plotting_Functions.C" //also included for peak finding etc.
19     #include "Modules/StudyModule.C" //also included for peak finding etc.
20 buchmann 1.8 #include "Modules/ExperimentalModule.C"
21     #include "Modules/ResultModule.C"
22     #include "Modules/LimitCalculation.C"
23 buchmann 1.9 #include "Modules/Systematics.C"
24     #include "Modules/SUSYScan.C"
25 buchmann 1.1
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     setTDRStyle();
53     gStyle->SetTextFont(42);
54     bool showList=false;
55     set_treename("events");//you can set the treename here to be used; options are "events" (for reco) for "PFevents" (for particle flow)
56 buchmann 1.9 define_samples(showList,allsamples,signalsamples,scansample);
57 buchmann 1.1 setlumi(luminosity);
58     do_png(true);
59 buchmann 1.11 do_pdf(true);
60     do_eps(true);
61     do_C(true);
62 buchmann 1.3 set_directory("summer_mc");//here you can give it a name, for instance "1234pb" or whatever you like :-)
63 buchmann 1.1 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!
64     stringstream resultsummary;
65    
66     //what to do :
67     bool do_all=false;/// DONE
68     bool do_peak_finding=false; /// DONE
69     bool calculate_pred_and_observed=false; /// DONE
70 buchmann 1.5 bool study_sidebands=false; /// FOR REAL
71 buchmann 1.1 bool do_test=false;/// DONE (just any test you wish)
72     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
73 buchmann 1.14 bool do_find_sideband_definition=false;
74 buchmann 1.9 bool do_pick_up_events=false; ///DONE
75 buchmann 1.8 bool do_ttbar_with_shapes=false;
76     bool do_upper_limits=false;
77 buchmann 1.14 bool do_run_check=false;
78    
79     bool do_show_dibosons=true;
80 buchmann 1.1
81 buchmann 1.12 bool do_efficiency_scan_in_susy_space=false; /// NOW OUTSOURCED TO T3
82 buchmann 1.9 bool requireZ=true;
83 buchmann 1.12
84 buchmann 1.1 //**** part 1 : peak finding
85     float MCPeak=0,MCPeakError=0,DataPeak=0,DataPeakError=0,MCSigma=10,DataSigma=10;
86     method=Kostasmethod;//Kostasmethod;//dogaus3sigma;// options: dogaus,doKM,dogaus2sigma,dogaus3sigma
87 buchmann 1.14 if(do_peak_finding||do_show_dibosons||calculate_pred_and_observed||do_all) find_peaks(MCPeak,MCPeakError, DataPeak, DataPeakError,MCSigma,DataSigma,resultsummary);
88 buchmann 1.1
89     stringstream datajzb;
90     if(DataPeak>0) datajzb<<"("<<jzbvariabledata<<"-"<<TMath::Abs(DataPeak)<<")";
91     else datajzb<<"("<<jzbvariabledata<<"+"<<TMath::Abs(DataPeak)<<")";
92     stringstream mcjzb;
93     if(MCPeak>0) mcjzb<<"("<<jzbvariablemc<<"-"<<TMath::Abs(MCPeak)<<")";
94     else mcjzb<<"("<<jzbvariablemc<<"+"<<TMath::Abs(MCPeak)<<")";
95    
96 buchmann 1.6 dout << "With peak correction, we get : " << endl;
97     dout << " Data : " << datajzb.str() << endl;
98     dout << " MC : " << datajzb.str() << endl;
99 buchmann 1.1
100 buchmann 1.3 if(do_find_sideband_definition) find_sideband_definition();
101    
102     if(do_jzb_correction) {
103     find_correction_factors(jzbvariabledata,jzbvariablemc);
104 buchmann 1.6 dout << "Please update Modules/Setup.C to reflect the following values (round them first ... )" <<endl;
105     dout << "Corrected JZB variable definition " << endl << " Data: " << jzbvariabledata << " and MC: " << jzbvariablemc << endl;
106     dout << endl;
107     dout << "If you're feeling lazy, copy & paste this : " << endl;
108     dout << " string jzbvariabledata=\""<<jzbvariabledata<<"\";"<<endl;
109     dout << " string jzbvariablemc=\"" <<jzbvariablemc<<"\";"<<endl;
110 buchmann 1.3 }
111 buchmann 1.1
112     if(study_sidebands) look_at_sidebands(mcjzb.str(),datajzb.str());
113    
114 buchmann 1.8 vector<float>jzb_limit_bins;
115 buchmann 1.10 jzb_limit_bins.push_back(50);
116     //jzb_limit_bins.push_back(75);jzb_limit_bins.push_back(100);
117     //jzb_limit_bins.push_back(150);jzb_limit_bins.push_back(200);jzb_limit_bins.push_back(500);
118 buchmann 1.8
119    
120     if(do_ttbar_with_shapes) prepare_ttbar_limits(mcjzb.str(),datajzb.str(),DataPeakError,MCPeakError,jzb_limit_bins);
121    
122     if(do_upper_limits) calculate_upper_limits(mcjzb.str(),datajzb.str());
123    
124 buchmann 1.10 if(do_efficiency_scan_in_susy_space) efficiency_scan_in_susy_space(mcjzb.str(),datajzb.str(),requireZ,MCPeakError);
125 buchmann 1.9
126 buchmann 1.5 if(do_pick_up_events) {
127    
128 buchmann 1.6 dout << "Observed: " << endl;
129 buchmann 1.5 pick_up_events((const char*)(cutmass&&cutOSSF&&cutnJets&&basiccut&&"((jzb[1]+0.06*pt-2.84727)>100)"));
130 buchmann 1.6 dout << "Predicted (JZB<-100) OSSF" << endl;
131 buchmann 1.5 pick_up_events((const char*)(cutmass&&cutOSSF&&cutnJets&&basiccut&&"((jzb[1]+0.06*pt-2.84727)<-100)"));
132 buchmann 1.6 dout << "Predicted (emu, JZB>100) OSOF" << endl;
133 buchmann 1.5 pick_up_events((const char*)(cutmass&&cutOSOF&&cutnJets&&basiccut&&"((jzb[1]+0.06*pt-2.84727)>100)"));
134 buchmann 1.6 dout << "Predicted (emu, JZB<-100) OSOF" << endl;
135 buchmann 1.5 pick_up_events((const char*)(cutmass&&cutOSOF&&cutnJets&&basiccut&&"((jzb[1]+0.06*pt-2.84727)<-100)"));
136 buchmann 1.6 dout << "Predicted (SB emu, JZB>100) OSOF" << endl;
137 buchmann 1.5 pick_up_events((const char*)(sidebandcut&&cutOSOF&&cutnJets&&basiccut&&"((jzb[1]+0.06*pt-2.84727)>100)"));
138 buchmann 1.6 dout << "Predicted (SB emu, JZB<-100) OSOF" << endl;
139 buchmann 1.5 pick_up_events((const char*)(cutOSOF&&cutnJets&&basiccut&&sidebandcut&&"((jzb[1]+0.06*pt-2.84727)<-100)"));
140 buchmann 1.6 dout << "Predicted (SB SF, JZB>100) OSSF" << endl;
141 buchmann 1.5 pick_up_events((const char*)(sidebandcut&&cutOSSF&&cutnJets&&basiccut&&"((jzb[1]+0.06*pt-2.84727)>100)"));
142 buchmann 1.6 dout << "Predicted (SB SF, JZB<-100) OSSF" << endl;
143 buchmann 1.5 pick_up_events((const char*)(sidebandcut&&cutOSSF&&cutnJets&&basiccut&&"((jzb[1]+0.06*pt-2.84727)<-100)"));
144     }
145    
146 buchmann 1.14 if(do_run_check) run_check();
147     if(do_show_dibosons) show_dibosons(datajzb.str(),mcjzb.str());
148    
149 buchmann 1.1 if(do_test) test();
150    
151     return 0;
152     }
153    
154