print "node=",node.getName()," type=",node.getType()," pos=",node_pos_start," L=",node.getLength() length = 0.5 ma = 3 density_fac = 1.0 shape = 1 a = 0.0 b = 0 c = 0 d = 0 angle = 0 collimator = TeapotCollimatorNode(length, ma, density_fac, shape, a, b, c, d, angle, "Collimator 1") addTeapotCollimatorNode(teapot_latt, 18.5, collimator) print "===========Lattice modified =======================================" print "New Lattice=",teapot_latt.getName()," length [m] =",teapot_latt.getLength()," nodes=",len(teapot_latt.getNodes()) n_drifts = 0 drift_length = 0. for node in teapot_latt.getNodes(): if(isinstance(node,DriftTEAPOT)): n_drifts += 1 drift_length += node.getLength() print "number of drifts =",n_drifts print "total drift length =",drift_length print "============= nodes inside the region ===========" # print all nodes around the specified position
length = 0.5 ma = 3 density_fac = 1.0 shape = 1 a = 0.0 b = 0 c = 0 d = 0 angle = 0 pos = 18.5 collimator = TeapotCollimatorNode(length, ma, density_fac, shape, a, b, c, d, angle) #collimator = TeapotCollimatorNode(length, ma, density_fac, shape, a, b, c, d, angle) addTeapotCollimatorNode(teapot_latt, pos, collimator) print "===========Lattice modified =======================================" print "New Lattice=",teapot_latt.getName()," length [m] =",teapot_latt.getLength()," nodes=",len(teapot_latt.getNodes()) n_drifts = 0 drift_length = 0. for node in teapot_latt.getNodes(): if(isinstance(node,DriftTEAPOT)): n_drifts += 1 drift_length += node.getLength() print "number of drifts =",n_drifts print "total drift length =",drift_length print "============= nodes inside the region ==========="
foil.setScatterChoice(scatterchoice) addTeapotFoilNode(teapot_latt, 0.000001, foil) #---------------------------------------------- # Add one black absorber collimator to act like # an aperture #---------------------------------------------- colllength = 0.00001 ma = 9 density_fac = 1.0 shape = 1 radius = 0.110 collimator = TeapotCollimatorNode(colllength, ma, density_fac, shape, radius, 0., 0., 0., 0., "Collimator 1") addTeapotCollimatorNode(teapot_latt, 0.5, collimator) #----------------------------- # Add RF Node #----------------------------- teapot_latt.initialize() ZtoPhi = 2.0 * math.pi / lattlength dESync = 0.0 RF1HNum = 1.0 RF1Voltage = 0.000016 RF1Phase = 0.0 RF2HNum = 2.0 RF2Voltage = -0.000003 RF2Phase = 0.0 length = 0.0
length = 0.5 ma = 3 density_fac = 1.0 shape = 1 a = 0.0 b = 0 c = 0 d = 0 angle = 0 pos = 18.5 collimator = TeapotCollimatorNode(length, ma, density_fac, shape, a, b, c, d, angle) #collimator = TeapotCollimatorNode(length, ma, density_fac, shape, a, b, c, d, angle) addTeapotCollimatorNode(teapot_latt, pos, collimator) print "===========Lattice modified =======================================" print "New Lattice=", teapot_latt.getName( ), " length [m] =", teapot_latt.getLength(), " nodes=", len( teapot_latt.getNodes()) n_drifts = 0 drift_length = 0. for node in teapot_latt.getNodes(): if (isinstance(node, DriftTEAPOT)): n_drifts += 1 drift_length += node.getLength() print "number of drifts =", n_drifts print "total drift length =", drift_length