ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/cbrown/AnalysisFramework/Plotting/various_studies.C
Revision: 1.7
Committed: Wed Jul 20 09:15:27 2011 UTC (13 years, 9 months ago) by buchmann
Content type: text/plain
Branch: MAIN
Changes since 1.6: +0 -1 lines
Log Message:
Removed residual include

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