lattice = AccLattice("test_lattice")

elem0 = teapot.DriftTEAPOT("drift0")

lattice.addNode(elem0)

#-----------------------------
# Set TEAPOT nodes parameters
#-----------------------------

elem0.setLength(4.0)

lattice.initialize()

#///////////////////////////////////////////////////////////
ZtoPhi = 2.0 * math.pi / lattice.getLength()
dESync = 0.0
RFHNum = 1.0
RFVoltage = 0.1
RFPhase = 0.0
length = 0.0
name = "harmonic_rfnode"
rf_node = RFNode.Harmonic_RFNode(ZtoPhi, dESync, RFHNum, RFVoltage, RFPhase, length, name)
position = 1.0
RFLatticeModifications.addRFNode(lattice, position, rf_node)

print "Lattice length = ", lattice.getLength()
print "ZtoPhi = ", ZtoPhi
print "dESync = ", dESync
print "RFHNum = ", RFHNum
print "RFVoltage = ", RFVoltage
예제 #2
0
    if(paramsDict.has_key("print") and paramsDict["print"] == True):
        print Blanks(nLevel[0]),"EXIT  level=",nLevel[0]," node=",node.getName()
    nLevel[0] -= 1

def funcTrack(paramsDict):
    node = paramsDict["node"]
    if(paramsDict.has_key("print") and paramsDict["print"] == True):
        print Blanks(nLevel[0]),"BODY TRACK through node =",node.getName()," level=",nLevel[0]

acts.addAction(funcEntrance,AccActionsContainer.ENTRANCE)
acts.addAction(funcTrack,AccActionsContainer.BODY)
acts.addAction(funcExit,AccActionsContainer.EXIT)

lattice.initialize()

print "Total length=",lattice.getLength()

nodes = lattice.getNodes()
for node in nodes:
	print "node=",node.getName()," s start,stop = %4.3f %4.3f "%lattice.getNodePositionsDict()[node]


d = {"print":True}

lattice.trackActions(acts,d)

print "Total number of nodes=",nElems[0]
#========Speed test==========================
count = 1
while(True):
    #lattice.initialize()
예제 #3
0
lattice = AccLattice("test_lattice")

elem0 = teapot.DriftTEAPOT("drift0")

lattice.addNode(elem0)

#-----------------------------
# Set TEAPOT nodes parameters
#-----------------------------

elem0.setLength(4.0)

lattice.initialize()

#///////////////////////////////////////////////////////////
ZtoPhi = 2.0 * math.pi / lattice.getLength()
RFVoltage = 0.1
RFPhasep = 150.0
RFPhasem = -150.0
dRFPhasep = 30.0
dRFPhasem = 30.0
length = 0.0
name = "barrier_rfnode"
rf_node = RFNode.Barrier_RFNode(ZtoPhi, RFVoltage,\
     RFPhasep, RFPhasem,\
     dRFPhasep, dRFPhasem,\
     length, name)
position = 1.0
RFLatticeModifications.addRFNode(lattice, position, rf_node)

print "Lattice length = ", lattice.getLength()

def funcTrack(paramsDict):
    node = paramsDict["node"]
    if (paramsDict.has_key("print") and paramsDict["print"] == True):
        print Blanks(nLevel[0]), "BODY TRACK through node =", node.getName(
        ), " level=", nLevel[0]


acts.addAction(funcEntrance, AccActionsContainer.ENTRANCE)
acts.addAction(funcTrack, AccActionsContainer.BODY)
acts.addAction(funcExit, AccActionsContainer.EXIT)

lattice.initialize()

print "Total length=", lattice.getLength()

nodes = lattice.getNodes()
for node in nodes:
    print "node=", node.getName(
    ), " s start,stop = %4.3f %4.3f " % lattice.getNodePositionsDict()[node]

d = {"print": True}

lattice.trackActions(acts, d)

print "Total number of nodes=", nElems[0]
#========Speed test==========================
count = 1
while (count < 100000):
    #lattice.initialize()
예제 #5
0
	node = paramsDict["node"]
	node.track(paramsDict)


accContainer = AccActionsContainer()
accContainer.addAction(bodyAction,AccActionsContainer.BODY)

paramsDict = {}
paramsDict["bunch"] = b

lattice.trackActions(accContainer,paramsDict)
print "=============AFTER============================="
b.dumpBunch()
print "=========================================="

print "lattice length=",lattice.getLength()
print "beta=",b.getSyncParticle().beta()
print "TEAPOT time[sec]=",b.getSyncParticle().time()
print "SIMPLE time[sec]=",lattice.getLength()/(b.getSyncParticle().beta()*2.99792458e+8)
print "Stop."

#==============BEFORE============================
#==========================================
#=============AFTER=============================
#% PARTICLE_ATTRIBUTES_CONTROLLERS_NAMES
#% BUNCH_ATTRIBUTE_DOUBLE charge   1
#% BUNCH_ATTRIBUTE_DOUBLE classical_radius   1.5347e-18
#% BUNCH_ATTRIBUTE_DOUBLE macro_size   0
#% BUNCH_ATTRIBUTE_DOUBLE mass   0.938272
#%  SYNC_PART_COORDS 0 0 0  x, y, z positions in [m]
#%  SYNC_PART_MOMENTUM 0 0 1.696037912  px, py, pz momentum component in GeV/c