30 #define COMPILER (!defined(__CINT__) && !defined(__CLING__))
31 #if defined(__MAKECINT__) || defined(__ROOTCLING__) || COMPILER
39 void example_X2X2_to_ZllXHggX(std::string output_name =
40 "output_X2X2_to_ZllXHggX.root"){
51 std::vector<double> mX1;
58 g_Log << LogInfo <<
"Initializing generator frames and tree..." << LogEnd;
61 DecayGenFrame X2X2_Gen(
"X2X2_Gen",
"#tilde{#chi}^{ 0}_{2} #tilde{#chi}^{ 0}_{2}");
75 LAB_Gen.SetChildFrame(X2X2_Gen);
76 X2X2_Gen.AddChildFrame(X2a_Gen);
77 X2X2_Gen.AddChildFrame(X2b_Gen);
78 X2a_Gen.AddChildFrame(Za_Gen);
79 X2a_Gen.AddChildFrame(X1a_Gen);
80 X2b_Gen.AddChildFrame(Hb_Gen);
81 X2b_Gen.AddChildFrame(X1b_Gen);
82 Za_Gen.AddChildFrame(L1_Gen);
83 Za_Gen.AddChildFrame(L2_Gen);
84 Hb_Gen.AddChildFrame(G1_Gen);
85 Hb_Gen.AddChildFrame(G2_Gen);
87 if(LAB_Gen.InitializeTree())
88 g_Log << LogInfo <<
"...Successfully initialized generator tree" << LogEnd;
90 g_Log << LogError <<
"...Failed initializing generator tree" << LogEnd;
94 if(NmX1 < 1 || mX1.size() < 1)
99 X2X2_Gen.SetVariableMass();
100 X2a_Gen.SetMass(mX2); X2b_Gen.SetMass(mX2);
101 X1a_Gen.SetMass(mX1[0]); X1b_Gen.SetMass(mX1[0]);
107 L1_Gen.SetPtCut(8.); L1_Gen.SetEtaCut(2.5);
108 L2_Gen.SetPtCut(8.); L2_Gen.SetEtaCut(2.5);
109 G1_Gen.SetPtCut(20.); G1_Gen.SetEtaCut(3.0);
110 G2_Gen.SetPtCut(20.); G2_Gen.SetEtaCut(3.0);
112 if(LAB_Gen.InitializeAnalysis())
113 g_Log << LogInfo <<
"...Successfully initialized generator analysis" << LogEnd;
115 g_Log << LogError <<
"...Failed initializing generator analysis" << LogEnd;
120 g_Log << LogInfo <<
"Initializing reconstruction frames and tree..." << LogEnd;
123 DecayRecoFrame X2X2(
"X2X2",
"#tilde{#chi}^{ 0}_{2} #tilde{#chi}^{ 0}_{2}");
137 LAB.SetChildFrame(X2X2);
138 X2X2.AddChildFrame(X2a);
139 X2X2.AddChildFrame(X2b);
140 X2a.AddChildFrame(Za);
141 X2a.AddChildFrame(X1a);
142 X2b.AddChildFrame(Hb);
143 X2b.AddChildFrame(X1b);
144 Za.AddChildFrame(L1);
145 Za.AddChildFrame(L2);
146 Hb.AddChildFrame(G1);
147 Hb.AddChildFrame(G2);
149 if(LAB.InitializeTree())
150 g_Log << LogInfo <<
"...Successfully initialized reconstruction trees" << LogEnd;
152 g_Log << LogError <<
"...Failed initializing reconstruction trees" << LogEnd;
158 INV.AddFrames(X1a+X1b);
161 SetMassInvJigsaw X1_mass(
"X1_mass",
"Set M_{#tilde{#chi}_{1}^{ 0} #tilde{#chi}_{1}^{ 0}} to minimum");
162 INV.AddJigsaw(X1_mass);
165 SetRapidityInvJigsaw X1_eta(
"X1_eta",
"#eta_{#tilde{#chi}_{1}^{ 0} #tilde{#chi}_{1}^{ 0}} = #eta_{2#gamma+2#it{l}}");
166 INV.AddJigsaw(X1_eta);
167 X1_eta.AddVisibleFrames(X2X2.GetListVisibleFrames());
172 INV.AddJigsaw(X1X1_contra);
173 X1X1_contra.AddVisibleFrames(X2a.GetListVisibleFrames(), 0);
174 X1X1_contra.AddVisibleFrames(X2b.GetListVisibleFrames(), 1);
175 X1X1_contra.AddInvisibleFrame(X1a, 0);
176 X1X1_contra.AddInvisibleFrame(X1b, 1);
178 if(LAB.InitializeAnalysis())
179 g_Log << LogInfo <<
"...Successfully initialized analysis" << std::endl << LogEnd;
181 g_Log << LogError <<
"...Failed initializing analysis" << LogEnd;
187 treePlot->SetTree(LAB_Gen);
188 treePlot->Draw(
"GenTree",
"Generator Tree",
true);
190 treePlot->SetTree(LAB);
191 treePlot->Draw(
"RecoTree",
"Reconstruction Tree");
193 treePlot->SetTree(INV);
194 treePlot->Draw(
"InvTree",
"Inivisible Jigsaws",
true);
200 std::string(
"#tilde{#chi}_{2}^{ 0} #tilde{#chi}_{2}^{ 0}") +
201 "#rightarrow Z(#it{l}#it{l}) #tilde{#chi}_{1}^{ 0}"+
202 "H(#gamma #gamma) #tilde{#chi}_{1}^{ 0}");
206 sprintf(smassX2,
"m_{#tilde{#chi}^{0}_{2}}= %.0f", mX2);
207 for(
int m = 0; m < NmX1; m++){
209 mX1.push_back(mX1[0] + m*(mX2-mX1[0])/
double(NmX1));
211 char smassX1[200], scat[50];
212 sprintf(scat,
"MX1_%.0f", mX1[m]);
213 sprintf(smassX1,
"m_{#tilde{#chi}^{0}_{1}}= %.0f", mX1[m]);
215 cat_list += histPlot->GetNewCategory(scat, std::string(smassX2)+
216 " , "+std::string(smassX1));
219 const HistPlotVar& MCM = histPlot->GetNewVar(
"MCM",
220 "M_{#tilde{#chi}_{2}^{ 0} #tilde{#chi}_{2}^{ 0}}",
222 const HistPlotVar& EZX2a = histPlot->GetNewVar(
"EZX2a",
"E_{Z}^{ #tilde{#chi}_{2 a}^{ 0}}", 0., 2.);
223 const HistPlotVar& EHX2b = histPlot->GetNewVar(
"EHX2b",
"E_{H}^{ #tilde{#chi}_{2 b}^{ 0}}", 0., 2.);
224 const HistPlotVar& cosX2a = histPlot->GetNewVar(
"cosX2a",
"cos #theta_{#tilde{#chi}_{2 a}^{ 0}}", -1., 1.);
225 const HistPlotVar& cosX2b = histPlot->GetNewVar(
"cosX2b",
"cos #theta_{#tilde{#chi}_{2 b}^{ 0}}", -1., 1.);
226 const HistPlotVar& cosZ = histPlot->GetNewVar(
"cosZ",
"cos #theta_{Z}", -1., 1.);
227 const HistPlotVar& cosH = histPlot->GetNewVar(
"cosH",
"cos #theta_{H}", -1., 1.);
228 const HistPlotVar& DcosZ = histPlot->GetNewVar(
"DcosZ",
"#theta_{Z} - #theta_{Z}^{gen}", -1., 1.);
229 const HistPlotVar& DcosH = histPlot->GetNewVar(
"DcosH",
"#theta_{H} - #theta_{H}^{gen}", -1., 1.);
230 const HistPlotVar& DcosX2a = histPlot->GetNewVar(
"DcosX2a",
"#theta_{X2a} - #theta_{X2a}^{gen}", -1., 1.);
231 const HistPlotVar& DcosX2b = histPlot->GetNewVar(
"DcosX2b",
"#theta_{X2b} - #theta_{X2b}^{gen}", -1., 1.);
232 const HistPlotVar& RISR = histPlot->GetNewVar(
"RISR",
"R_{ISR}", 0., 1.5);
233 const HistPlotVar& PTISR = histPlot->GetNewVar(
"PTISR",
"p_{T}^{ ISR}", 0., 1000.,
"[GeV]");
235 histPlot->AddPlot(MCM, cat_list);
236 histPlot->AddPlot(EZX2a, cat_list);
237 histPlot->AddPlot(EHX2b, cat_list);
238 histPlot->AddPlot(cosZ, cat_list);
239 histPlot->AddPlot(cosH, cat_list);
240 histPlot->AddPlot(DcosZ, cat_list);
241 histPlot->AddPlot(DcosH, cat_list);
242 histPlot->AddPlot(DcosX2a, cat_list);
243 histPlot->AddPlot(DcosX2b, cat_list);
244 histPlot->AddPlot(MCM, EZX2a, cat_list[NmX1/2]);
245 histPlot->AddPlot(MCM, EHX2b, cat_list[NmX1/2]);
246 histPlot->AddPlot(EZX2a, EHX2b, cat_list[NmX1/2]);
247 histPlot->AddPlot(EZX2a, DcosX2a, cat_list[NmX1/2]);
248 histPlot->AddPlot(EHX2b, DcosX2b, cat_list[NmX1/2]);
249 histPlot->AddPlot(cosZ, DcosZ, cat_list[NmX1/2]);
250 histPlot->AddPlot(cosH, DcosH, cat_list[NmX1/2]);
252 histPlot->AddPlot(RISR, cat_list);
253 histPlot->AddPlot(RISR, PTISR, cat_list[NmX1/2]);
254 histPlot->AddPlot(RISR, EZX2a, cat_list[NmX1/2]);
256 for(
int m = 0; m < NmX1; m++){
257 g_Log << LogInfo <<
"Generating events for ";
258 g_Log <<
"mX2 = " << mX2 <<
" , ";
259 g_Log <<
"mX1 = " << mX1[m] << LogEnd;
261 X1a_Gen.SetMass(mX1[m]);
262 X1b_Gen.SetMass(mX1[m]);
264 LAB_Gen.InitializeAnalysis();
266 for(
int igen = 0; igen < Ngen; igen++){
267 if(igen%((std::max(Ngen,10))/10) == 0)
268 g_Log << LogInfo <<
"Generating event " << igen <<
" of " << Ngen << LogEnd;
271 LAB_Gen.ClearEvent();
274 LAB_Gen.SetTransverseMomentum(1000.*gRandom->Rndm());
276 LAB_Gen.AnalyzeEvent();
280 L1.SetLabFrameFourVector(L1_Gen.GetFourVector());
281 L2.SetLabFrameFourVector(L2_Gen.GetFourVector());
282 G1.SetLabFrameFourVector(G1_Gen.GetFourVector());
283 G2.SetLabFrameFourVector(G2_Gen.GetFourVector());
284 TVector3 MET = LAB_Gen.GetInvisibleMomentum();
286 INV.SetLabFrameThreeVector(MET);
290 MCM = X2X2.GetMass() / X2X2_Gen.GetMass();
292 EZX2a = Za.GetEnergy(X2a) / Za_Gen.GetEnergy(X2a_Gen);
293 EHX2b = Hb.GetEnergy(X2b) / Hb_Gen.GetEnergy(X2b_Gen);
295 cosX2a = X2a.GetCosDecayAngle();
296 double cosX2agen = X2a_Gen.GetCosDecayAngle();
297 cosX2b = X2b.GetCosDecayAngle();
298 double cosX2bgen = X2b_Gen.GetCosDecayAngle();
299 cosZ = Za.GetCosDecayAngle();
300 double cosZgen = Za_Gen.GetCosDecayAngle();
301 cosH = Hb.GetCosDecayAngle();
302 double cosHgen = Hb_Gen.GetCosDecayAngle();
304 DcosX2a = asin(sqrt(1.-cosX2a*cosX2a)*cosX2agen-sqrt(1.-cosX2agen*cosX2agen)*cosX2a);
305 DcosX2b = asin(sqrt(1.-cosX2b*cosX2b)*cosX2bgen-sqrt(1.-cosX2bgen*cosX2bgen)*cosX2b);
306 DcosZ = asin(sqrt(1.-cosZ*cosZ)*cosZgen-sqrt(1.-cosZgen*cosZgen)*cosZ);
307 DcosH = asin(sqrt(1.-cosH*cosH)*cosHgen-sqrt(1.-cosHgen*cosHgen)*cosH);
309 TVector3 vP_ISR = X2X2.GetFourVector(LAB).Vect();
310 TVector3 vP_I = X2X2.GetListInvisibleFrames().GetFourVector(LAB).Vect();
314 RISR = fabs(vP_I.Dot(vP_ISR.Unit())) / vP_ISR.Mag();
315 PTISR = vP_ISR.Mag();
317 histPlot->Fill(cat_list[m]);
320 LAB_Gen.PrintGeneratorEfficiency();
325 TFile fout(output_name.c_str(),
"RECREATE");
327 histPlot->WriteOutput(output_name);
328 histPlot->WriteHist(output_name);
329 treePlot->WriteOutput(output_name);
331 g_Log << LogInfo <<
"Finished" << LogEnd;
334 # ifndef __CINT__ // main function for stand-alone compilation
336 example_X2X2_to_ZllXHggX();