30 #define COMPILER (!defined(__CINT__) && !defined(__CLING__))
31 #if defined(__MAKECINT__) || defined(__ROOTCLING__) || COMPILER
39 void example_H_to_WlnuWlnu(
const std::string& output_name =
40 "output_H_to_WlnuWlnu.root"){
48 std::vector<double> mH;
59 g_Log << LogInfo <<
"Initializing generator frames and tree..." << LogEnd;
72 LAB_Gen.SetChildFrame(H_Gen);
73 H_Gen.AddChildFrame(Wa_Gen);
74 H_Gen.AddChildFrame(Wb_Gen);
75 Wa_Gen.AddChildFrame(La_Gen);
76 Wa_Gen.AddChildFrame(Na_Gen);
77 Wb_Gen.AddChildFrame(Lb_Gen);
78 Wb_Gen.AddChildFrame(Nb_Gen);
80 if(LAB_Gen.InitializeTree())
81 g_Log << LogInfo <<
"...Successfully initialized generator tree" << LogEnd;
83 g_Log << LogError <<
"...Failed initializing generator tree" << LogEnd;
86 if(mH.size() < 1)
return;
91 Wa_Gen.SetMass(mW); Wa_Gen.SetWidth(wW);
92 Wb_Gen.SetMass(mW); Wb_Gen.SetWidth(wW);
94 La_Gen.SetMass(mL); Lb_Gen.SetMass(mL);
97 La_Gen.SetPtCut(10.); Lb_Gen.SetPtCut(10.);
98 La_Gen.SetEtaCut(2.5); Lb_Gen.SetEtaCut(2.5);
100 if(LAB_Gen.InitializeAnalysis())
101 g_Log << LogInfo <<
"...Successfully initialized generator analysis" << LogEnd;
103 g_Log << LogError <<
"...Failed initializing generator analysis" << LogEnd;
108 g_Log << LogInfo <<
"Initializing reconstruction frames and trees..." << LogEnd;
121 LAB.SetChildFrame(H);
124 Wa.AddChildFrame(La);
125 Wa.AddChildFrame(Na);
126 Wb.AddChildFrame(Lb);
127 Wb.AddChildFrame(Nb);
129 if(LAB.InitializeTree())
130 g_Log << LogInfo <<
"...Successfully initialized reconstruction tree" << LogEnd;
132 g_Log << LogError <<
"...Failed initializing reconstruction tree" << LogEnd;
143 INV.AddJigsaw(NuNuM);
146 INV.AddJigsaw(NuNuR);
147 NuNuR.AddVisibleFrames(LAB.GetListVisibleFrames());
151 INV.AddJigsaw(MinMW);
152 MinMW.AddVisibleFrame(La, 0);
153 MinMW.AddVisibleFrame(Lb, 1);
154 MinMW.AddInvisibleFrame(Na, 0);
155 MinMW.AddInvisibleFrame(Nb, 1);
157 if(LAB.InitializeAnalysis())
158 g_Log << LogInfo <<
"...Successfully initialized analysis" << LogEnd;
160 g_Log << LogError <<
"...Failed initializing analysis" << LogEnd;
167 treePlot->SetTree(LAB_Gen);
168 treePlot->Draw(
"GenTree",
"Generator Tree",
true);
170 treePlot->SetTree(LAB);
171 treePlot->Draw(
"RecoTree",
"Reconstruction Tree");
173 treePlot->SetTree(INV);
174 treePlot->Draw(
"InvTree",
"Invisible Jigsaws",
true);
178 std::string plot_title =
"H^{ 0} #rightarrow W(#it{l} #nu) W(#it{l} #nu)";
182 int Nmass = mH.size();
183 for(
int m = 0; m < Nmass; m++){
184 char smass[50], scat[50];
185 sprintf(scat,
"MH%.0f", mH[m]);
186 sprintf(smass,
"m_{H^{ 0}} = %.0f", mH[m]);
187 cat_list += histPlot->GetNewCategory(scat, smass);
190 const HistPlotCategory& cat_Gen = histPlot->GetNewCategory(
"Gen",
"Generator");
192 const HistPlotVar& MH = histPlot->GetNewVar(
"MH",
"M_{H^{ 0}}", 0., 3000.,
"[GeV]");
193 const HistPlotVar& MHN = histPlot->GetNewVar(
"MHN",
"M_{H^{ 0}} / m_{H^{ 0}}^{ true}", 0., 2.);
194 const HistPlotVar& MWaN = histPlot->GetNewVar(
"MWaN",
"M_{Wa} / m_{Wa}^{ true}", 0., 3.);
195 const HistPlotVar& cosH = histPlot->GetNewVar(
"cosH",
"cos #theta_{H^{ 0}}", -1., 1.);
196 const HistPlotVar& cosWa = histPlot->GetNewVar(
"cosWa",
"cos #theta_{W_{a}}", -1., 1.);
197 const HistPlotVar& dphiH = histPlot->GetNewVar(
"dphiH",
"#Delta #phi_{H^{ 0}}", 0., 2.*acos(-1.));
198 const HistPlotVar& DcosH = histPlot->GetNewVar(
"DcosH",
"#theta_{H^{ 0}} - #theta_{H^{ 0}}^{true}",
199 -acos(-1.)/2., acos(-1.)/2.);
200 const HistPlotVar& DcosWa = histPlot->GetNewVar(
"DcosWa",
"#theta_{W_{a}} - #theta_{W_{a}}^{true}",
201 -acos(-1.)/2., acos(-1.)/2.);
203 histPlot->AddPlot(MH, cat_list);
204 histPlot->AddPlot(MHN, cat_list);
205 histPlot->AddPlot(MWaN, cat_list);
206 histPlot->AddPlot(DcosH, cat_list);
207 histPlot->AddPlot(DcosWa, cat_list);
208 histPlot->AddPlot(MHN, MWaN, cat_list[1]);
209 histPlot->AddPlot(MHN, DcosH, cat_list[0]);
210 histPlot->AddPlot(MWaN, DcosWa, cat_list[1]);
215 for(
int m = 0; m < Nmass; m++){
216 g_Log << LogInfo <<
"Generating events for H^{0} mass = " << mH[m] << LogEnd;
218 H_Gen.SetMass(mH[m]);
219 LAB_Gen.InitializeAnalysis();
221 for(
int igen = 0; igen < Ngen; igen++){
222 if(igen%((std::max(Ngen,10))/10) == 0)
223 g_Log << LogInfo <<
"Generating event " << igen <<
" of " << Ngen << LogEnd;
226 LAB_Gen.ClearEvent();
228 LAB_Gen.AnalyzeEvent();
233 TVector3 MET = LAB_Gen.GetInvisibleMomentum();
235 INV.SetLabFrameThreeVector(MET);
237 La.SetLabFrameFourVector(La_Gen.GetFourVector());
238 Lb.SetLabFrameFourVector(Lb_Gen.GetFourVector());
243 double cosHgen = H_Gen.GetCosDecayAngle();
245 double cosWagen = Wa_Gen.GetCosDecayAngle();
249 histPlot->Fill(cat_Gen);
253 MHN = H.GetMass()/H_Gen.GetMass();
254 MWaN = Wa.GetMass()/Wa_Gen.GetMass();
255 cosH = H.GetCosDecayAngle();
256 cosWa = Wa.GetCosDecayAngle();
257 DcosH = asin(sqrt(1.-cosH*cosH)*cosHgen-sqrt(1.-cosHgen*cosHgen)*cosH);
258 DcosWa = asin(sqrt(1.-cosWa*cosWa)*cosWagen-sqrt(1.-cosWagen*cosWagen)*cosWa);
260 histPlot->Fill(cat_list[m]);
263 LAB_Gen.PrintGeneratorEfficiency();
268 TFile fout(output_name.c_str(),
"RECREATE");
270 histPlot->WriteOutput(output_name);
271 histPlot->WriteHist(output_name);
272 treePlot->WriteOutput(output_name);
274 g_Log << LogInfo <<
"Finished" << LogEnd;
277 # ifndef __CINT__ // main function for stand-alone compilation
279 example_H_to_WlnuWlnu();