b.dumpBunch() print "==========================================" #=====track action ============ def bodyAction(paramsDict): 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
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() lattice.trackActions(acts) if (count % 10000 == 0): print "i=", count, " time= %9.8f " % (posix.times()[0] / count) count += 1 print "====STOP===" sys.exit(1)
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() lattice.trackActions(acts) if( count % 10000 == 0): print "i=",count, " time= %9.8f "%(posix.times()[0]/count) count += 1 print "====STOP===" sys.exit(1)
print "==========================================" #=====track action ============ def bodyAction(paramsDict): 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