30 #if (!defined(__CINT__) && !defined(__CLING__))
33 #if defined(__MAKECINT__) || defined(__ROOTCLING__) || defined(COMPILER)
39 using namespace RestFrames;
41 void example_H_to_WlnuWlnu(
const std::string& output_name =
42 "output_H_to_WlnuWlnu.root"){
50 std::vector<double> mH;
61 g_Log << LogInfo <<
"Initializing generator frames and tree..." << LogEnd;
74 LAB_Gen.SetChildFrame(H_Gen);
75 H_Gen.AddChildFrame(Wa_Gen);
76 H_Gen.AddChildFrame(Wb_Gen);
77 Wa_Gen.AddChildFrame(La_Gen);
78 Wa_Gen.AddChildFrame(Na_Gen);
79 Wb_Gen.AddChildFrame(Lb_Gen);
80 Wb_Gen.AddChildFrame(Nb_Gen);
82 if(LAB_Gen.InitializeTree())
83 g_Log << LogInfo <<
"...Successfully initialized generator tree" << LogEnd;
85 g_Log << LogError <<
"...Failed initializing generator tree" << LogEnd;
88 if(mH.size() < 1)
return;
93 Wa_Gen.SetMass(mW); Wa_Gen.SetWidth(wW);
94 Wb_Gen.SetMass(mW); Wb_Gen.SetWidth(wW);
96 La_Gen.SetMass(mL); Lb_Gen.SetMass(mL);
99 La_Gen.SetPtCut(10.); Lb_Gen.SetPtCut(10.);
100 La_Gen.SetEtaCut(2.5); Lb_Gen.SetEtaCut(2.5);
102 if(LAB_Gen.InitializeAnalysis())
103 g_Log << LogInfo <<
"...Successfully initialized generator analysis" << LogEnd;
105 g_Log << LogError <<
"...Failed initializing generator analysis" << LogEnd;
110 g_Log << LogInfo <<
"Initializing reconstruction frames and trees..." << LogEnd;
123 LAB.SetChildFrame(H);
126 Wa.AddChildFrame(La);
127 Wa.AddChildFrame(Na);
128 Wb.AddChildFrame(Lb);
129 Wb.AddChildFrame(Nb);
131 if(LAB.InitializeTree())
132 g_Log << LogInfo <<
"...Successfully initialized reconstruction tree" << LogEnd;
134 g_Log << LogError <<
"...Failed initializing reconstruction tree" << LogEnd;
145 INV.AddJigsaw(NuNuM);
148 INV.AddJigsaw(NuNuR);
149 NuNuR.AddVisibleFrames(LAB.GetListVisibleFrames());
153 INV.AddJigsaw(MinMW);
154 MinMW.AddVisibleFrame(La, 0);
155 MinMW.AddVisibleFrame(Lb, 1);
156 MinMW.AddInvisibleFrame(Na, 0);
157 MinMW.AddInvisibleFrame(Nb, 1);
159 if(LAB.InitializeAnalysis())
160 g_Log << LogInfo <<
"...Successfully initialized analysis" << LogEnd;
162 g_Log << LogError <<
"...Failed initializing analysis" << LogEnd;
170 treePlot->
Draw(
"GenTree",
"Generator Tree",
true);
173 treePlot->
Draw(
"RecoTree",
"Reconstruction Tree");
176 treePlot->
Draw(
"InvTree",
"Invisible Jigsaws",
true);
180 std::string plot_title =
"H^{ 0} #rightarrow W(#it{l} #nu) W(#it{l} #nu)";
184 int Nmass = mH.size();
185 for(
int m = 0; m < Nmass; m++){
186 char smass[50], scat[50];
187 sprintf(scat,
"MH%.0f", mH[m]);
188 sprintf(smass,
"m_{H^{ 0}} = %.0f", mH[m]);
199 const HistPlotVar& dphiH = histPlot->
GetNewVar(
"dphiH",
"#Delta #phi_{H^{ 0}}", 0., 2.*acos(-1.));
200 const HistPlotVar& DcosH = histPlot->
GetNewVar(
"DcosH",
"#theta_{H^{ 0}} - #theta_{H^{ 0}}^{true}",
201 -acos(-1.)/2., acos(-1.)/2.);
202 const HistPlotVar& DcosWa = histPlot->
GetNewVar(
"DcosWa",
"#theta_{W_{a}} - #theta_{W_{a}}^{true}",
203 -acos(-1.)/2., acos(-1.)/2.);
205 histPlot->
AddPlot(MH, cat_list);
206 histPlot->
AddPlot(MHN, cat_list);
207 histPlot->
AddPlot(MWaN, cat_list);
208 histPlot->
AddPlot(DcosH, cat_list);
209 histPlot->
AddPlot(DcosWa, cat_list);
210 histPlot->
AddPlot(MHN, MWaN, cat_list[1]);
211 histPlot->
AddPlot(MHN, DcosH, cat_list[0]);
212 histPlot->
AddPlot(MWaN, DcosWa, cat_list[1]);
217 for(
int m = 0; m < Nmass; m++){
218 g_Log << LogInfo <<
"Generating events for H^{0} mass = " << mH[m] << LogEnd;
220 H_Gen.SetMass(mH[m]);
221 LAB_Gen.InitializeAnalysis();
223 for(
int igen = 0; igen < Ngen; igen++){
224 if(igen%((std::max(Ngen,10))/10) == 0)
225 g_Log << LogInfo <<
"Generating event " << igen <<
" of " << Ngen << LogEnd;
228 LAB_Gen.ClearEvent();
230 LAB_Gen.AnalyzeEvent();
235 TVector3 MET = LAB_Gen.GetInvisibleMomentum();
237 INV.SetLabFrameThreeVector(MET);
239 La.SetLabFrameFourVector(La_Gen.GetFourVector());
240 Lb.SetLabFrameFourVector(Lb_Gen.GetFourVector());
245 double cosHgen = H_Gen.GetCosDecayAngle();
247 double cosWagen = Wa_Gen.GetCosDecayAngle();
251 histPlot->
Fill(cat_Gen);
255 MHN = H.GetMass()/H_Gen.GetMass();
256 MWaN = Wa.GetMass()/Wa_Gen.GetMass();
257 cosH = H.GetCosDecayAngle();
258 cosWa = Wa.GetCosDecayAngle();
259 DcosH = asin(sqrt(1.-cosH*cosH)*cosHgen-sqrt(1.-cosHgen*cosHgen)*cosH);
260 DcosWa = asin(sqrt(1.-cosWa*cosWa)*cosWagen-sqrt(1.-cosWagen*cosWagen)*cosWa);
262 histPlot->
Fill(cat_list[m]);
265 LAB_Gen.PrintGeneratorEfficiency();
270 TFile fout(output_name.c_str(),
"RECREATE");
276 g_Log << LogInfo <<
"Finished" << LogEnd;
279 # ifndef __CINT__ // main function for stand-alone compilation
281 example_H_to_WlnuWlnu();