def pbremProdRate(mass,epsilon,doprint=False): xswg = proton_bremsstrahlung.prodRate(mass, epsilon) if doprint: print "A' production rate per p.o.t: \t %.8g"%(xswg) rhoff = proton_bremsstrahlung.rhoFormFactor(mass)**2 if doprint: print "A' rho form factor: \t %.8g"%rhoff if doprint: print "A' rescaled production rate per p.o.t:\t %.8g"%(xswg*rhoff) return xswg*rhoff
def pbremProdRateNoFF(mass,epsilon,doprint=False): xswg = proton_bremsstrahlung.prodRate(mass, epsilon) if doprint: print "A' production rate per p.o.t: \t %.8g"%(xswg) penalty = proton_bremsstrahlung.penaltyFactor(mass) if doprint: print "A' penalty factor: \t %.8g"%penalty if doprint: print "A' rescaled production rate per p.o.t:\t %.8g"%(xswg*penalty) return xswg*penalty
def pbremProdRate(mass,epsilon,doprint=False): xswg = proton_bremsstrahlung.prodRate(mass, epsilon) if doprint: print "A' production rate per p.o.t: \t %.8g"%(xswg) penalty = proton_bremsstrahlung.penaltyFactor(mass) if doprint: print "A' penalty factor: \t %.8g"%penalty if doprint: print "A' rescaled production rate per p.o.t:\t %.8g"%(xswg*penalty) return xswg*penalty
def configure(P8gen, mass, epsilon, inclusive, deepCopy=False): # configure pythia8 for Ship usage debug=True if debug: cf=open('pythia8_darkphotonconf.txt','w') #h=readFromAscii() P8gen.UseRandom3() # TRandom1 or TRandom3 ? P8gen.SetMom(400) # beam momentum in GeV if deepCopy: P8gen.UseDeepCopy() pdg = ROOT.TDatabasePDG.Instance() if inclusive=="meson": # let strange particle decay in Geant4 p8 = P8gen.getPythiaInstance() n=1 while n!=0: n = p8.particleData.nextId(n) p = p8.particleData.particleDataEntryPtr(n) if p.tau0()>1: command = str(n)+":mayDecay = false" p8.readString(command) print "Pythia8 configuration: Made %s stable for Pythia, should decay in Geant4"%(p.name()) # Configuring production P8gen.SetParameters("SoftQCD:nonDiffractive = on") if debug: cf.write('P8gen.SetParameters("SoftQCD:nonDiffractive = on")\n') elif inclusive=="qcd": P8gen.SetDY() P8gen.SetMinDPMass(0.7) if (mass<P8gen.MinDPMass()): print "WARNING! Mass is too small, minimum is set to %3.3f GeV."%P8gen.MinDPMass() return 0 # produce a Z' from hidden valleys model p8 = P8gen.getPythiaInstance() n=1 while n!=0: n = p8.particleData.nextId(n) p = p8.particleData.particleDataEntryPtr(n) if p.tau0()>1: command = str(n)+":mayDecay = false" p8.readString(command) print "Pythia8 configuration: Made %s stable for Pythia, should decay in Geant4"%(p.name()) # Configuring production P8gen.SetParameters("HiddenValley:ffbar2Zv = on") if debug: cf.write('P8gen.SetParameters("HiddenValley:ffbar2Zv = on")\n') P8gen.SetParameters("HiddenValley:Ngauge = 1") elif inclusive=="pbrem": P8gen.SetParameters("ProcessLevel:all = off") if debug: cf.write('P8gen.SetParameters("ProcessLevel:all = off")\n') #Also allow resonance decays, with showers in them #P8gen.SetParameters("Standalone:allowResDec = on") #Optionally switch off decays. #P8gen.SetParameters("HadronLevel:Decay = off") #Switch off automatic event listing in favour of manual. P8gen.SetParameters("Next:numberShowInfo = 0") P8gen.SetParameters("Next:numberShowProcess = 0") P8gen.SetParameters("Next:numberShowEvent = 0") proton_bremsstrahlung.protonEnergy=P8gen.GetMom() norm=proton_bremsstrahlung.prodRate(mass, epsilon) print "A' production rate per p.o.t: \t %.8g"%norm P8gen.SetPbrem(proton_bremsstrahlung.hProdPDF(mass, epsilon, norm, 350, 1500)) #Define dark photon DP_instance = darkphoton.DarkPhoton(mass,epsilon) ctau = DP_instance.cTau() print 'ctau p8dpconf file =%3.6f cm'%ctau print 'Initial particle parameters for PDGID %d :'%P8gen.GetDPId() P8gen.List(P8gen.GetDPId()) if inclusive=="qcd": P8gen.SetParameters(str(P8gen.GetDPId())+":m0 = "+str(mass)) #P8gen.SetParameters(str(P8gen.GetDPId())+":mWidth = "+str(u.mm/ctau)) P8gen.SetParameters(str(P8gen.GetDPId())+":mWidth = "+str(u.hbarc/ctau)) P8gen.SetParameters(str(P8gen.GetDPId())+":mMin = 0.001") P8gen.SetParameters(str(P8gen.GetDPId())+":tau0 = "+str(ctau/u.mm)) #P8gen.SetParameters("ParticleData:modeBreitWigner = 0") #P8gen.SetParameters(str(P8gen.GetDPId())+":isResonance = false") #P8gen.SetParameters(str(P8gen.GetDPId())+":all = A A 3 0 0 "+str(mass)+" 0.0 0.0 0.0 "+str(ctau/u.mm)+" 0 1 0 1 0") #if debug: cf.write('P8gen.SetParameters("'+str(P8gen.GetDPId())+':all = A A 3 0 0 '+str(mass)+' 0.0 0.0 0.0 '+str(ctau/u.mm)+' 0 1 0 1 0") \n') P8gen.SetParameters(str(P8gen.GetDPId())+":onMode = off") #print 'qcd inclusive test' else: P8gen.SetParameters(str(P8gen.GetDPId())+":new = A A 3 0 0 "+str(mass)+" 0.0 0.0 0.0 "+str(ctau/u.mm)+" 0 1 0 1 0") if debug: cf.write('P8gen.SetParameters("'+str(P8gen.GetDPId())+':new = A A 3 0 0 '+str(mass)+' 0.0 0.0 0.0 '+str(ctau/u.mm)+' 0 1 0 1 0") \n') #if (inclusive=="pbrem"): ### Do not set as resonance: decays to hadron doesn't work properly below 0.7 GeV. # P8gen.SetParameters(str(P8gen.GetDPId())+":isResonance = true") # P8gen.SetParameters(str(P8gen.GetDPId())+":mWidth = "+str(u.hbarc/ctau)) # P8gen.SetParameters(str(P8gen.GetDPId())+":mMin = 0.001") P8gen.SetParameters("Next:numberCount = 0") if debug: cf.write('P8gen.SetParameters("Next:numberCount = 0")\n') # Configuring decay modes... readDecayTable.addDarkPhotondecayChannels(P8gen,DP_instance, conffile=os.path.expandvars('$FAIRSHIP/python/darkphotonDecaySelection.conf'), verbose=True) # Finish HNL setup... P8gen.SetParameters(str(P8gen.GetDPId())+":mayDecay = on") if debug: cf.write('P8gen.SetParameters("'+str(P8gen.GetDPId())+':mayDecay = on")\n') #P8gen.SetDPId(P8gen.GetDPId()) #if debug: cf.write('P8gen.SetDPId(%d)\n',%P8gen.GetDPId()) # also add to PDG gamma = u.hbarc / float(ctau) #197.3269631e-16 / float(ctau) # hbar*c = 197 MeV*fm = 197e-16 GeV*cm print 'gamma=%e'%gamma addDPtoROOT(pid=P8gen.GetDPId(),m=mass,g=gamma) if inclusive=="meson": #change meson decay to dark photon depending on mass selectedMum = manipulatePhysics(mass, P8gen, cf) print 'selected mum is : %d'%selectedMum if (selectedMum == -1): return 0 #P8gen.SetParameters("Check:particleData = on") if debug: cf.close() return 1
def configure(P8gen, mass, epsilon, inclusive, deepCopy=False): # configure pythia8 for Ship usage debug = True if debug: cf = open('pythia8_darkphotonconf.txt', 'w') #h=readFromAscii() P8gen.UseRandom3() # TRandom1 or TRandom3 ? P8gen.SetMom(400) # beam momentum in GeV if deepCopy: P8gen.UseDeepCopy() pdg = ROOT.TDatabasePDG.Instance() if inclusive == "meson": # let strange particle decay in Geant4 p8 = P8gen.getPythiaInstance() n = 1 while n != 0: n = p8.particleData.nextId(n) p = p8.particleData.particleDataEntryPtr(n) if p.tau0() > 1: command = str(n) + ":mayDecay = false" p8.readString(command) print "Pythia8 configuration: Made %s stable for Pythia, should decay in Geant4" % ( p.name()) # Configuring production P8gen.SetParameters("SoftQCD:nonDiffractive = on") if debug: cf.write('P8gen.SetParameters("SoftQCD:nonDiffractive = on")\n') elif inclusive == "qcd": P8gen.SetDY() P8gen.SetMinDPMass(0.7) if (mass < P8gen.MinDPMass()): print "WARNING! Mass is too small, minimum is set to %3.3f GeV." % P8gen.MinDPMass( ) return 0 # produce a Z' from hidden valleys model p8 = P8gen.getPythiaInstance() n = 1 while n != 0: n = p8.particleData.nextId(n) p = p8.particleData.particleDataEntryPtr(n) if p.tau0() > 1: command = str(n) + ":mayDecay = false" p8.readString(command) print "Pythia8 configuration: Made %s stable for Pythia, should decay in Geant4" % ( p.name()) # Configuring production P8gen.SetParameters("HiddenValley:ffbar2Zv = on") if debug: cf.write('P8gen.SetParameters("HiddenValley:ffbar2Zv = on")\n') P8gen.SetParameters("HiddenValley:Ngauge = 1") elif inclusive == "pbrem": P8gen.SetParameters("ProcessLevel:all = off") if debug: cf.write('P8gen.SetParameters("ProcessLevel:all = off")\n') #Also allow resonance decays, with showers in them #P8gen.SetParameters("Standalone:allowResDec = on") #Optionally switch off decays. #P8gen.SetParameters("HadronLevel:Decay = off") #Switch off automatic event listing in favour of manual. P8gen.SetParameters("Next:numberShowInfo = 0") P8gen.SetParameters("Next:numberShowProcess = 0") P8gen.SetParameters("Next:numberShowEvent = 0") proton_bremsstrahlung.protonEnergy = P8gen.GetMom() norm = proton_bremsstrahlung.prodRate(mass, epsilon) print "A' production rate per p.o.t: \t %.8g" % norm P8gen.SetPbrem( proton_bremsstrahlung.hProdPDF(mass, epsilon, norm, 350, 1500)) #Define dark photon DP_instance = darkphoton.DarkPhoton(mass, epsilon) ctau = DP_instance.cTau() print 'ctau p8dpconf file =%3.6f cm' % ctau print 'Initial particle parameters for PDGID %d :' % P8gen.GetDPId() P8gen.List(P8gen.GetDPId()) if inclusive == "qcd": P8gen.SetParameters(str(P8gen.GetDPId()) + ":m0 = " + str(mass)) #P8gen.SetParameters(str(P8gen.GetDPId())+":mWidth = "+str(u.mm/ctau)) P8gen.SetParameters( str(P8gen.GetDPId()) + ":mWidth = " + str(u.hbarc / ctau)) P8gen.SetParameters(str(P8gen.GetDPId()) + ":mMin = 0.001") P8gen.SetParameters( str(P8gen.GetDPId()) + ":tau0 = " + str(ctau / u.mm)) #P8gen.SetParameters("ParticleData:modeBreitWigner = 0") #P8gen.SetParameters(str(P8gen.GetDPId())+":isResonance = false") #P8gen.SetParameters(str(P8gen.GetDPId())+":all = A A 3 0 0 "+str(mass)+" 0.0 0.0 0.0 "+str(ctau/u.mm)+" 0 1 0 1 0") #if debug: cf.write('P8gen.SetParameters("'+str(P8gen.GetDPId())+':all = A A 3 0 0 '+str(mass)+' 0.0 0.0 0.0 '+str(ctau/u.mm)+' 0 1 0 1 0") \n') P8gen.SetParameters(str(P8gen.GetDPId()) + ":onMode = off") #print 'qcd inclusive test' else: P8gen.SetParameters( str(P8gen.GetDPId()) + ":new = A A 3 0 0 " + str(mass) + " 0.0 0.0 0.0 " + str(ctau / u.mm) + " 0 1 0 1 0") if debug: cf.write('P8gen.SetParameters("' + str(P8gen.GetDPId()) + ':new = A A 3 0 0 ' + str(mass) + ' 0.0 0.0 0.0 ' + str(ctau / u.mm) + ' 0 1 0 1 0") \n') #if (inclusive=="pbrem"): ### Do not set as resonance: decays to hadron doesn't work properly below 0.7 GeV. # P8gen.SetParameters(str(P8gen.GetDPId())+":isResonance = true") # P8gen.SetParameters(str(P8gen.GetDPId())+":mWidth = "+str(u.hbarc/ctau)) # P8gen.SetParameters(str(P8gen.GetDPId())+":mMin = 0.001") P8gen.SetParameters("Next:numberCount = 0") if debug: cf.write('P8gen.SetParameters("Next:numberCount = 0")\n') # Configuring decay modes... readDecayTable.addDarkPhotondecayChannels( P8gen, DP_instance, conffile=os.path.expandvars( '$FAIRSHIP/python/darkphotonDecaySelection.conf'), verbose=True) # Finish HNL setup... P8gen.SetParameters(str(P8gen.GetDPId()) + ":mayDecay = on") if debug: cf.write('P8gen.SetParameters("' + str(P8gen.GetDPId()) + ':mayDecay = on")\n') #P8gen.SetDPId(P8gen.GetDPId()) #if debug: cf.write('P8gen.SetDPId(%d)\n',%P8gen.GetDPId()) # also add to PDG gamma = u.hbarc / float( ctau ) #197.3269631e-16 / float(ctau) # hbar*c = 197 MeV*fm = 197e-16 GeV*cm print 'gamma=%e' % gamma addDPtoROOT(pid=P8gen.GetDPId(), m=mass, g=gamma) if inclusive == "meson": #change meson decay to dark photon depending on mass selectedMum = manipulatePhysics(mass, P8gen, cf) print 'selected mum is : %d' % selectedMum if (selectedMum == -1): return 0 #P8gen.SetParameters("Check:particleData = on") if debug: cf.close() return 1
';m_{#gamma^{D}} (GeV); #sigma_{meson}/#varepsilon^2 (mb)', 1000, 0., 10.) h['xsMeson'].Sumw2() ut.bookHist(h, 'xsQCD', ';m_{#gamma^{D}} (GeV); #sigma_{qcd}/#varepsilon^2 (mb)', 1000, 0., 10.) h['xsMeson'].Sumw2() print proton_bremsstrahlung.rhoFormFactor( 0), proton_bremsstrahlung.rhoFormFactor( 0.77), proton_bremsstrahlung.rhoFormFactor(2.) for step in range(0, 1000): mass = step * 0.0100000 xswg = proton_bremsstrahlung.prodRate(400, mass, epsilon) * 10.7 penalty = proton_bremsstrahlung.penaltyFactor(mass) rhoff = proton_bremsstrahlung.rhoFormFactor(mass) #if (rhoff<1): rhoff = 1 h['xsPbrem'].SetBinContent(step + 1, xswg * penalty / (epsilon**2)) h['xsPbremNew'].SetBinContent(step + 1, xswg * penalty * rhoff**2 / (epsilon**2)) h['xsPbremFF'].SetBinContent(step + 1, xswg * rhoff**2 / (epsilon**2)) for step in range(0, 900): mass = math.sqrt(step * 0.0100000) rhoff = proton_bremsstrahlung.rhoFormFactor(mass) h['ff'].SetBinContent(step + 1, rhoff)
h['xsPbremFF'].Sumw2() ut.bookHist(h,'xsPbremFix',';m_{#gamma^{D}} (GeV); #sigma_{pbrem}/#varepsilon^2 (mb)',1000,0.,10.) h['xsPbremFix'].Sumw2() ut.bookHist(h,'xsPbremFFFix',';m_{#gamma^{D}} (GeV); #sigma_{pbrem}/#varepsilon^2 (mb)',1000,0.,10.) h['xsPbremFFFix'].Sumw2() ut.bookHist(h,'xsPbremvsp',';p_{p} (GeV); #sigma_{pbrem}/#varepsilon^2 (mb)',401,-0.5,400.5) h['xsPbremvsp'].Sumw2() #print proton_bremsstrahlung.rhoFormFactor(0),proton_bremsstrahlung.rhoFormFactor(0.77),proton_bremsstrahlung.rhoFormFactor(2.) for step in range(0,1000): mass=step*0.0100000 xswg = proton_bremsstrahlung.prodRate(400,mass, epsilon)*10.7 xswgFix = proton_bremsstrahlung.prodRate(400,mass, epsilon,-0.1,0.1,proton_bremsstrahlung.pMinFix(400,mass),proton_bremsstrahlung.pMaxFix(400,mass))*10.7 penalty = proton_bremsstrahlung.penaltyFactor(mass) rhoff = proton_bremsstrahlung.rhoFormFactor(mass) h['xsPbrem'].SetBinContent(step+1,xswg*penalty/(epsilon**2)) h['xsPbremFF'].SetBinContent(step+1,xswg*rhoff**2/(epsilon**2)) h['xsPbremFix'].SetBinContent(step+1,xswgFix*penalty/(epsilon**2)) h['xsPbremFFFix'].SetBinContent(step+1,xswgFix*rhoff**2/(epsilon**2)) #for step in range(1,401): # E=step # proton_bremsstrahlung.protonEnergy=E # pmom=proton_bremsstrahlung.protonMomentum(E);