30 #if (!defined(__CINT__) && !defined(__CLING__))
33 #if defined(__MAKECINT__) || defined(__ROOTCLING__) || defined(COMPILER)
39 using namespace RestFrames;
41 void example_H_to_ttbar_to_bWlnubWlnu(std::string output_name =
42 "output_H_to_ttbar_to_bWlnubWlnu.root"){
50 std::vector<double> mH;
60 g_Log << LogInfo <<
"Initializing generator frames and tree..." << LogEnd;
77 LAB_Gen.SetChildFrame(H_Gen);
78 H_Gen.AddChildFrame(Ta_Gen);
79 H_Gen.AddChildFrame(Tb_Gen);
80 Ta_Gen.AddChildFrame(Ba_Gen);
81 Ta_Gen.AddChildFrame(Wa_Gen);
82 Tb_Gen.AddChildFrame(Bb_Gen);
83 Tb_Gen.AddChildFrame(Wb_Gen);
84 Wa_Gen.AddChildFrame(La_Gen);
85 Wa_Gen.AddChildFrame(Na_Gen);
86 Wb_Gen.AddChildFrame(Lb_Gen);
87 Wb_Gen.AddChildFrame(Nb_Gen);
89 if(LAB_Gen.InitializeTree())
90 g_Log << LogInfo <<
"...Successfully initialized generator tree" << LogEnd;
92 g_Log << LogError <<
"...Failed initializing generator tree" << LogEnd;
96 if(mH.size() < 1)
return;
101 Ta_Gen.SetMass(mT); Tb_Gen.SetMass(mT);
103 Wa_Gen.SetMass(mW); Wb_Gen.SetMass(mW);
105 Ba_Gen.SetMass(mB); Bb_Gen.SetMass(mB);
107 La_Gen.SetMass(mL); Lb_Gen.SetMass(mL);
109 Na_Gen.SetMass(mN); Nb_Gen.SetMass(mN);
112 Ba_Gen.SetPtCut(20.); Bb_Gen.SetPtCut(20.);
113 Ba_Gen.SetEtaCut(2.5); Bb_Gen.SetEtaCut(2.5);
114 La_Gen.SetPtCut(15.); Lb_Gen.SetPtCut(15.);
115 La_Gen.SetEtaCut(2.5); Lb_Gen.SetEtaCut(2.5);
117 if(LAB_Gen.InitializeAnalysis())
118 g_Log << LogInfo <<
"...Successfully initialized generator analysis" << LogEnd;
120 g_Log << LogError <<
"...Failed initializing generator analysis" << LogEnd;
124 g_Log << LogInfo <<
"Initializing reconstruction frames and tree..." << LogEnd;
142 LAB.SetChildFrame(H);
145 Ta.AddChildFrame(Ba);
146 Ta.AddChildFrame(Wa);
147 Tb.AddChildFrame(Bb);
148 Tb.AddChildFrame(Wb);
149 Wa.AddChildFrame(La);
150 Wa.AddChildFrame(Na);
151 Wb.AddChildFrame(Lb);
152 Wb.AddChildFrame(Nb);
154 if(LAB.InitializeTree())
155 g_Log << LogInfo <<
"...Successfully initialized reconstruction tree" << LogEnd;
157 g_Log << LogError <<
"...Failed initializing reconstruction tree" << LogEnd;
162 std::string group_name;
165 group_name =
"#nu #nu Jigsaws";
172 B.SetNElementsForFrame(Ba, 1);
173 B.SetNElementsForFrame(Bb, 1);
176 std::string jigsaw_name;
179 jigsaw_name =
"M_{#nu #nu} ~ m_{#it{l} #it{l}}";
181 INV.AddJigsaw(NuNuM);
183 jigsaw_name =
"#eta_{#nu#nu} = #eta_{b #it{l} b #it{l}}";
185 INV.AddJigsaw(NuNuR);
186 NuNuR.AddVisibleFrames(H.GetListVisibleFrames());
188 jigsaw_name =
"min ( M_{top a}- M_{top b} )^{2}";
190 INV.AddJigsaw(MinDeltaMt);
191 MinDeltaMt.AddInvisibleFrame(Na, 0);
192 MinDeltaMt.AddInvisibleFrame(Nb, 1);
193 MinDeltaMt.AddVisibleFrames(La+Ba, 0);
194 MinDeltaMt.AddVisibleFrames(Lb+Bb, 1);
195 MinDeltaMt.AddMassFrame(La, 0);
196 MinDeltaMt.AddMassFrame(Lb, 1);
199 jigsaw_name =
"Minimize M(b #it{l} )_{a} , M(b #it{l} )_{b}";
203 MinBL.AddFrames(La+Ba,0);
204 MinBL.AddFrames(Lb+Bb,1);
206 if(LAB.InitializeAnalysis())
207 g_Log << LogInfo <<
"...Successfully initialized analysis" << LogEnd;
209 g_Log << LogError <<
"...Failed initializing analysis" << LogEnd;
217 treePlot->
Draw(
"GenTree",
"Generator Tree",
true);
220 treePlot->
Draw(
"RecoTree",
"Reconstruction Tree");
223 treePlot->
Draw(
"VisTree",
"b-jet Jigsaws",
true);
226 treePlot->
Draw(
"InvTree",
"Inivisible Jigsaws",
true);
230 std::string plot_title =
"H^{ 0} #rightarrow t #bar{t} #rightarrow b W(#it{l} #nu) b W(#it{l} #nu)";
234 int Nmass = mH.size();
235 for(
int m = 0; m < Nmass; m++){
236 char smass[50], scat[50];
237 sprintf(scat,
"MH%.0f", mH[m]);
238 sprintf(smass,
"m_{H^{ 0}} = %.0f", mH[m]);
243 const HistPlotVar& Eb_ta = histPlot->
GetNewVar(
"Eb_ta",
"E_{b a}^{top a} / E_{b a}^{top a gen}", 0., 2.);
244 const HistPlotVar& Eb_tb = histPlot->
GetNewVar(
"Eb_tb",
"E_{b b}^{top b} / E_{b b}^{top b gen}", 0., 2.);
245 const HistPlotVar& El_Wa = histPlot->
GetNewVar(
"El_Wa",
"E_{#it{l} a}^{W a} / E_{#it{l} a}^{W a true}", 0., 2.);
246 const HistPlotVar& El_Wb = histPlot->
GetNewVar(
"El_Wb",
"E_{#it{l} b}^{W b} / E_{#it{l} b}^{W b true}", 0., 2.);
252 const HistPlotVar& DcosH = histPlot->
GetNewVar(
"Dcostt",
"#theta_{H^{ 0}} - #theta_{H^{ 0}}^{true}",
253 -acos(-1.)/2., acos(-1.)/2.);
254 const HistPlotVar& Dcosta = histPlot->
GetNewVar(
"Dcosta",
"#theta_{top a} - #theta_{top a}^{true}",
255 -acos(-1.)/2., acos(-1.)/2.);
256 const HistPlotVar& Dcostb = histPlot->
GetNewVar(
"Dcostb",
"#theta_{top b} - #theta_{top b}^{true}",
257 -acos(-1.)/2., acos(-1.)/2.);
259 -acos(-1.)/2., acos(-1.)/2.);
261 -acos(-1.)/2., acos(-1.)/2.);
263 histPlot->
AddPlot(MH, cat_list);
264 histPlot->
AddPlot(Eb_ta, cat_list);
265 histPlot->
AddPlot(El_Wa, cat_list);
266 histPlot->
AddPlot(DcosH, cat_list);
267 histPlot->
AddPlot(Dcosta, cat_list);
268 histPlot->
AddPlot(DcosWa, cat_list);
270 histPlot->
AddPlot(MH, Eb_ta, cat_list[1]);
271 histPlot->
AddPlot(MH, El_Wa, cat_list[1]);
272 histPlot->
AddPlot(Eb_ta, Eb_tb, cat_list[1]);
273 histPlot->
AddPlot(El_Wa, El_Wb, cat_list[1]);
274 histPlot->
AddPlot(Eb_ta, El_Wa, cat_list[1]);
275 histPlot->
AddPlot(DcosH, MH, cat_list[1]);
276 histPlot->
AddPlot(Dcosta, Eb_ta, cat_list[1]);
277 histPlot->
AddPlot(DcosWa, El_Wa, cat_list[1]);
278 histPlot->
AddPlot(DcosH, Dcosta, cat_list[1]);
279 histPlot->
AddPlot(Dcosta, Dcostb, cat_list[1]);
280 histPlot->
AddPlot(DcosWa, DcosWb, cat_list[1]);
281 histPlot->
AddPlot(Dcosta, DcosWa, cat_list[1]);
286 for(
int m = 0; m < Nmass; m++){
287 g_Log << LogInfo <<
"Generating events for H^{0} mass = " << mH[m] << LogEnd;
289 H_Gen.SetMass(mH[m]);
290 LAB_Gen.InitializeAnalysis();
292 for(
int igen = 0; igen < Ngen; igen++){
293 if(igen%((std::max(Ngen,10))/10) == 0)
294 g_Log << LogInfo <<
"Generating event " << igen <<
" of " << Ngen << LogEnd;
297 LAB_Gen.ClearEvent();
299 LAB_Gen.AnalyzeEvent();
301 TVector3 MET = LAB_Gen.GetInvisibleMomentum();
307 INV.SetLabFrameThreeVector(MET);
309 La.SetLabFrameFourVector(La_Gen.GetFourVector());
310 Lb.SetLabFrameFourVector(Lb_Gen.GetFourVector());
312 B.AddLabFrameFourVector(Ba_Gen.GetFourVector());
313 B.AddLabFrameFourVector(Bb_Gen.GetFourVector());
321 double MHgen = H_Gen.GetMass();
322 double Eb_tagen = Ba_Gen.GetFourVector(Ta_Gen).E();
323 double Eb_tbgen = Bb_Gen.GetFourVector(Tb_Gen).E();
324 double El_Wagen = La_Gen.GetFourVector(Wa_Gen).E();
325 double El_Wbgen = Lb_Gen.GetFourVector(Wb_Gen).E();
326 double cosHgen = H_Gen.GetCosDecayAngle();
327 double costagen = Ta_Gen.GetCosDecayAngle();
328 double costbgen = Tb_Gen.GetCosDecayAngle();
329 double cosWagen = Wa_Gen.GetCosDecayAngle();
330 double cosWbgen = Wb_Gen.GetCosDecayAngle();
332 MH = H.GetMass()/MHgen;
333 Eb_ta = Ba.GetFourVector(Ta).E()/Eb_tagen;
334 Eb_tb = Bb.GetFourVector(Tb).E()/Eb_tbgen;
335 El_Wa = La.GetFourVector(Wa).E()/El_Wagen;
336 El_Wb = Lb.GetFourVector(Wb).E()/El_Wbgen;
337 cosH = H.GetCosDecayAngle();
338 costa = Ta.GetCosDecayAngle();
339 costb = Tb.GetCosDecayAngle();
340 cosWa = Wa.GetCosDecayAngle();
341 cosWb = Wb.GetCosDecayAngle();
342 DcosH = asin(sqrt(1.-cosH*cosH)*cosHgen-sqrt(1.-cosHgen*cosHgen)*cosH);
343 Dcosta = asin(sqrt(1.-costa*costa)*costagen-sqrt(1.-costagen*costagen)*costa);
344 Dcostb = asin(sqrt(1.-costb*costb)*costbgen-sqrt(1.-costbgen*costbgen)*costb);
345 DcosWa = asin(sqrt(1.-cosWa*cosWa)*cosWagen-sqrt(1.-cosWagen*cosWagen)*cosWa);
346 DcosWb = asin(sqrt(1.-cosWb*cosWb)*cosWbgen-sqrt(1.-cosWbgen*cosWbgen)*cosWb);
348 histPlot->
Fill(cat_list[m]);
351 LAB_Gen.PrintGeneratorEfficiency();
356 TFile fout(output_name.c_str(),
"RECREATE");
362 g_Log << LogInfo <<
"Finished" << LogEnd;
365 # ifndef __CINT__ // main function for stand-alone compilation
367 example_H_to_ttbar_to_bWlnubWlnu();