def __call__(self, ms, par = None, externalKinematicVariables = []):
		if par is None:
			par = self._parameters
		if not len(par) == self.nPar:
			raise IndexError("rpwaBreitWigner: Wring number of parameters")
		if len(externalKinematicVariables) < 1:
			raise IndexError("No external kinematic variable given")

		M0 = par[0].real
		G0 = par[1].real

		q0 = physUtils.breakupMomentum(M0, self.m1, self.m2)

		if q0 == 0.:
			return [0.]*len(ms)
		retVals = np.zeros((len(ms)), dtype = complex)
		if self.fitPr:
			PrMother = par[2]
			PrIsob = par[3]
		else:
			PrMother = self.Pr
			PrIsob = self.Pr

		for i,M in enumerate(ms):
			q = physUtils.breakupMomentum(M, self.m1, self.m2)
			retVals[i] = physUtils.breitWigner(M,M0,G0, self.J, q, q0, PrIsob)
			if self.fitPr and self.compensatePr:
				compensationFactor = physUtils.barrierFactor(self.J, q, PrIsob)/physUtils.barrierFactor(self.J, q, self.Pr)
				Q = physUtils.breakupMomentum(externalKinematicVariables[0],  M, self.m3)
				if Q == 0.:
					compensationFactor = 0.
				else:
					compensationFactor *= physUtils.barrierFactor(self.L, Q, PrMother)/physUtils.barrierFactor(self.L, Q, self.Pr)
				retVals[i] *= compensationFactor
		return retVals
Exemplo n.º 2
0
 def __call__(self, ms, externalKinematicVariables=[]):
     retVals = self.BW(ms, externalKinematicVariables)
     for i, m in enumerate(ms):
         q = physUtils.breakupMomentum(m, self.m1, self.m2)
         Q = physUtils.breakupMomentum(externalKinematicVariables[0], m,
                                       self.m3)
         BFs = physUtils.barrierFactor(self.L, Q,
                                       self.Pr) * physUtils.barrierFactor(
                                           self.J, q, self.Pr)
         retVals[i] *= BFs
     return retVals
Exemplo n.º 3
0
    def __call__(self, ms, externalKinematicVariables=[]):
        par = [p.value for p in self.parameters]

        if len(externalKinematicVariables) < 1:
            raise IndexError("No external kinematic variable given")

        M0 = par[0].real
        G0 = par[1].real
        rat = abs(par[2].real)**.5  # Scaling ratio of real/imag

        q0 = physUtils.breakupMomentum(M0, self.m1, self.m2)

        if q0 == 0.:
            return np.asarray([0. + 0.j] * len(ms), dtype=complex)
        retVals = np.zeros((len(ms)), dtype=complex)
        if self.fitPr:
            PrMother = par[3]
            PrIsob = par[4]
        else:
            PrMother = self.Pr
            PrIsob = self.Pr

        for i, M in enumerate(ms):
            q = physUtils.breakupMomentum(M, self.m1, self.m2)
            retVals[i] = physUtils.breitWigner(M, M0, G0, self.J, q, q0,
                                               PrIsob)
            if self.fitPr and self.compensatePr:
                compensationFactor = physUtils.barrierFactor(
                    self.J, q, PrIsob) / physUtils.barrierFactor(
                        self.J, q, self.Pr)
                Q = physUtils.breakupMomentum(externalKinematicVariables[0], M,
                                              self.m3)
                if Q == 0.:
                    compensationFactor = 0.
                else:
                    compensationFactor *= physUtils.barrierFactor(
                        self.L, Q, PrMother) / physUtils.barrierFactor(
                            self.L, Q, self.Pr)
                retVals[i] *= compensationFactor
            retVals[i] = retVals[i].real * rat + 1.j * retVals[i].imag / rat
        return retVals
Exemplo n.º 4
0
    def __call__(self, ms, externalKinematicVariables=[]):
        par = [p.value for p in self.parameters]

        if len(externalKinematicVariables) < 1:
            raise IndexError("No external kinematic variable given")

        M0 = par[0].real
        g1 = par[1].real
        g2 = par[2].real

        q0 = physUtils.breakupMomentum(M0, self.m1, self.m2)

        if q0 == 0.:
            return np.asarray([0. + 0.j] * len(ms), dtype=complex)
        retVals = np.zeros((len(ms)), dtype=complex)
        if self.fitPr:
            PrMother = par[3]
            PrIsob = par[4]
        else:
            PrMother = self.Pr
            PrIsob = self.Pr

        for i, M in enumerate(ms):
            q = physUtils.breakupMomentum(M, self.m1, self.m2)
            retVals[i] = physUtils.flatte(M, M0, g1, g2, self.m1, self.m2,
                                          self.m2nd1, self.m2nd2)
            if self.fitPr and self.compensatePr:
                compensationFactor = physUtils.barrierFactor(
                    self.J, q, PrIsob) / physUtils.barrierFactor(
                        self.J, q, self.Pr)
                Q = physUtils.breakupMomentum(externalKinematicVariables[0], M,
                                              self.m3)
                if Q == 0.:
                    compensationFactor = 0.
                else:
                    compensationFactor *= physUtils.barrierFactor(
                        self.L, Q, PrMother) / physUtils.barrierFactor(
                            self.L, Q, self.Pr)
                retVals[i] *= compensationFactor
        return retVals
Exemplo n.º 5
0
    def __call__(self, ms, externalKinematicVariables=[]):
        par = [p.value for p in self.parameters]

        if len(externalKinematicVariables) < 1:
            raise IndexError("No external kinematic variable given")

        M0 = par[0].real
        G0 = par[1].real

        q0 = physUtils.breakupMomentum(M0, self.m1, self.m2)

        if q0 == 0.:
            return np.asarray([0. + 0.j] * len(ms), dtype=complex)
        retVals = np.zeros((len(ms)), dtype=complex)
        if self.fitPr:
            PrMother = par[2]
            PrIsob = par[3]
        else:
            PrMother = self.Pr
            PrIsob = self.Pr

        for i, Mcntr in enumerate(ms):
            found = False
            for i in range(len(self.binning) - 1):
                if self.binning[i] < Mcntr and self.binning[i + 1] >= Mcntr:
                    mMin = self.binning[i]
                    mMax = self.binning[i + 1]
                    found = True
                    break
            if not found:
                raise ValueError("Mass " + str(Mcntr) + " invalid")
            retVal = 0.
            weight = 0.
            step = (mMax - mMin) / self.nPoints
            for b in range(self.nPoints):
                M = mMin + (b + 0.5) * step
                q = physUtils.breakupMomentum(M, self.m1, self.m2)
                ampl = physUtils.breitWigner(M, M0, G0, self.J, q, q0, PrIsob)
                if self.fitPr and self.compensatePr:
                    compensationFactor = physUtils.barrierFactor(
                        self.J, q, PrIsob) / physUtils.barrierFactor(
                            self.J, q, self.Pr)
                    Q = physUtils.breakupMomentum(
                        externalKinematicVariables[0], M, self.m3)
                    if Q == 0.:
                        compensationFactor = 0.
                    else:
                        compensationFactor *= physUtils.barrierFactor(
                            self.L, Q, PrMother) / physUtils.barrierFactor(
                                self.L, Q, self.Pr)
                    ampl *= compensationFactor
                ww = 1.
                if self.intensWeight:
                    ww *= abs(ampl)**2
                if self.rwibw:
                    Q = physUtils.breakupMomentum(
                        externalKinematicVariables[0], M, self.m3)
                    fakk = physUtils.barrierFactor(
                        self.J, q, PrIsob) * physUtils.barrierFactor(
                            self.L, Q, PrMother)
                    ww *= fakk
                retVal += ww * ampl
                weight += ww
            retVals[i] = retVal / weight
        return retVals