(node_pos_start,node_pos_stop) = teapot_latt.getNodePositionsDict()[node] if(node_pos_start > pos_start and node_pos_stop < pos_stop): 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
(node_pos_start,node_pos_stop) = teapot_latt.getNodePositionsDict()[node] if(node_pos_start > pos_start and node_pos_stop < pos_stop): print "node=",node.getName()," type=",node.getType()," pos=",node_pos_start," L=",node.getLength() length = 0.5 ma = 9 density_fac = 1.0 shape = 1 a = 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
foil = TeapotFoilNode(xmin, xmax, ymin, ymax, thick, "Foil 1") scatterchoice = 0 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
(node_pos_start, node_pos_stop) = teapot_latt.getNodePositionsDict()[node] if (node_pos_start > pos_start and node_pos_stop < pos_stop): 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