ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/cbrown/AnalysisFramework/Plotting/various_studies.C
Revision: 1.1
Committed: Tue Jul 12 13:00:24 2011 UTC (13 years, 9 months ago) by buchmann
Content type: text/plain
Branch: MAIN
Log Message:
Various studies in this file now

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/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"
19     #include "Modules/Plotting_Functions.C" //also included for peak finding etc.
20     #include "Modules/StudyModule.C" //also included for peak finding etc.
21    
22     #include <TCut.h>
23     #include <TROOT.h>
24     #include <TCanvas.h>
25     #include <TMath.h>
26     #include <TColor.h>
27     #include <TPaveText.h>
28     #include <TRandom.h>
29     #include <TH1.h>
30     #include <TH2.h>
31     #include <TF1.h>
32     #include <TSQLResult.h>
33    
34     #ifndef Verbosity
35     #define Verbosity 0
36     #endif
37     #ifndef HUSH
38     #define HUSH 1
39     #endif
40    
41     using namespace std;
42    
43     using namespace PlottingSetup;
44    
45     int main()
46     {
47     gROOT->SetStyle("Plain");
48     setTDRStyle();
49     gStyle->SetTextFont(42);
50     bool showList=false;
51     set_treename("events");//you can set the treename here to be used; options are "events" (for reco) for "PFevents" (for particle flow)
52     define_samples(showList,allsamples);
53     setlumi(luminosity);
54     do_png(true);
55     do_pdf(false);
56     do_eps(false);
57     do_C(false);
58     set_directory("comparison__corrected__fixed");//here you can give it a name, for instance "1234pb" or whatever you like :-)
59     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!
60     stringstream resultsummary;
61    
62     //what to do :
63     bool do_all=false;/// DONE
64     bool do_peak_finding=false; /// DONE
65     bool do_kinematic_variables=false; ///DONE
66     bool do_kinematic_PF_variables=false; ///DONE
67     bool do_lepton_comparison=false; ///DONE
68     bool do_jzb_plots=false; /// DONE
69     bool do_pred=false; /// DONE
70     bool do_ratio=false; /// DONE
71     bool do_signal_bg_comparison_plot=false; /// DONE
72     bool calculate_pred_and_observed=false; /// DONE
73     bool calculate_yields=false;
74    
75     //--------------------------------------------
76     // not so standard functions
77     bool do_upper_limits=false;
78     bool do_model_scan=false;
79     bool do_zjet_ttbar_shapes=false; /// DONE
80     bool do_test=false;/// DONE (just any test you wish)
81     bool study_sidebands=false;
82     bool do_pick_up_events=true;
83    
84     //--------------------------------------------
85     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
86    
87     //**** part 1 : peak finding
88     float MCPeak=0,MCPeakError=0,DataPeak=0,DataPeakError=0,MCSigma=10,DataSigma=10;
89     method=Kostasmethod;//Kostasmethod;//dogaus3sigma;// options: dogaus,doKM,dogaus2sigma,dogaus3sigma
90     if(do_peak_finding||calculate_pred_and_observed||do_all) find_peaks(MCPeak,MCPeakError, DataPeak, DataPeakError,MCSigma,DataSigma,resultsummary);
91    
92     stringstream datajzb;
93     if(DataPeak>0) datajzb<<"("<<jzbvariabledata<<"-"<<TMath::Abs(DataPeak)<<")";
94     else datajzb<<"("<<jzbvariabledata<<"+"<<TMath::Abs(DataPeak)<<")";
95     stringstream mcjzb;
96     if(MCPeak>0) mcjzb<<"("<<jzbvariablemc<<"-"<<TMath::Abs(MCPeak)<<")";
97     else mcjzb<<"("<<jzbvariablemc<<"+"<<TMath::Abs(MCPeak)<<")";
98    
99     cout << "With peak correction, we get : " << endl;
100     cout << " Data : " << datajzb.str() << endl;
101     cout << " MC : " << datajzb.str() << endl;
102    
103     //jzb response correction
104     if(do_jzb_correction) find_correction_factors(jzbvariabledata,jzbvariablemc);
105     cout << "Please update Modules/Setup.C to reflect the following values (round them first ... )" <<endl;
106     cout << "Corrected JZB variable definition " << endl << " Data: " << jzbvariabledata << " and MC: " << jzbvariablemc << endl;
107     cout << endl;
108     cout << "If you're feeling lazy, copy & paste this : " << endl;
109     cout << " string jzbvariabledata=\""<<jzbvariabledata<<"\";"<<endl;
110     cout << " string jzbvariablemc=\"" <<jzbvariablemc<<"\";"<<endl;
111    
112     if(study_sidebands) look_at_sidebands(mcjzb.str(),datajzb.str());
113    
114     if(do_test) test();
115    
116    
117    
118     return 0;
119     }
120    
121