30 #if (!defined(__CINT__) && !defined(__CLING__))
33 #if defined(__MAKECINT__) || defined(__ROOTCLING__) || defined(COMPILER)
39 using namespace RestFrames;
41 void example_H_to_hh_to_4Wlnu(
const std::string& output_name =
"output_example_04.root"){
54 g_Log << LogInfo <<
"Initializing generator frames and tree..." << LogEnd;
75 LAB_G.SetChildFrame(H_G);
76 H_G.AddChildFrame(ha_G);
77 H_G.AddChildFrame(hb_G);
78 ha_G.AddChildFrame(Waa_G);
79 ha_G.AddChildFrame(Wab_G);
80 hb_G.AddChildFrame(Wba_G);
81 hb_G.AddChildFrame(Wbb_G);
82 Waa_G.AddChildFrame(Laa_G);
83 Waa_G.AddChildFrame(Naa_G);
84 Wab_G.AddChildFrame(Lab_G);
85 Wab_G.AddChildFrame(Nab_G);
86 Wba_G.AddChildFrame(Lba_G);
87 Wba_G.AddChildFrame(Nba_G);
88 Wbb_G.AddChildFrame(Lbb_G);
89 Wbb_G.AddChildFrame(Nbb_G);
91 if(LAB_G.InitializeTree())
92 g_Log << LogInfo <<
"...Successfully initialized generator tree" << LogEnd;
94 g_Log << LogError <<
"...Failed initializing generator tree" << LogEnd;
119 Laa_G.SetEtaCut(2.5);
120 Lab_G.SetEtaCut(2.5);
121 Lba_G.SetEtaCut(2.5);
122 Lbb_G.SetEtaCut(2.5);
124 if(LAB_G.InitializeAnalysis())
125 g_Log << LogInfo <<
"...Successfully initialized generator analysis" << LogEnd;
127 g_Log << LogError <<
"...Failed initializing generator analysis" << LogEnd;
132 g_Log << LogInfo <<
"Initializing reconstruction frames and trees..." << LogEnd;
154 LAB_R.SetChildFrame(H_R);
155 H_R.AddChildFrame(ha_R);
156 H_R.AddChildFrame(hb_R);
157 ha_R.AddChildFrame(Waa_R);
158 ha_R.AddChildFrame(Wab_R);
159 hb_R.AddChildFrame(Wba_R);
160 hb_R.AddChildFrame(Wbb_R);
161 Waa_R.AddChildFrame(Laa_R);
162 Waa_R.AddChildFrame(Naa_R);
163 Wab_R.AddChildFrame(Lab_R);
164 Wab_R.AddChildFrame(Nab_R);
165 Wba_R.AddChildFrame(Lba_R);
166 Wba_R.AddChildFrame(Nba_R);
167 Wbb_R.AddChildFrame(Lbb_R);
168 Wbb_R.AddChildFrame(Nbb_R);
170 if(LAB_R.InitializeTree())
171 g_Log << LogInfo <<
"...Successfully initialized reconstruction tree" << LogEnd;
173 g_Log << LogError <<
"...Failed initializing reconstruction tree" << LogEnd;
179 INV_R.AddFrame(Naa_R);
180 INV_R.AddFrame(Nab_R);
181 INV_R.AddFrame(Nba_R);
182 INV_R.AddFrame(Nbb_R);
186 INV_R.AddJigsaw(NuNuM_R);
189 INV_R.AddJigsaw(NuNuR_R);
190 NuNuR_R.AddVisibleFrames(LAB_R.GetListVisibleFrames());
193 INV_R.AddJigsaw(MinMh_R);
194 MinMh_R.AddInvisibleFrames(ha_R.GetListInvisibleFrames(), 0);
195 MinMh_R.AddInvisibleFrames(hb_R.GetListInvisibleFrames(), 1);
196 MinMh_R.AddVisibleFrames(ha_R.GetListVisibleFrames(), 0);
197 MinMh_R.AddVisibleFrames(hb_R.GetListVisibleFrames(), 1);
203 INV_R.AddJigsaw(MinMWa_R);
204 MinMWa_R.AddInvisibleFrames(Waa_R.GetListInvisibleFrames(), 0);
205 MinMWa_R.AddInvisibleFrames(Wab_R.GetListInvisibleFrames(), 1);
206 MinMWa_R.AddVisibleFrames(Waa_R.GetListVisibleFrames(), 0);
207 MinMWa_R.AddVisibleFrames(Wab_R.GetListVisibleFrames(), 1);
208 MinMWa_R.AddMassFrame(Lba_R, 0);
209 MinMWa_R.AddMassFrame(Lbb_R, 1);
215 INV_R.AddJigsaw(MinMWb_R);
216 MinMWb_R.AddInvisibleFrames(Wba_R.GetListInvisibleFrames(), 0);
217 MinMWb_R.AddInvisibleFrames(Wbb_R.GetListInvisibleFrames(), 1);
218 MinMWb_R.AddVisibleFrames(Wba_R.GetListVisibleFrames(), 0);
219 MinMWb_R.AddVisibleFrames(Wbb_R.GetListVisibleFrames(), 1);
220 MinMWb_R.AddMassFrame(Laa_R, 0);
221 MinMWb_R.AddMassFrame(Lab_R, 1);
225 VIS_R.AddFrame(Lab_R);
226 VIS_R.AddFrame(Lbb_R);
228 VIS_R.SetNElementsForFrame(Lab_R, 1);
229 VIS_R.SetNElementsForFrame(Lbb_R, 1);
232 VIS_R.AddJigsaw(MinMll_R);
233 MinMll_R.AddCombFrame(Lab_R, 0);
234 MinMll_R.AddCombFrame(Lbb_R, 1);
235 MinMll_R.AddObjectFrames(Laa_R+Lab_R, 0);
236 MinMll_R.AddObjectFrames(Lba_R+Lbb_R, 1);
238 if(LAB_R.InitializeAnalysis())
239 g_Log << LogInfo <<
"...Successfully initialized analysis" << LogEnd;
241 g_Log << LogError <<
"...Failed initializing analysis" << LogEnd;
249 treePlot->
Draw(
"GenTree",
"Generator Tree",
true);
252 treePlot->
Draw(
"RecoTree",
"Reconstruction Tree");
255 treePlot->
Draw(
"InvTree",
"Invisible Jigsaws",
true);
259 std::string plot_title =
"H #rightarrow hh #rightarrow W(#it{l} #nu) W(#it{l} #nu)";
278 -acos(-1.)/2., acos(-1.)/2.);
280 -acos(-1.)/2., acos(-1.)/2.);
282 -acos(-1.)/2., acos(-1.)/2.);
283 const HistPlotVar& DcosWaa = histPlot->
GetNewVar(
"DcosWaa",
"#theta_{W a,a} - #theta_{W a,a}^{ true}",
284 -acos(-1.)/2., acos(-1.)/2.);
285 const HistPlotVar& DcosWab = histPlot->
GetNewVar(
"DcosWab",
"#theta_{W a,b} - #theta_{W a,b}^{ true}",
286 -acos(-1.)/2., acos(-1.)/2.);
288 histPlot->
AddPlot(MWaa, MWab, cat_Gen+cat_Reco);
289 histPlot->
AddPlot(MWaa, MWbb, cat_Gen+cat_Reco);
290 histPlot->
AddPlot(MH, cat_Reco);
291 histPlot->
AddPlot(Mha, cat_Reco);
292 histPlot->
AddPlot(Mha, Mhb, cat_Reco);
293 histPlot->
AddPlot(MH, Mha, cat_Reco);
294 histPlot->
AddPlot(Mha, MWaa, cat_Reco);
295 histPlot->
AddPlot(DcosH, cat_Reco);
296 histPlot->
AddPlot(Dcosha, cat_Reco);
297 histPlot->
AddPlot(MH, DcosH, cat_Reco);
298 histPlot->
AddPlot(Mha, Dcosha, cat_Reco);
299 histPlot->
AddPlot(DcosH, Dcosha, cat_Reco);
300 histPlot->
AddPlot(Dcosha, Dcoshb, cat_Reco);
302 histPlot->
AddPlot(DcosWaa, cat_Reco);
303 histPlot->
AddPlot(DcosWaa, DcosWab, cat_Reco);
308 for(
int igen = 0; igen < Ngen; igen++){
309 if(igen%((std::max(Ngen,10))/10) == 0)
310 g_Log << LogInfo <<
"Generating event " << igen <<
" of " << Ngen << LogEnd;
314 double PTH = mH*gRandom->Rndm()*0.1;
315 LAB_G.SetTransverseMomentum(PTH);
316 LAB_G.AnalyzeEvent();
321 TVector3 MET = LAB_G.GetInvisibleMomentum();
323 INV_R.SetLabFrameThreeVector(MET);
331 Laa_R.SetLabFrameFourVector(Laa_G.GetFourVector(),-1);
332 Lba_R.SetLabFrameFourVector(Lba_G.GetFourVector(),-1);
333 std::vector<RFKey> L_ID;
334 L_ID.push_back(VIS_R.AddLabFrameFourVector(Lab_G.GetFourVector(), 1));
335 L_ID.push_back(VIS_R.AddLabFrameFourVector(Lbb_G.GetFourVector(), 1));
342 LAB_R.AnalyzeEvent();
345 double MHgen = H_G.GetMass();
346 double Mhagen = ha_G.GetMass();
347 double Mhbgen = hb_G.GetMass();
348 double cosHgen = H_G.GetCosDecayAngle();
349 double coshagen = ha_G.GetCosDecayAngle();
350 double coshbgen = hb_G.GetCosDecayAngle();
354 double cosWaagen = Waa_G.GetCosDecayAngle();
355 double cosWabgen = Wab_G.GetCosDecayAngle();
356 MWaa = Waa_G.GetMass();
357 MWab = Wab_G.GetMass();
358 MWba = Wba_G.GetMass();
359 MWbb = Wbb_G.GetMass();
361 histPlot->
Fill(cat_Gen);
364 MH = H_R.GetMass()/MHgen;
368 Mha = 2.*ha_R.GetListVisibleFrames().GetEnergy(ha_R)/Mhagen;
369 Mhb = 2.*hb_R.GetListVisibleFrames().GetEnergy(hb_R)/Mhbgen;
370 cosH = H_R.GetCosDecayAngle();
371 cosha = ha_R.GetCosDecayAngle();
372 coshb = hb_R.GetCosDecayAngle();
373 cosWaa = Waa_R.GetCosDecayAngle();
374 cosWab = Wab_R.GetCosDecayAngle();
375 MWaa = Waa_R.GetMass();
376 MWab = Wab_R.GetMass();
377 MWba = Wba_R.GetMass();
378 MWbb = Wbb_R.GetMass();
379 DcosH = asin(sqrt(1.-cosH*cosH)*cosHgen-sqrt(1.-cosHgen*cosHgen)*cosH);
380 Dcosha = asin(sqrt(1.-cosha*cosha)*coshagen-sqrt(1.-coshagen*coshagen)*cosha);
381 Dcoshb = asin(sqrt(1.-coshb*coshb)*coshbgen-sqrt(1.-coshbgen*coshbgen)*coshb);
382 DcosWaa = asin(sqrt(1.-cosWaa*cosWaa)*cosWaagen-sqrt(1.-cosWaagen*cosWaagen)*cosWaa);
383 DcosWab = asin(sqrt(1.-cosWab*cosWab)*cosWabgen-sqrt(1.-cosWabgen*cosWabgen)*cosWab);
386 histPlot->
Fill(cat_Reco);
401 LAB_G.PrintGeneratorEfficiency();
403 g_Log << LogInfo <<
"Finished" << LogEnd;
406 # ifndef __CINT__ // main function for stand-alone compilation
408 example_H_to_hh_to_4Wlnu();