e_pi = hypot4(sim.fPxPi, sim.fPyPi, sim.fPzPi, AliPID.ParticleMass(AliPID.kPion)) deu.SetXYZM(sim.fPxDeu, sim.fPyDeu, sim.fPzDeu, AliPID.ParticleMass(AliPID.kDeuteron)) p.SetXYZM(sim.fPxP, sim.fPyP, sim.fPzP, AliPID.ParticleMass(AliPID.kProton)) pi.SetXYZM(sim.fPxPi, sim.fPyPi, sim.fPzPi, AliPID.ParticleMass(AliPID.kPion)) hyp = deu + p + pi decay_lenght = TVector3(sim.fDecayVtxX, sim.fDecayVtxY, sim.fDecayVtxZ) dl = decay_lenght.Mag() if hyp.Gamma() == 0 or hyp.Beta() == 0: continue ct = dl / (hyp.Gamma() * hyp.Beta()) if hyp.Pt() < 1. or hyp.Pt() > 10.: continue hist_ctsim.Fill(ct) hist_ptsim.Fill(hyp.Pt()) hist_psim.Fill(hyp.P()) hist_etasim.Fill(hyp.Eta()) hist_phisim.Fill(hyp.Phi()) # rec - sim diff # if sim.fRecoIndex >= 0:
def __init__(self, parse, tree): #electron and proton energy, GeV self.Ee = parse.getfloat("main", "Ee") self.Ep = parse.getfloat("main", "Ep") print("Ee, GeV =", self.Ee) print("Ep, GeV =", self.Ep) #A and Z of the nucleus self.A = 1 self.Z = 1 if parse.has_option("main", "A"): self.A = parse.getint("main", "A") if parse.has_option("main", "Z"): self.Z = parse.getint("main", "Z") print("A:", self.A) print("Z:", self.Z) #minimal photon energy, GeV self.emin = parse.getfloat("main", "emin") print("emin, GeV =", self.emin) #alpha r_e^2 self.ar2 = 7.297 * 2.818 * 2.818 * 1e-2 # m barn #electron and nucleus mass self.me = TDatabasePDG.Instance().GetParticle(11).Mass() self.mp = TDatabasePDG.Instance().GetParticle(2212).Mass() self.mn = self.A * self.mp #nucleus beam vector nvec = TLorentzVector() pz_a = TMath.Sqrt(self.Ep**2 - self.mp**2) * self.Z en_a = TMath.Sqrt(pz_a**2 + self.mn**2) nvec.SetPxPyPzE(0, 0, pz_a, en_a) print("Nucleus beam gamma:", nvec.Gamma()) #boost vector of nucleus beam self.nbvec = nvec.BoostVector() #electron beam vector evec = TLorentzVector() evec.SetPxPyPzE(0, 0, -TMath.Sqrt(self.Ee**2 - self.me**2), self.Ee) print("Electron beam gamma:", evec.Gamma()) #electron beam energy in nucleus beam rest frame evec.Boost(-self.nbvec.x(), -self.nbvec.y(), -self.nbvec.z()) self.Ee_n = evec.E() print("Ee_n, GeV:", self.Ee_n) #minimal photon energy in nucleus rest frame eminv = TLorentzVector() eminv.SetPxPyPzE(0, 0, -self.emin, self.emin) eminv.Boost(-self.nbvec.x(), -self.nbvec.y(), -self.nbvec.z()) emin_n = eminv.E() print("emin_n, GeV:", emin_n) #maximal delta in nucleus frame dmax_n = 100. if parse.has_option("main", "dmax_n"): dmax_n = parse.getfloat("main", "dmax_n") print("dmax_n:", dmax_n) #cross section formula self.eqpar = self.eq(self) self.dSigDwDt = TF2("dSigDwDt", self.eqpar, emin_n, self.Ee_n, 0, dmax_n) self.dSigDwDt.SetNpx(2000) self.dSigDwDt.SetNpy(2000) gRandom.SetSeed(5572323) #total integrated cross section over all delta (to 1e5) dSigInt = TF2("dSigInt", self.eqpar, emin_n, self.Ee_n, 0, 1e5) sigma_tot = dSigInt.Integral(emin_n, self.Ee_n, 0, 1e5) print("Total cross section, mb:", sigma_tot) #uniform generator for azimuthal angles self.rand = TRandom3() self.rand.SetSeed(5572323) #tree output from the generator tlist = ["true_phot_w", "true_phot_delta", "true_phot_theta_n"] tlist += ["true_phot_theta", "true_phot_phi", "true_phot_E"] tlist += ["true_el_theta", "true_el_phi", "true_el_E"] self.tree_out = self.set_tree(tree, tlist) print("Lifshitz_93p16 parametrization initialized")