30 #define COMPILER (!defined(__CINT__) && !defined(__CLING__))
31 #if defined(__MAKECINT__) || defined(__ROOTCLING__) || COMPILER
39 void example_DiStop_to_bXp_bXm_to_blNblN(std::string output_name =
40 "output_DiStop_to_bXp_bXm_to_blNblN.root"){
56 g_Log << LogInfo <<
"Initializing generator frames and tree..." << LogEnd;
73 LAB_Gen.SetChildFrame(CM_Gen);
74 CM_Gen.AddChildFrame(Ta_Gen);
75 CM_Gen.AddChildFrame(Tb_Gen);
76 Ta_Gen.AddChildFrame(Ba_Gen);
77 Ta_Gen.AddChildFrame(Xa_Gen);
78 Tb_Gen.AddChildFrame(Bb_Gen);
79 Tb_Gen.AddChildFrame(Xb_Gen);
80 Xa_Gen.AddChildFrame(La_Gen);
81 Xa_Gen.AddChildFrame(Na_Gen);
82 Xb_Gen.AddChildFrame(Lb_Gen);
83 Xb_Gen.AddChildFrame(Nb_Gen);
85 if(LAB_Gen.InitializeTree())
86 g_Log << LogInfo <<
"...Successfully initialized generator tree" << LogEnd;
88 g_Log << LogError <<
"...Failed initializing generator tree" << LogEnd;
95 CM_Gen.SetVariableMass();
97 Ta_Gen.SetMass(mT); Tb_Gen.SetMass(mT);
99 Xa_Gen.SetMass(0.5*(mT+mN)); Xb_Gen.SetMass(0.5*(mT+mN));
101 Ba_Gen.SetMass(mB); Bb_Gen.SetMass(mB);
103 La_Gen.SetMass(mL); Lb_Gen.SetMass(mL);
105 Na_Gen.SetMass(mN); Nb_Gen.SetMass(mN);
108 Ba_Gen.SetPtCut(20.); Bb_Gen.SetPtCut(20.);
109 Ba_Gen.SetEtaCut(2.5); Bb_Gen.SetEtaCut(2.5);
110 La_Gen.SetPtCut(15.); Lb_Gen.SetPtCut(15.);
111 La_Gen.SetEtaCut(2.5); Lb_Gen.SetEtaCut(2.5);
113 if(LAB_Gen.InitializeAnalysis())
114 g_Log << LogInfo <<
"...Successfully initialized generator analysis" << LogEnd;
116 g_Log << LogError <<
"...Failed initializing generator analysis" << LogEnd;
120 g_Log << LogInfo <<
"Initializing reconstruction frames and tree..." << LogEnd;
138 LAB.SetChildFrame(CM);
139 CM.AddChildFrame(Ta);
140 CM.AddChildFrame(Tb);
141 Ta.AddChildFrame(Ba);
142 Ta.AddChildFrame(Xa);
143 Tb.AddChildFrame(Bb);
144 Tb.AddChildFrame(Xb);
145 Xa.AddChildFrame(La);
146 Xa.AddChildFrame(Na);
147 Xb.AddChildFrame(Lb);
148 Xb.AddChildFrame(Nb);
150 if(LAB.InitializeTree())
151 g_Log << LogInfo <<
"...Successfully initialized reconstruction tree" << LogEnd;
153 g_Log << LogError <<
"...Failed initializing reconstruction tree" << LogEnd;
158 std::string group_name;
161 group_name =
"#tilde{#nu} #tilde{#nu} Jigsaws";
168 B.SetNElementsForFrame(Ba, 1);
169 B.SetNElementsForFrame(Bb, 1);
172 std::string jigsaw_name;
175 jigsaw_name =
"M_{#tilde{#nu} #tilde{#nu}} ~ m_{#it{l} #it{l}}";
177 INV.AddJigsaw(NuNuM);
179 jigsaw_name =
"#eta_{#tilde{#nu} #tilde{#nu}} = #eta_{b #it{l} b #it{l}}";
181 INV.AddJigsaw(NuNuR);
182 NuNuR.AddVisibleFrames(CM.GetListVisibleFrames());
184 jigsaw_name =
"min ( M_{#tilde{t} a}- M_{#tilde{t} b} )^{2}";
187 INV.AddJigsaw(MinDeltaMt);
188 MinDeltaMt.AddInvisibleFrame(Na, 0);
189 MinDeltaMt.AddInvisibleFrame(Nb, 1);
190 MinDeltaMt.AddVisibleFrames(La+Ba, 0);
191 MinDeltaMt.AddVisibleFrames(Lb+Bb, 1);
192 MinDeltaMt.AddMassFrame(La, 0);
193 MinDeltaMt.AddMassFrame(Lb, 1);
196 jigsaw_name =
"Minimize M(b #it{l} )_{a} , M(b #it{l} )_{b}";
200 MinBL.AddFrames(La+Ba,0);
201 MinBL.AddFrames(Lb+Bb,1);
203 if(LAB.InitializeAnalysis())
204 g_Log << LogInfo <<
"...Successfully initialized analysis" << LogEnd;
206 g_Log << LogError <<
"...Failed initializing analysis" << LogEnd;
213 treePlot->SetTree(LAB_Gen);
214 treePlot->Draw(
"GenTree",
"Generator Tree",
true);
216 treePlot->SetTree(LAB);
217 treePlot->Draw(
"RecoTree",
"Reconstruction Tree");
219 treePlot->SetTree(B);
220 treePlot->Draw(
"VisTree",
"b-jet Jigsaws",
true);
222 treePlot->SetTree(INV);
223 treePlot->Draw(
"InvTree",
"Inivisible Jigsaws",
true);
227 std::string plot_title =
228 "#tilde{t} #tilde{t} #rightarrow 2x [ b #tilde{#chi}^{ #pm}(#it{l} #tilde{#nu}) ]";
230 sprintf(smasses,
"m_{#tilde{t}}= %.0f, m_{#tilde{#nu}}= %.0f", mT, mN);
231 HistPlot* histPlot =
new HistPlot(
"HistPlot", plot_title+
" , "+std::string(smasses));
233 std::string R_MXN =
"#frac{m_{#tilde{#chi}^{ #pm}} - m_{#tilde{#nu}}}";
234 std::string R_MXD =
"{m_{#tilde{t}} - m_{#tilde{#nu}}}";
236 for(
int m = 0; m < NMX; m++){
237 char smass[200], scat[50];
238 sprintf(scat,
"MX%d_%d", m+1, NMX+1);
239 sprintf(smass,
" = #frac{%d}{%d}", m+1, NMX+1);
241 cat_list += histPlot->GetNewCategory(scat,
"#scale[0.7]{"+R_MXN+R_MXD+std::string(smass)+
"}");
246 plot_title+
" , "+std::string(smasses));
248 const HistPlotVar& MCM = histPlot->GetNewVar(
"MCM",
"M_{CM} / m_{CM}^{ true}", 0., 2.);
249 const HistPlotVar& Eb_Ta = histPlot->GetNewVar(
"Eb_Ta",
250 "E_{b a}^{#tilde{t} a} / E_{b a}^{#tilde{t} a gen}", 0., 2.);
251 const HistPlotVar& Eb_Tb = histPlot->GetNewVar(
"Eb_Tb",
252 "E_{b b}^{#tilde{t} b} / E_{b b}^{#tilde{t} b gen}", 0., 2.);
253 const HistPlotVar& El_Xa = histPlot->GetNewVar(
"El_Xa",
254 "E_{#it{l} a}^{#tilde{#chi}^{ #pm} a} / E_{#it{l} a}^{#tilde{#chi}^{ #pm} a true}", 0., 2.);
255 const HistPlotVar& El_Xb = histPlot->GetNewVar(
"El_Xb",
256 "E_{#it{l} b}^{#tilde{#chi}^{ #pm} b} / E_{#it{l} b}^{#tilde{#chi}^{ #pm} b true}", 0., 2.);
257 const HistPlotVar& cosCM = histPlot->GetNewVar(
"cosCM",
"cos #theta_{CM}", -1., 1.);
258 const HistPlotVar& cosTa = histPlot->GetNewVar(
"cosTa",
"cos #theta_{#tilde{t} a}", -1., 1.);
259 const HistPlotVar& cosTb = histPlot->GetNewVar(
"cosTb",
"cos #theta_{#tilde{t} b}", -1., 1.);
260 const HistPlotVar& cosXa = histPlot->GetNewVar(
"cosXa",
"cos #theta_{#tilde{#chi}^{ #pm} a}", -1., 1.);
261 const HistPlotVar& cosXb = histPlot->GetNewVar(
"cosXb",
"cos #theta_{#tilde{#chi}^{ #pm} b}", -1., 1.);
262 const HistPlotVar& DcosCM = histPlot->GetNewVar(
"DcosCM",
"#theta_{CM} - #theta_{CM}^{true}",
263 -acos(-1.)/2., acos(-1.)/2.);
264 const HistPlotVar& DcosTa = histPlot->GetNewVar(
"Dcosta",
265 "#theta_{#tilde{t} a} - #theta_{#tilde{t} a}^{true}", -acos(-1.)/2., acos(-1.)/2.);
266 const HistPlotVar& DcosTb = histPlot->GetNewVar(
"Dcostb",
267 "#theta_{#tilde{t} b} - #theta_{#tilde{t} b}^{true}", -acos(-1.)/2., acos(-1.)/2.);
268 const HistPlotVar& DcosXa = histPlot->GetNewVar(
"DcosXa",
269 "#theta_{#tilde{#chi}^{ #pm} a} - #theta_{#tilde{#chi}^{ #pm} a}^{true}", -acos(-1.)/2., acos(-1.)/2.);
270 const HistPlotVar& DcosXb = histPlot->GetNewVar(
"DcosXb",
271 "#theta_{#tilde{#chi}^{ #pm} b} - #theta_{#tilde{#chi}^{ #pm} b}^{true}", -acos(-1.)/2., acos(-1.)/2.);
272 const HistPlotVar& RMX = histPlot->GetNewVar(
"RMX",
"#scale[0.6]{"+R_MXN+R_MXD+
"}", 0., 1.);
274 histPlot->AddPlot(MCM, cat_list);
275 histPlot->AddPlot(Eb_Ta, cat_list);
276 histPlot->AddPlot(El_Xa, cat_list);
277 histPlot->AddPlot(DcosCM, cat_list);
278 histPlot->AddPlot(DcosTa, cat_list);
279 histPlot->AddPlot(DcosXa, cat_list);
281 histPlot->AddPlot(MCM, Eb_Ta, cat_list[NMX/2]);
282 histPlot->AddPlot(MCM, El_Xa, cat_list[NMX/2]);
283 histPlot->AddPlot(Eb_Ta, Eb_Tb, cat_list[NMX/2]);
284 histPlot->AddPlot(El_Xa, El_Xb, cat_list[NMX/2]);
285 histPlot->AddPlot(Eb_Ta, El_Xa, cat_list[NMX/2]);
286 histPlot->AddPlot(DcosCM, MCM, cat_list[NMX/2]);
287 histPlot->AddPlot(DcosTa, Eb_Ta, cat_list[NMX/2]);
288 histPlot->AddPlot(DcosXa, El_Xa, cat_list[NMX/2]);
289 histPlot->AddPlot(DcosCM, DcosTa, cat_list[NMX/2]);
290 histPlot->AddPlot(DcosTa, DcosTb, cat_list[NMX/2]);
291 histPlot->AddPlot(DcosXa, DcosXb, cat_list[NMX/2]);
294 histPlot->AddPlot(MCM, RMX, cat_Reco);
295 histPlot->AddPlot(Eb_Ta, RMX, cat_Reco);
296 histPlot->AddPlot(El_Xa, RMX, cat_Reco);
302 for(
int m = 0; m < NMX; m++){
303 g_Log << LogInfo <<
"Generating events for ";
304 g_Log <<
"(mXp - mN) / (mT - mN)";
305 g_Log <<
" = " << m+1 <<
" / " << NMX+1 << LogEnd;
307 RMX = double(m+1)/double(NMX+1);
308 Xa_Gen.SetMass(RMX*mT + (1.-RMX)*mN);
313 Xb_Gen.SetMass(RMX*mT + (1.-RMX)*mN);
316 LAB_Gen.InitializeAnalysis();
318 for(
int igen = 0; igen < Ngen; igen++){
319 if(igen%((std::max(Ngen,10))/10) == 0)
320 g_Log << LogInfo <<
"Generating event " << igen <<
" of " << Ngen << LogEnd;
323 LAB_Gen.ClearEvent();
325 LAB_Gen.AnalyzeEvent();
327 TVector3 MET = LAB_Gen.GetInvisibleMomentum();
333 INV.SetLabFrameThreeVector(MET);
335 La.SetLabFrameFourVector(La_Gen.GetFourVector());
336 Lb.SetLabFrameFourVector(Lb_Gen.GetFourVector());
338 B.AddLabFrameFourVector(Ba_Gen.GetFourVector());
339 B.AddLabFrameFourVector(Bb_Gen.GetFourVector());
347 double MCMgen = CM_Gen.GetMass();
348 double Eb_Tagen = Ba_Gen.GetFourVector(Ta_Gen).E();
349 double Eb_Tbgen = Bb_Gen.GetFourVector(Tb_Gen).E();
350 double El_Xagen = La_Gen.GetFourVector(Xa_Gen).E();
351 double El_Xbgen = Lb_Gen.GetFourVector(Xb_Gen).E();
352 double cosCMgen = CM_Gen.GetCosDecayAngle();
353 double cosTagen = Ta_Gen.GetCosDecayAngle();
354 double cosTbgen = Tb_Gen.GetCosDecayAngle();
355 double cosXagen = Xa_Gen.GetCosDecayAngle();
356 double cosXbgen = Xb_Gen.GetCosDecayAngle();
358 MCM = CM.GetMass()/MCMgen;
359 Eb_Ta = Ba.GetFourVector(Ta).E()/Eb_Tagen;
360 Eb_Tb = Bb.GetFourVector(Tb).E()/Eb_Tbgen;
361 El_Xa = La.GetFourVector(Xa).E()/El_Xagen;
362 El_Xb = Lb.GetFourVector(Xb).E()/El_Xbgen;
363 cosCM = CM.GetCosDecayAngle();
364 cosTa = Ta.GetCosDecayAngle();
365 cosTb = Tb.GetCosDecayAngle();
366 cosXa = Xa.GetCosDecayAngle();
367 cosXb = Xb.GetCosDecayAngle();
368 DcosCM = asin(sqrt(1.-cosCM*cosCM)*cosCMgen-sqrt(1.-cosCMgen*cosCMgen)*cosCM);
369 DcosTa = asin(sqrt(1.-cosTa*cosTa)*cosTagen-sqrt(1.-cosTagen*cosTagen)*cosTa);
370 DcosTb = asin(sqrt(1.-cosTb*cosTb)*cosTbgen-sqrt(1.-cosTbgen*cosTbgen)*cosTb);
371 DcosXa = asin(sqrt(1.-cosXa*cosXa)*cosXagen-sqrt(1.-cosXagen*cosXagen)*cosXa);
372 DcosXb = asin(sqrt(1.-cosXb*cosXb)*cosXbgen-sqrt(1.-cosXbgen*cosXbgen)*cosXb);
374 histPlot->Fill(cat_list[m]);
375 histPlot->Fill(cat_Reco);
378 LAB_Gen.PrintGeneratorEfficiency();
383 TFile fout(output_name.c_str(),
"RECREATE");
385 histPlot->WriteOutput(output_name);
386 histPlot->WriteHist(output_name);
387 treePlot->WriteOutput(output_name);
389 g_Log << LogInfo <<
"Finished" << LogEnd;
392 # ifndef __CINT__ // main function for stand-alone compilation
394 example_DiStop_to_bXp_bXm_to_blNblN();