30 #if (!defined(__CINT__) && !defined(__CLING__))
33 #if defined(__MAKECINT__) || defined(__ROOTCLING__) || defined(COMPILER)
39 using namespace RestFrames;
41 void example_DiGluino_to_bbXbbX(std::string output_name =
42 "output_DiGluino_to_bbXbbX.root"){
50 g_Log << LogInfo <<
"Initializing generator frames and tree..." << LogEnd;
65 LAB_Gen.SetChildFrame(GG_Gen);
66 GG_Gen.AddChildFrame(Ga_Gen);
67 GG_Gen.AddChildFrame(Gb_Gen);
68 Ga_Gen.AddChildFrame(V1a_Gen);
69 Ga_Gen.AddChildFrame(V2a_Gen);
70 Ga_Gen.AddChildFrame(Xa_Gen);
71 Gb_Gen.AddChildFrame(V1b_Gen);
72 Gb_Gen.AddChildFrame(V2b_Gen);
73 Gb_Gen.AddChildFrame(Xb_Gen);
75 if(LAB_Gen.InitializeTree())
76 g_Log << LogInfo <<
"...Successfully initialized generator tree" << LogEnd;
78 g_Log << LogError <<
"...Failed initializing generator tree" << LogEnd;
82 GG_Gen.SetVariableMass();
90 V1a_Gen.SetPtCut(30.); V1a_Gen.SetEtaCut(2.5);
91 V1b_Gen.SetPtCut(30.); V1b_Gen.SetEtaCut(2.5);
92 V2a_Gen.SetPtCut(30.); V2a_Gen.SetEtaCut(2.5);
93 V2b_Gen.SetPtCut(30.); V2b_Gen.SetEtaCut(2.5);
95 if(LAB_Gen.InitializeAnalysis())
96 g_Log << LogInfo <<
"...Successfully initialized generator analysis" << std::endl << LogEnd;
98 g_Log << LogError <<
"...Failed initializing generator analysis" << LogEnd;
103 g_Log << LogInfo <<
"Initializing reconstruction frames and trees..." << LogEnd;
120 LAB.SetChildFrame(GG);
121 GG.AddChildFrame(Ga);
122 GG.AddChildFrame(Gb);
123 Ga.AddChildFrame(V1a);
124 Ga.AddChildFrame(Ca);
125 Ca.AddChildFrame(V2a);
126 Ca.AddChildFrame(Xa);
127 Gb.AddChildFrame(V1b);
128 Gb.AddChildFrame(Cb);
129 Cb.AddChildFrame(V2b);
130 Cb.AddChildFrame(Xb);
132 if(LAB.InitializeTree())
133 g_Log << LogInfo <<
"...Successfully initialized reconstruction trees" << LogEnd;
135 g_Log << LogError <<
"...Failed initializing reconstruction trees" << LogEnd;
144 LAB_B.SetChildFrame(CM_B);
145 CM_B.AddChildFrame(V_B);
146 CM_B.AddChildFrame(I_B);
148 if(LAB.InitializeTree())
149 g_Log << LogInfo <<
"...Successfully initialized reconstruction trees" << LogEnd;
151 g_Log << LogError <<
"...Failed initializing reconstruction trees" << LogEnd;
163 VIS.SetNElementsForFrame(V1a,1,
false);
164 VIS.SetNElementsForFrame(V1b,1,
false);
168 VIS.SetNElementsForFrame(V2a,0,
false);
169 VIS.SetNElementsForFrame(V2b,0,
false);
175 VIS_B.SetNElementsForFrame(V_B,1,
false);
181 INV.AddJigsaw(MinMassJigsaw);
183 INV.AddJigsaw(RapidityJigsaw);
184 RapidityJigsaw.AddVisibleFrames((LAB.GetListVisibleFrames()));
186 INV.AddJigsaw(ContraBoostJigsaw);
187 ContraBoostJigsaw.AddVisibleFrames((Ga.GetListVisibleFrames()), 0);
188 ContraBoostJigsaw.AddVisibleFrames((Gb.GetListVisibleFrames()), 1);
189 ContraBoostJigsaw.AddInvisibleFrames((Ga.GetListInvisibleFrames()), 0);
190 ContraBoostJigsaw.AddInvisibleFrames((Gb.GetListInvisibleFrames()), 1);
192 VIS.AddJigsaw(HemiJigsaw);
193 HemiJigsaw.AddFrame(V1a,0);
194 HemiJigsaw.AddFrame(V1b,1);
195 HemiJigsaw.AddFrame(V2a,0);
196 HemiJigsaw.AddFrame(V2b,1);
198 VIS.AddJigsaw(CaHemiJigsaw);
199 CaHemiJigsaw.AddFrame(V1a,0);
200 CaHemiJigsaw.AddFrame(V2a,1);
201 CaHemiJigsaw.AddFrame(Xa,1);
203 VIS.AddJigsaw(CbHemiJigsaw);
204 CbHemiJigsaw.AddFrame(V1b,0);
205 CbHemiJigsaw.AddFrame(V2b,1);
206 CbHemiJigsaw.AddFrame(Xb,1);
209 SetMassInvJigsaw MinMassJigsaw_B(
"MINMASS_B",
"Zero Mass for invisible system");
210 INV_B.AddJigsaw(MinMassJigsaw_B);
212 INV_B.AddJigsaw(RapidityJigsaw_B);
213 RapidityJigsaw_B.AddVisibleFrames((LAB_B.GetListVisibleFrames()));
216 if(LAB.InitializeAnalysis() && LAB_B.InitializeAnalysis())
217 g_Log << LogInfo <<
"...Successfully initialized analyses" << LogEnd;
219 g_Log << LogError <<
"...Failed initializing analyses" << LogEnd;
229 tree_plot->
Draw(
"GenTree",
"Generator Tree",
true);
237 tree_plot->
Draw(
"SigRecoTree",
"Signal Reconstruction Tree");
241 tree_plot->
Draw(
"BkgRecoTree",
"Background Reconstruction Tree");
245 tree_plot->
Draw(
"InvTree",
"Invisible Objects Jigsaws");
249 tree_plot->
Draw(
"VisTree",
"Visible Objects Jigsaws");
252 for(
int igen = 0; igen < Ngen; igen++){
253 if(igen%((std::max(Ngen,10))/10) == 0)
254 g_Log << LogInfo <<
"Generating event " << igen <<
" of " << Ngen << LogEnd;
257 LAB_Gen.ClearEvent();
259 LAB_Gen.SetPToverM(LAB_Gen.GetRandom());
261 LAB_Gen.AnalyzeEvent();
264 TVector3 MET = LAB_Gen.GetInvisibleMomentum();
266 std::vector<TLorentzVector> JETS;
267 JETS.push_back(V1a_Gen.GetFourVector());
268 JETS.push_back(V2a_Gen.GetFourVector());
269 JETS.push_back(V1b_Gen.GetFourVector());
270 JETS.push_back(V2b_Gen.GetFourVector());
274 INV.SetLabFrameThreeVector(MET);
275 std::vector<RFKey> jetID;
276 for(
int i = 0; i < int(JETS.size()); i++)
277 jetID.push_back(VIS.AddLabFrameFourVector(JETS[i]));
282 INV_B.SetLabFrameThreeVector(MET);
283 for(
int i = 0; i < int(JETS.size()); i++){
284 TLorentzVector jet = JETS[i];
285 jet.SetPtEtaPhiM(jet.Pt(), 0., jet.Phi(), jet.M());
286 VIS_B.AddLabFrameFourVector(jet);
288 LAB_B.AnalyzeEvent();
296 int flip = (gRandom->Rndm() > 0.5);
302 VS[(flip+1)%2] = &V1b;
304 VC[(flip+1)%2] = &V2b;
319 double gaminv = GG.GetVisibleShape();
321 TVector3 vPGG = GG.GetFourVector(LAB).Vect();
324 double RPT = vPGG.Pt() / (vPGG.Pt() + shat/4.);
326 double RPZ = vPGG.Pz() / (vPGG.Pz() + shat/4.);
328 double cosGG = GG.GetCosDecayAngle();
330 double dphiLGG = LAB.GetDeltaPhiDecayPlanes(GG);
336 double MG = (vV1.M2()-vV2.M2())/(2.*(vV1.E()-vV2.E()));
339 double MGG = 2.*sqrt(PG*PG + MG*MG);
340 double gaminvGG = 2.*MG/MGG;
341 double beta = sqrt(1.- gaminv*gaminv);
342 double betaGG = sqrt(1.- gaminvGG*gaminvGG);
345 double DeltaBetaGG = -(betaGG-beta)/(1.-betaGG*beta);
347 double dphiVG = GG.GetDeltaPhiDecayVisible();
349 double dphiVGG = GG.GetDeltaPhiBoostVisible();
370 for(
int i = 0; i < 2; i++){
371 NV[i] = VIS.GetNElementsInFrame(*VS[i]);
372 NV[i] += VIS.GetNElementsInFrame(*VC[i]);
374 TVector3 vP1 = VS[i]->GetFourVector(*G[i]).Vect();
375 TVector3 vP2 = VC[i]->GetFourVector(*G[i]).Vect();
376 Pinv[i] = 2.*(vP1+vP2).Mag()/(vP1.Mag()+vP2.Mag()+(vP1+vP2).Mag());
380 int N = jetID.size();
381 double pTmax[2]; pTmax[0] = -1.; pTmax[1] = -1.;
382 for(
int j = 0; j < N; j++){
383 const RestFrame& frame = VIS.GetFrame(jetID[j]);
384 if(VS[i]->IsSame(frame) || VC[i]->IsSame(frame)){
385 double pT = VIS.GetLabFrameFourVector(jetID[j]).Pt();
390 if(pT > pTmax[1]) pTmax[1] = pT;
395 jet1PT[i] = pTmax[0];
396 jet2PT[i] = pTmax[1];
401 RCG[i] = (C[i]->GetMass()-X[i]->GetMass())/(G[i]->GetMass()-X[i]->GetMass());
413 TLorentzVector Psib = I_B.GetSiblingFrame().GetFourVector(LAB_B);
414 TLorentzVector Pmet = I_B.GetFourVector(LAB_B);
417 double Rpsib = std::max(0.,Psib.Vect().Dot(Pmet.Vect().Unit()));
418 Rpsib = Rpsib / (Pmet.Pt() + Rpsib);
420 TVector3 boostQCD = (Pmet+Psib).BoostVector();
421 Psib.Boost(-boostQCD);
422 double cosQCD = -1.*Psib.Vect().Unit().Dot(boostQCD.Unit());
423 cosQCD = (1.-cosQCD)/2.;
426 double DeltaQCD = (cosQCD-Rpsib)/(cosQCD+Rpsib);
430 TFile fout(output_name.c_str(),
"RECREATE");
435 # ifndef __CINT__ // main function for stand-alone compilation
437 example_DiGluino_to_bbXbbX();