15 #include "TPaveText.h" 47 TColor
c_tt_2l(1006, 86/255.,160/255.,211/255.);
48 TColor
c_tt_1l(1000, 1/255.,57/255.,166/255.);
50 int main(
int argc,
char *argv[]){
58 string folder =
"/cms5r0/ald77/archive/2015_05_25/skim/";
60 string sig_name =
compressed ?
"*T1tttt*1200*800*":
"*T1tttt*1500*100*";
64 double mj_max = 1000.;
67 TGraph g_sig, g_bkg, g_bkg1, g_bkg2;
68 TGraph g_sig_full, g_bkg_full, g_bkg1_full, g_bkg2_full;
69 TH2D h(
"h",
";M_{J} [GeV];m_{T} [GeV]", 1, 0., mj_max, 1, 0., mt_max);
72 TLine l_mj(400.,0.,400.,mt_max);
73 TLine l_mt(0.,140.,mj_max,140.);
74 l_mj.SetLineWidth(line_width);
75 l_mt.SetLineWidth(line_width);
77 double ttbar_norm = 1.;
86 Process(st_sig, g_sig, g_sig_full, 2, 20, 1, indices_sig);
88 Process(st_bkg, g_bkg, g_bkg_full, 1006, 21, 1, indices_bkg);
90 Process(st_bkg, g_bkg1, g_bkg1_full, 1000, 23, 1, indices_bkg, 1);
91 Process(st_bkg, g_bkg2, g_bkg2_full, 1006, 22, 1, indices_bkg, 2);
94 double rho_sig = g_sig_full.GetCorrelationFactor();
96 double rho_bkg = g_bkg_full.GetCorrelationFactor();
97 double rho_bkg1 = g_bkg1_full.GetCorrelationFactor();
98 double rho_bkg2 = g_bkg2_full.GetCorrelationFactor();
107 l.SetFillStyle(4000);
110 l.AddEntry(&g_bkg,
GetLabel(
"ttbar",rho_bkg).c_str(),
"p");
112 l.AddEntry(&g_bkg1,
GetLabel(
"t#bar{t} (1l)",rho_bkg1).c_str(),
"p");
113 l.AddEntry(&g_bkg2,
GetLabel(
"t#bar{t} (2l)",rho_bkg2).c_str(),
"p");
116 l.AddEntry(&g_sig,
GetLabel((
compressed?
"T1tttt(1200,800)":
"T1tttt(1500,100)"),rho_sig).c_str(),
"p");
119 double height = 0.125;
120 double width = 0.125;
136 lcms.AddText(
"#font[62]{CMS Simulation}");
143 lcms.SetTextColorAlpha(1,1.);
150 g_bkg1.Draw(
"psame");
151 g_bkg2.Draw(
"psame");
166 outname <<
"plots/scat_mj_mt_met_" 174 c.Print(outname.str().c_str());
179 if(num_entries<1)
return set<size_t>();
181 double weight = st.
weight();
182 int num_points = std::min((norm<=0.
184 :TMath::Nint(10.*weight*num_entries*norm)),
186 cout <<
"Selecting " << num_points <<
" out of " << num_entries <<
"..." << endl;
188 while(indices.size() <
static_cast<size_t>(num_points)){
189 indices.insert(rand3.Integer(num_entries));
195 int color,
int marker,
int size,
196 const set<size_t> &indices,
int nleps){
200 Timer timer(num_entries, 1.);
203 for(
int entry = 0; entry < num_entries; ++entry){
218 double mj = std::min(999.9
f, st.
mj());
219 double mt = std::min(399.9
f, st.
mt());
222 if(indices.find(entry) == indices.end())
continue;
226 if(mt<=140&&mj>400) n2++;
227 if(mt>140&&mj>400) n4++;
230 if(color==2)cout<<
"Nsig in R2 is "<<n2<<
" and in R4 is "<<n4<<endl;
231 g.SetLineColor(color);
232 g.SetFillColor(color);
233 g.SetMarkerColor(color);
234 g.SetMarkerStyle(marker);
235 g.SetMarkerSize(size);
241 oss << str <<
", #rho=" <<
RoundNumber(rho,2) << flush;
247 static struct option long_options[] = {
248 {
"met_min", required_argument, 0, 0},
249 {
"met_max", required_argument, 0, 0},
250 {
"njets_min", required_argument, 0, 0},
251 {
"njets_max", required_argument, 0, 0},
252 {
"seed", required_argument, 0, 0},
253 {
"merge_ttbar", no_argument, 0, 0},
254 {
"compressed", no_argument, 0, 0},
255 {
"no_signal", no_argument, 0, 0},
256 {
"full_stats", no_argument, 0, 0},
262 opt = getopt_long(argc, argv,
"", long_options, &option_index);
268 optname = long_options[option_index].name;
269 if(optname ==
"met_min"){
271 }
else if(optname ==
"met_max"){
273 }
else if(optname ==
"njets_min"){
275 }
else if(optname ==
"seed"){
277 }
else if(optname ==
"njets_max"){
279 }
else if(optname ==
"merge_ttbar"){
281 }
else if(optname ==
"compressed"){
283 }
else if(optname ==
"no_signal"){
285 }
else if(optname ==
"full_stats"){
296 pt.SetFillStyle(4000);
298 pt.SetTextColorAlpha(1,0.5);
virtual int const & ntruleps() const
void SetStyle(TPaveText &pt)
void AddPoint(TGraph &graph, const double x, const double y)
float const & weight() const
string GetLabel(const string &str, double rho)
set< size_t > GetRandomIndices(small_tree_quick &st, double norm, TRandom3 &rand3)
int main(int argc, char *argv[])
float const & met() const
virtual float const & mj() const
TString RoundNumber(double num, int decimals, double denom=1.)
TColor c_tt_2l(1006, 86/255., 160/255., 211/255.)
int const & njets() const
TColor c_tt_1l(1000, 1/255., 57/255., 166/255.)
virtual void GetEntry(const long entry)
void GetOptions(int argc, char *argv[])
void Process(small_tree_quick &st, TGraph &g, TGraph &g_full, int color, int marker, int size, const set< size_t > &indices, int nleps)