30 #if (!defined(__CINT__) && !defined(__CLING__))
33 #if defined(__MAKECINT__) || defined(__ROOTCLING__) || defined(COMPILER)
39 using namespace RestFrames;
41 void example_Zll(
const std::string& output_name =
"output_Zll.root"){
50 g_Log << LogInfo <<
"Initializing generator frames and tree..." << LogEnd;
59 LAB_Gen.SetChildFrame(Z_Gen);
60 Z_Gen.AddChildFrame(Lp_Gen);
61 Z_Gen.AddChildFrame(Lm_Gen);
63 if(LAB_Gen.InitializeTree())
64 g_Log << LogInfo <<
"...Successfully initialized generator tree" << LogEnd;
66 g_Log << LogError <<
"...Failed initializing generator tree" << LogEnd;
71 Z_Gen.SetMass(mZ); Z_Gen.SetWidth(wZ);
74 Lp_Gen.SetPtCut(15.); Lp_Gen.SetEtaCut(2.5);
75 Lm_Gen.SetPtCut(15.); Lm_Gen.SetEtaCut(2.5);
77 if(LAB_Gen.InitializeAnalysis())
78 g_Log << LogInfo <<
"...Successfully initialized generator analysis" << std::endl << LogEnd;
80 g_Log << LogError <<
"...Failed initializing generator analysis" << LogEnd;
85 g_Log << LogInfo <<
"Initializing reconstruction frames and trees..." << LogEnd;
98 if(LAB.InitializeTree())
99 g_Log << LogInfo <<
"...Successfully initialized reconstruction trees" << LogEnd;
101 g_Log << LogError <<
"...Failed initializing reconstruction trees" << LogEnd;
103 if(LAB.InitializeAnalysis())
104 g_Log << LogInfo <<
"...Successfully initialized analyses" << LogEnd;
106 g_Log << LogError <<
"...Failed initializing analyses" << LogEnd;
115 tree_plot->
Draw(
"GenTree",
"Generator Tree",
true);
119 tree_plot->
Draw(
"RecoTree",
"Reconstruction Tree");
124 HistPlot* hist_plot =
new HistPlot(
"HistPlot",
"Z #rightarrow #it{l}^{+} #it{l}^{-}");
135 for(
int igen = 0; igen < Ngen; igen++){
136 if(igen%((std::max(Ngen,10))/10) == 0)
137 g_Log << LogInfo <<
"Generating event " << igen <<
" of " << Ngen << LogEnd;
140 LAB_Gen.ClearEvent();
142 double PTZ = mZ*gRandom->Rndm();
143 LAB_Gen.SetTransverseMomentum(PTZ);
144 double PzZ = mZ*(2.*gRandom->Rndm()-1.);
145 LAB_Gen.SetLongitudinalMomentum(PzZ);
147 LAB_Gen.AnalyzeEvent();
152 Lp.SetLabFrameFourVector(Lp_Gen.GetFourVector(), 1);
153 Lm.SetLabFrameFourVector(Lm_Gen.GetFourVector(),-1);
159 cosZ = Z.GetCosDecayAngle();
160 dphiZ = LAB.GetDeltaPhiDecayPlanes(Z);
167 TFile fout(output_name.c_str(),
"RECREATE");
175 # ifndef __CINT__ // main function for stand-alone compilation