Beispiel #1
0
	def update_dipoles_g_split_RHS_recoil(self,pC,cC,nV1,nV2,nV3):
		"""A function to update the relevant dipoles when a gluon is split with the RHS recoiling."""
		assert ((counters.check_is_counter(pC)) and (counters.check_is_counter(cC)))
		for nV in [nV1,nV2,nV3]:
			assert fourVectors.check_is_fourVector(nV)
		assert (self.__maxPperpSquared > self.__cutOff)
		__p1B = self.__chainList[self.__nextIndex][0].copy()
		__p1BMs, __p1BCs = [__p1B.get_mother(0),__p1B.get_mother(1)], [__p1B.get_child(0),__p1B.get_child(1)]
		__qCode = quarkPairs.get_quark_code(self.__maxPperpSquared,self.__activeQCodes) ##As maxPperpSquared now set to S123 of splitting.
		producedQuarkCodes.store(__qCode)
		__p1C0B, __p1C1B = __p1B.get_colour(0), __p1B.get_colour(1)
		__p1 = particles.particle(-__qCode,__p1B.get_four_momentum(),__p1BMs,__p1BCs,[0,0],__p1B.get_status_code())
		__p2 = particles.particle(__qCode,nV2,[0,0],[0,0],[0,0],1)
		__p3 = self.__chainList[self.__nextIndex][1].copy()
		__p1.set_four_momentum(nV1)
		__p3.set_four_momentum(nV3)
		__p1.set_unique_ID(pC.next()) ##Set unique particle IDs when produced.
		__p2.set_unique_ID(pC.next())
		__p1.set_produced_at(self.__maxPperpSquared) ##As now set to that of this produced particle.
		__p2.set_produced_at(self.__maxPperpSquared)
		__p1.set_mother(0,__p3.get_unique_ID())
		__p2.set_mother(1,__p3.get_unique_ID())
		if __p3.get_child(0) != 0: ##i.e don't overwrite.
			__p3.set_child(0,__p2.get_unique_ID())
		__p1, __p2, __p3 = self.set_new_colours_g_split(cC,__p1,__p2,__p3, __p1C0B, __p1C1B,"RHS")
		__nDPLHS = self.__chainList[self.__nextIndex].copy()
		__nDPRHS = self.__chainList[self.__nextIndex].copy()
		__nDPLHS[0], __nDPLHS[1] = __p1.copy(), __p2.copy()
		__nDPRHS[0], __nDPRHS[1] = __p2.copy(), __p3.copy()
		self.update_dipole_values(__p1.copy(),__nDPLHS,__nDPRHS,__p3.copy())
		self.__sideOfSplit = "RHS"
Beispiel #2
0
	def evolve(self,activeQCodes,pC,cC):
		"""A function to evolve a chain through the next event if one is possible."""
		assert ((counters.check_is_counter(pC)) and (counters.check_is_counter(cC)))
		for __dipole in self.__chainList:
			assert __dipole.is_updated()
		assert (type(activeQCodes) == list)
		for qCode in activeQCodes:
			assert qCode in particleData.knownParticles.get_known_quarks()
		self.__activeQCodes = activeQCodes
		##If self.__maxPperpSquared > self.__cutOff, should get not self.__proceed.
		self.run_sudakovs() ##Get values and process for each dipole.
		self.__proceed = self.process_sudakovs() ##Work out what's happening next.
		if (not self.__proceed):
			self.set_showering_completed()
			return [0,None]
		else:
			self.prepare_dipoles()
			__nV1, __nV2, __nV3 = self.run_kinematics()
			if (self.__nextProcessCode == 1): ##Gluon emission.
				self.update_dipoles_g_prod(pC,cC,__nV1, __nV2, __nV3)
				return [1,None]
			elif (self.__nextProcessCode == 2): ##Gluon splitting.
				#Currently doesn't account for loops
				self.update_dipoles_g_split(pC,cC,__nV1, __nV2, __nV3)
				if (self.__sideOfSplit == "LHS"): ##i.e RHS is gluon splitting.
					__splitBeforeIndex = self.__nextIndex + 1
				elif (self.__sideOfSplit == "RHS"): ##i.e LHS is gluon splitting.
					__splitBeforeIndex = self.__nextIndex
				return [2,[__splitBeforeIndex,self.__nextPperpSquared]]
			elif (self.__nextProcessCode == 3): ##Photon emission.
				self.update_dipoles_p_prod(pC,__nV1,__nV2,__nV3)
				return [3,self.__producedPhoton]
Beispiel #3
0
	def update_dipoles_g_prod_RHS_recoil(self,pC,cC,nV1,nV2,nV3):
		"""A function to update the relevant dipoles when a gluon is produced with the RHS recoiling."""
		assert ((counters.check_is_counter(pC)) and (counters.check_is_counter(cC)))
		for nV in [nV1,nV2,nV3]:
			assert fourVectors.check_is_fourVector(nV)
		assert (self.__maxPperpSquared > self.__cutOff)
		__p1 = self.__chainList[self.__nextIndex][0].copy()
		__p2 = particles.particle('gluon',nV2,[0,0],[0,0],[0,0],1)
		__p3 = self.__chainList[self.__nextIndex][1].copy()
		__p1.set_four_momentum(nV1)
		__p3.set_four_momentum(nV3)
		__p2.set_unique_ID(pC.next()) ##Set unique particle ID when produced.
		__p2.set_produced_at(self.__maxPperpSquared) ##As now set to that of this produced particle.
		__p2.set_mother(0,__p1.get_unique_ID())
		__p2.set_mother(1,__p3.get_unique_ID())
		if __p1.get_child(1) != 0: ##i.e don't overwrite
			__p1.set_child(1,__p2.get_unique_ID())
		if __p3.get_child(0) != 0: ##i.e don't overwrite
			__p3.set_child(0,__p2.get_unique_ID())
		__p1, __p2, __p3 = self.set_new_colours_g_prod(cC,__p1,__p2,__p3)
		__nDPLHS = self.__chainList[self.__nextIndex].copy()
		__nDPRHS = self.__chainList[self.__nextIndex].copy()
		__nDPLHS[0], __nDPLHS[1] = __p1.copy(), __p2.copy()
		__nDPRHS[0], __nDPRHS[1] = __p2.copy(), __p3.copy()
		self.update_dipole_values(__p1.copy(),__nDPLHS,__nDPRHS,__p3.copy())
Beispiel #4
0
	def update_dipoles_g_split(self,pC,cC,nV1,nV2,nV3):
		"""A function to update the relevant dipoles when a gluon is split."""
		assert ((counters.check_is_counter(pC)) and (counters.check_is_counter(cC)))
		for nV in [nV1,nV2,nV3]:
			assert fourVectors.check_is_fourVector(nV)
		assert (self.__maxPperpSquared > self.__cutOff)
		if (self.__dipoleRecoilIndex == 0): ##LHS recoiling.
			self.update_dipoles_g_split_LHS_recoil(pC,cC,nV1,nV2,nV3)
		else: ##RHS recoiling.
			self.update_dipoles_g_split_RHS_recoil(pC,cC,nV1,nV2,nV3)
Beispiel #5
0
	def set_new_colours_g_split(self,cC,p1,p2,p3,p1C0B,p1C1B,hS):
		"""A function to set the new colours of the produced particles."""
		assert counters.check_is_counter(cC)
		for p in [p1,p2,p3]:
			assert particles.check_is_particle(p)
			assert p.__nonzero__()
		assert ((type(p1C0B) == int) and (type(p1C1B) == int))
		assert ((hS == "LHS") or (hS == "RHS"))
		__kQs = particleData.knownParticles.get_known_quarks()
		__gC = particleData.knownParticles.get_code_from_name('gluon')
		if (hS == "LHS"):
			if (p1.get_code() > 0): ##Q
				p1.set_colour(0,p1C0B)
				p2.set_colour(1,p1C1B)
			else: ##QBar
				p1.set_colour(0,p1C0B)
				p2.set_colour(1,p1C1B)
		elif (hS == "RHS"):
			if (p1.get_code() > 0): ##Q
				p1.set_colour(1,p1C0B)
				p2.set_colour(0,p1C1B)
			else: ##QBar
				p1.set_colour(1,p1C1B)
				p2.set_colour(0,p1C0B)
		return p1, p2, p3
Beispiel #6
0
	def update_dipoles_p_prod(self,pC,nV1,nV2,nV3):
		"""A function to update the relevant dipoles when a photon is emitted."""
		assert counters.check_is_counter(pC)
		for nV in [nV1,nV2,nV3]:
			assert fourVectors.check_is_fourVector(nV)
		assert (self.__maxPperpSquared > self.__cutOff)
		if (self.__dipoleRecoilIndex == 0): ##LHS recoiling.
			self.update_dipoles_p_prod_LHS_recoil(pC,nV1,nV2,nV3)
		else: ##RHS recoiling.
			self.update_dipoles_p_prod_RHS_recoil(pC,nV1,nV2,nV3)
Beispiel #7
0
	def set_new_colours_g_prod(self,cC,p1,p2,p3):
		"""A function to set the new colours of the produced particles."""
		assert counters.check_is_counter(cC)
		for p in [p1,p2,p3]:
			assert particles.check_is_particle(p)
			assert p.__nonzero__()
		__kQs = particleData.knownParticles.get_known_quarks()
		__gC = particleData.knownParticles.get_code_from_name('gluon')
		if ((p1.get_code() in __kQs) and ((-p3.get_code()) in __kQs)): ##qqBar.
			__nC = cC.next()
			p2.set_colour(0,__nC)
			p2.set_colour(1,p1.get_colour(0))
			p3.set_colour(1,__nC)
		elif (((-p1.get_code()) in __kQs) and (p3.get_code() in __kQs)): ##qBarq.
			__nC = cC.next()
			p1.set_colour(1,__nC)
			p2.set_colour(0,__nC)
			p2.set_colour(1,p3.get_colour(0))
		elif ((p1.get_code() in __kQs) and (p3.get_code() == __gC)): ##qg.
			__nC = cC.next()
			p2.set_colour(0,__nC)
			p2.set_colour(1,p1.get_colour(0))
			p3.set_colour(1,__nC)
		elif (((-p1.get_code()) in __kQs) and (p3.get_code() == __gC)): ##qBarg.
			__nC = cC.next()
			p2.set_colour(0,p1.get_colour(1))
			p2.set_colour(1,__nC)
			p3.set_colour(0,__nC)
		elif ((p1.get_code() == __gC) and (p3.get_code() in __kQs)): ##gq.
			__nC = cC.next()
			p1.set_colour(1,__nC)
			p2.set_colour(0,__nC)
			p2.set_colour(1,p3.get_colour(0))
		elif ((p1.get_code() == __gC) and ((-p3.get_code()) in __kQs)): ##gqBar.
			__nC = cC.next()
			p1.set_colour(0,__nC)
			p2.set_colour(0,p3.get_colour(1))
			p2.set_colour(1,__nC)
		elif ((p1.get_code() == __gC) and (p3.get_code() == __gC)): ##gg.
			##Two possibilities so randomly choose which keeps colour code.
			__R = random.random()
			if (self.__dipoleRecoilIndex == 0): ##qBar at p3 end, i.e LHS.
				if (__R < 0.5): ##Choose option A.
					__nC = cC.next()
					p1.set_colour(1,__nC)
					p2.set_colour(0,__nC)
					p2.set_colour(1,p3.get_colour(0))
				else: ##Choose option B.
					__nC = cC.next()
					p2.set_colour(0,p1.get_colour(1))
					p2.set_colour(1,__nC)
					p3.set_colour(0,__nC)
			else: ##q at p3 end, i.e RHS.
				if (__R < 0.5): ##Choose option A.
					__nC = cC.next()
					p2.set_colour(0,__nC)
					p2.set_colour(1,p1.get_colour(0))
					p3.set_colour(1,__nC)
				else: ##Choose option B.
					__nC = cC.next()
					p1.set_colour(0,__nC)
					p2.set_colour(0,p3.get_colour(1))
					p2.set_colour(1,__nC)
		return p1, p2, p3