30 #define COMPILER (!defined(__CINT__) && !defined(__CLING__))
31 #if defined(__MAKECINT__) || defined(__ROOTCLING__) || COMPILER
39 void example_H_to_ttbar_to_bWlnubWlnu(std::string output_name =
40 "output_H_to_ttbar_to_bWlnubWlnu.root"){
48 std::vector<double> mH;
58 g_Log << LogInfo <<
"Initializing generator frames and tree..." << LogEnd;
75 LAB_Gen.SetChildFrame(H_Gen);
76 H_Gen.AddChildFrame(Ta_Gen);
77 H_Gen.AddChildFrame(Tb_Gen);
78 Ta_Gen.AddChildFrame(Ba_Gen);
79 Ta_Gen.AddChildFrame(Wa_Gen);
80 Tb_Gen.AddChildFrame(Bb_Gen);
81 Tb_Gen.AddChildFrame(Wb_Gen);
82 Wa_Gen.AddChildFrame(La_Gen);
83 Wa_Gen.AddChildFrame(Na_Gen);
84 Wb_Gen.AddChildFrame(Lb_Gen);
85 Wb_Gen.AddChildFrame(Nb_Gen);
87 if(LAB_Gen.InitializeTree())
88 g_Log << LogInfo <<
"...Successfully initialized generator tree" << LogEnd;
90 g_Log << LogError <<
"...Failed initializing generator tree" << LogEnd;
94 if(mH.size() < 1)
return;
99 Ta_Gen.SetMass(mT); Tb_Gen.SetMass(mT);
101 Wa_Gen.SetMass(mW); Wb_Gen.SetMass(mW);
103 Ba_Gen.SetMass(mB); Bb_Gen.SetMass(mB);
105 La_Gen.SetMass(mL); Lb_Gen.SetMass(mL);
107 Na_Gen.SetMass(mN); Nb_Gen.SetMass(mN);
110 Ba_Gen.SetPtCut(20.); Bb_Gen.SetPtCut(20.);
111 Ba_Gen.SetEtaCut(2.5); Bb_Gen.SetEtaCut(2.5);
112 La_Gen.SetPtCut(15.); Lb_Gen.SetPtCut(15.);
113 La_Gen.SetEtaCut(2.5); Lb_Gen.SetEtaCut(2.5);
115 if(LAB_Gen.InitializeAnalysis())
116 g_Log << LogInfo <<
"...Successfully initialized generator analysis" << LogEnd;
118 g_Log << LogError <<
"...Failed initializing generator analysis" << LogEnd;
122 g_Log << LogInfo <<
"Initializing reconstruction frames and tree..." << LogEnd;
140 LAB.SetChildFrame(H);
143 Ta.AddChildFrame(Ba);
144 Ta.AddChildFrame(Wa);
145 Tb.AddChildFrame(Bb);
146 Tb.AddChildFrame(Wb);
147 Wa.AddChildFrame(La);
148 Wa.AddChildFrame(Na);
149 Wb.AddChildFrame(Lb);
150 Wb.AddChildFrame(Nb);
152 if(LAB.InitializeTree())
153 g_Log << LogInfo <<
"...Successfully initialized reconstruction tree" << LogEnd;
155 g_Log << LogError <<
"...Failed initializing reconstruction tree" << LogEnd;
160 std::string group_name;
163 group_name =
"#nu #nu Jigsaws";
170 B.SetNElementsForFrame(Ba, 1);
171 B.SetNElementsForFrame(Bb, 1);
174 std::string jigsaw_name;
177 jigsaw_name =
"M_{#nu #nu} ~ m_{#it{l} #it{l}}";
179 INV.AddJigsaw(NuNuM);
181 jigsaw_name =
"#eta_{#nu#nu} = #eta_{b #it{l} b #it{l}}";
183 INV.AddJigsaw(NuNuR);
184 NuNuR.AddVisibleFrames(H.GetListVisibleFrames());
186 jigsaw_name =
"min ( M_{top a}- M_{top b} )^{2}";
188 INV.AddJigsaw(MinDeltaMt);
189 MinDeltaMt.AddInvisibleFrame(Na, 0);
190 MinDeltaMt.AddInvisibleFrame(Nb, 1);
191 MinDeltaMt.AddVisibleFrames(La+Ba, 0);
192 MinDeltaMt.AddVisibleFrames(Lb+Bb, 1);
193 MinDeltaMt.AddMassFrame(La, 0);
194 MinDeltaMt.AddMassFrame(Lb, 1);
197 jigsaw_name =
"Minimize M(b #it{l} )_{a} , M(b #it{l} )_{b}";
201 MinBL.AddFrames(La+Ba,0);
202 MinBL.AddFrames(Lb+Bb,1);
204 if(LAB.InitializeAnalysis())
205 g_Log << LogInfo <<
"...Successfully initialized analysis" << LogEnd;
207 g_Log << LogError <<
"...Failed initializing analysis" << LogEnd;
214 treePlot->SetTree(LAB_Gen);
215 treePlot->Draw(
"GenTree",
"Generator Tree",
true);
217 treePlot->SetTree(LAB);
218 treePlot->Draw(
"RecoTree",
"Reconstruction Tree");
220 treePlot->SetTree(B);
221 treePlot->Draw(
"VisTree",
"b-jet Jigsaws",
true);
223 treePlot->SetTree(INV);
224 treePlot->Draw(
"InvTree",
"Inivisible Jigsaws",
true);
228 std::string plot_title =
"H^{ 0} #rightarrow t #bar{t} #rightarrow b W(#it{l} #nu) b W(#it{l} #nu)";
232 int Nmass = mH.size();
233 for(
int m = 0; m < Nmass; m++){
234 char smass[50], scat[50];
235 sprintf(scat,
"MH%.0f", mH[m]);
236 sprintf(smass,
"m_{H^{ 0}} = %.0f", mH[m]);
237 cat_list += histPlot->GetNewCategory(scat, smass);
240 const HistPlotVar& MH = histPlot->GetNewVar(
"MH",
"M_{H^{ 0}} / m_{H^{ 0}}^{ true}", 0., 2.);
241 const HistPlotVar& Eb_ta = histPlot->GetNewVar(
"Eb_ta",
"E_{b a}^{top a} / E_{b a}^{top a gen}", 0., 2.);
242 const HistPlotVar& Eb_tb = histPlot->GetNewVar(
"Eb_tb",
"E_{b b}^{top b} / E_{b b}^{top b gen}", 0., 2.);
243 const HistPlotVar& El_Wa = histPlot->GetNewVar(
"El_Wa",
"E_{#it{l} a}^{W a} / E_{#it{l} a}^{W a true}", 0., 2.);
244 const HistPlotVar& El_Wb = histPlot->GetNewVar(
"El_Wb",
"E_{#it{l} b}^{W b} / E_{#it{l} b}^{W b true}", 0., 2.);
245 const HistPlotVar& cosH = histPlot->GetNewVar(
"cosH",
"cos #theta_{H^{ 0}}", -1., 1.);
246 const HistPlotVar& costa = histPlot->GetNewVar(
"costa",
"cos #theta_{top a}", -1., 1.);
247 const HistPlotVar& costb = histPlot->GetNewVar(
"costb",
"cos #theta_{top b}", -1., 1.);
248 const HistPlotVar& cosWa = histPlot->GetNewVar(
"cosWa",
"cos #theta_{W a}", -1., 1.);
249 const HistPlotVar& cosWb = histPlot->GetNewVar(
"cosWb",
"cos #theta_{W b}", -1., 1.);
250 const HistPlotVar& DcosH = histPlot->GetNewVar(
"Dcostt",
"#theta_{H^{ 0}} - #theta_{H^{ 0}}^{true}",
251 -acos(-1.)/2., acos(-1.)/2.);
252 const HistPlotVar& Dcosta = histPlot->GetNewVar(
"Dcosta",
"#theta_{top a} - #theta_{top a}^{true}",
253 -acos(-1.)/2., acos(-1.)/2.);
254 const HistPlotVar& Dcostb = histPlot->GetNewVar(
"Dcostb",
"#theta_{top b} - #theta_{top b}^{true}",
255 -acos(-1.)/2., acos(-1.)/2.);
256 const HistPlotVar& DcosWa = histPlot->GetNewVar(
"DcosWa",
"#theta_{W a} - #theta_{W a}^{true}",
257 -acos(-1.)/2., acos(-1.)/2.);
258 const HistPlotVar& DcosWb = histPlot->GetNewVar(
"DcosWb",
"#theta_{W b} - #theta_{W b}^{true}",
259 -acos(-1.)/2., acos(-1.)/2.);
261 histPlot->AddPlot(MH, cat_list);
262 histPlot->AddPlot(Eb_ta, cat_list);
263 histPlot->AddPlot(El_Wa, cat_list);
264 histPlot->AddPlot(DcosH, cat_list);
265 histPlot->AddPlot(Dcosta, cat_list);
266 histPlot->AddPlot(DcosWa, cat_list);
268 histPlot->AddPlot(MH, Eb_ta, cat_list[1]);
269 histPlot->AddPlot(MH, El_Wa, cat_list[1]);
270 histPlot->AddPlot(Eb_ta, Eb_tb, cat_list[1]);
271 histPlot->AddPlot(El_Wa, El_Wb, cat_list[1]);
272 histPlot->AddPlot(Eb_ta, El_Wa, cat_list[1]);
273 histPlot->AddPlot(DcosH, MH, cat_list[1]);
274 histPlot->AddPlot(Dcosta, Eb_ta, cat_list[1]);
275 histPlot->AddPlot(DcosWa, El_Wa, cat_list[1]);
276 histPlot->AddPlot(DcosH, Dcosta, cat_list[1]);
277 histPlot->AddPlot(Dcosta, Dcostb, cat_list[1]);
278 histPlot->AddPlot(DcosWa, DcosWb, cat_list[1]);
279 histPlot->AddPlot(Dcosta, DcosWa, cat_list[1]);
284 for(
int m = 0; m < Nmass; m++){
285 g_Log << LogInfo <<
"Generating events for H^{0} mass = " << mH[m] << LogEnd;
287 H_Gen.SetMass(mH[m]);
288 LAB_Gen.InitializeAnalysis();
290 for(
int igen = 0; igen < Ngen; igen++){
291 if(igen%((std::max(Ngen,10))/10) == 0)
292 g_Log << LogInfo <<
"Generating event " << igen <<
" of " << Ngen << LogEnd;
295 LAB_Gen.ClearEvent();
297 LAB_Gen.AnalyzeEvent();
299 TVector3 MET = LAB_Gen.GetInvisibleMomentum();
305 INV.SetLabFrameThreeVector(MET);
307 La.SetLabFrameFourVector(La_Gen.GetFourVector());
308 Lb.SetLabFrameFourVector(Lb_Gen.GetFourVector());
310 B.AddLabFrameFourVector(Ba_Gen.GetFourVector());
311 B.AddLabFrameFourVector(Bb_Gen.GetFourVector());
319 double MHgen = H_Gen.GetMass();
320 double Eb_tagen = Ba_Gen.GetFourVector(Ta_Gen).E();
321 double Eb_tbgen = Bb_Gen.GetFourVector(Tb_Gen).E();
322 double El_Wagen = La_Gen.GetFourVector(Wa_Gen).E();
323 double El_Wbgen = Lb_Gen.GetFourVector(Wb_Gen).E();
324 double cosHgen = H_Gen.GetCosDecayAngle();
325 double costagen = Ta_Gen.GetCosDecayAngle();
326 double costbgen = Tb_Gen.GetCosDecayAngle();
327 double cosWagen = Wa_Gen.GetCosDecayAngle();
328 double cosWbgen = Wb_Gen.GetCosDecayAngle();
330 MH = H.GetMass()/MHgen;
331 Eb_ta = Ba.GetFourVector(Ta).E()/Eb_tagen;
332 Eb_tb = Bb.GetFourVector(Tb).E()/Eb_tbgen;
333 El_Wa = La.GetFourVector(Wa).E()/El_Wagen;
334 El_Wb = Lb.GetFourVector(Wb).E()/El_Wbgen;
335 cosH = H.GetCosDecayAngle();
336 costa = Ta.GetCosDecayAngle();
337 costb = Tb.GetCosDecayAngle();
338 cosWa = Wa.GetCosDecayAngle();
339 cosWb = Wb.GetCosDecayAngle();
340 DcosH = asin(sqrt(1.-cosH*cosH)*cosHgen-sqrt(1.-cosHgen*cosHgen)*cosH);
341 Dcosta = asin(sqrt(1.-costa*costa)*costagen-sqrt(1.-costagen*costagen)*costa);
342 Dcostb = asin(sqrt(1.-costb*costb)*costbgen-sqrt(1.-costbgen*costbgen)*costb);
343 DcosWa = asin(sqrt(1.-cosWa*cosWa)*cosWagen-sqrt(1.-cosWagen*cosWagen)*cosWa);
344 DcosWb = asin(sqrt(1.-cosWb*cosWb)*cosWbgen-sqrt(1.-cosWbgen*cosWbgen)*cosWb);
346 histPlot->Fill(cat_list[m]);
349 LAB_Gen.PrintGeneratorEfficiency();
354 TFile fout(output_name.c_str(),
"RECREATE");
356 histPlot->WriteOutput(output_name);
357 histPlot->WriteHist(output_name);
358 treePlot->WriteOutput(output_name);
360 g_Log << LogInfo <<
"Finished" << LogEnd;
363 # ifndef __CINT__ // main function for stand-alone compilation
365 example_H_to_ttbar_to_bWlnubWlnu();