ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/cbrown/AnalysisFramework/DistributedModelCalculations/Limits/RunLimits.C
Revision: 1.1
Committed: Mon Jul 25 15:41:12 2011 UTC (13 years, 9 months ago) by buchmann
Content type: text/plain
Branch: MAIN
Log Message:
Uploading first version of distributed limit calculation

File Contents

# User Rev Content
1 buchmann 1.1 #include <iostream>
2     #include <vector>
3     #include <sys/stat.h>
4     #include "../../Plotting/Modules/GeneralToolBox.C"
5     #include "../../Plotting/Modules/SampleClass.C"
6     #include "../../Plotting/Modules/PeakFinder.C"
7     #include "../../Plotting/Modules/Poisson_Calculator.C"
8     #include "../../Plotting/Modules/setTDRStyle.C"
9     #include "../../Plotting/Modules/ActiveSamples.C"
10     #include "../../Plotting/Modules/Setup.C"
11     #include "../../Plotting/Modules/UpperLimitsWithShape.C"
12     #include "../../Plotting/Modules/external/cl95cms.c"
13     #include "../../Plotting/Modules/Plotting_Functions.C"
14     #include "../../Plotting/Modules/ResultModule.C"
15     #include "../../Plotting/Modules/LimitCalculation.C"
16     #include "../../Plotting/Modules/Systematics.C"
17     #include "../../Plotting/Modules/SUSYScan.C"
18    
19     #include <TCut.h>
20     #include <TROOT.h>
21     #include <TCanvas.h>
22     #include <TMath.h>
23     #include <TColor.h>
24     #include <TPaveText.h>
25     #include <TRandom.h>
26     #include <TH1.h>
27     #include <TH2.h>
28     #include <TF1.h>
29     #include <TSQLResult.h>
30    
31     #ifndef Verbosity
32     #define Verbosity 0
33     #endif
34     #ifndef HUSH
35     #define HUSH 1
36     #endif
37    
38     //using namespace std;
39    
40     using namespace PlottingSetup;
41    
42     int main(int narg, char *args[])
43     {
44     if(narg<3||narg>3) {
45     cout << "USAGE : " << endl;
46     cout << args[0] << " Njobs thisjob" << endl;
47     cout << " where jzbcutoff is the cutoff for jzb, Njobs is the number of jobs, and thisjob correspond to this jobs' job number" << endl;
48     return -1;
49     }
50    
51     float njobs=atoi(args[1]);
52     float jobnumber=atoi(args[2]);
53    
54     gROOT->SetStyle("Plain");
55     setTDRStyle();
56     gStyle->SetTextFont(42);
57     bool showList=false;
58     set_directory("summer_mc_with_PURW__workingtowardsPreApp");//here you can give it a name, for instance "1234pb" or whatever you like :-)
59     set_treename("events");//you can set the treename here to be used; options are "events" (for reco) for "PFevents" (for particle flow)
60     define_samples(showList,allsamples,signalsamples,scansample);
61     setlumi(luminosity);
62     do_png(true);
63     do_pdf(false);
64     do_eps(false);
65     do_C(false);
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    
69    
70     //what to do :
71     bool dopoisson=false;//should we calculate stat err with poisson? ///DONE
72     bool verbose=false;//prints out a lot more information ... ///DONE
73     //--------------------------------------------
74     // Systematics and limits
75     bool requireZ=true; // should we require a Z for MC efficiency?
76     // More not-so-standard stuff
77     bool do_model_scan=true;
78     bool do_zjet_ttbar_shapes=false; /// DONE
79     bool do_test=false;/// DONE (just any test you wish)
80     bool do_pick_up_events=false; ///DONE
81     //---------------------------------------------
82    
83     float MCPeak=0,MCPeakError=0,DataPeak=0,DataPeakError=0,MCSigma=10,DataSigma=10;
84     method=Kostasmethod;//Kostasmethod;//dogaus3sigma;// options: dogaus,doKM,dogaus2sigma,dogaus3sigma
85     find_peaks(MCPeak,MCPeakError, DataPeak, DataPeakError,MCSigma,DataSigma,resultsummary);
86    
87     stringstream datajzb;
88     if(DataPeak>0) datajzb<<"("<<jzbvariabledata<<"-"<<TMath::Abs(DataPeak)<<")";
89     else datajzb<<"("<<jzbvariabledata<<"+"<<TMath::Abs(DataPeak)<<")";
90     stringstream mcjzb;
91     if(MCPeak>0) mcjzb<<"("<<jzbvariablemc<<"-"<<TMath::Abs(MCPeak)<<")";
92     else mcjzb<<"("<<jzbvariablemc<<"+"<<TMath::Abs(MCPeak)<<")";
93    
94     dout << "With peak correction, we get : " << endl;
95     dout << " Data : " << datajzb.str() << endl;
96     dout << " MC : " << mcjzb.str() << endl;
97    
98     //**** part 8: observed and predicted!
99     vector<float> jzb_cut; //starting where, please?
100     jzb_cut.push_back(50);
101     // jzb_cut.push_back(75);
102     jzb_cut.push_back(100);
103     /* jzb_cut.push_back(125);
104     jzb_cut.push_back(150);
105     jzb_cut.push_back(175);
106     jzb_cut.push_back(200);
107     jzb_cut.push_back(225);
108     jzb_cut.push_back(250);*/
109     // jzb_cut.push_back(250);
110     bool doquick=true;
111     get_result(mcjzb.str(),datajzb.str(),DataPeakError,MCPeakError,jzb_cut,verbose,dopoisson,doquick);
112     scan_SUSY_parameter_space(mcjzb.str(),datajzb.str(),jzb_cut,requireZ,MCPeakError, njobs, jobnumber);
113    
114     return 0;
115     }
116