示例#1
0
mad.globals.on_disp = 0.
# will be restored later

###################################
# Compute beam-beam configuration #
###################################

# Prepare bb dataframes
if enable_bb_python:
    bb_dfs = pm.generate_bb_dataframes(
        mad,
        ip_names=['ip1', 'ip2', 'ip5', 'ip8'],
        harmonic_number=35640,
        numberOfLRPerIRSide=configuration['numberOfLRPerIRSide'],
        bunch_spacing_buckets=configuration['bunch_spacing_buckets'],
        numberOfHOSlices=configuration['numberOfHOSlices'],
        bunch_population_ppb=configuration['bunch_population_ppb'],
        sigmaz_m=configuration['sigmaz_m'],
        z_crab_twiss=configuration['z_crab_twiss'] * float(enable_crabs),
        remove_dummy_lenses=True)

    if configuration['only_lr']:
        bb_dfs['b1'] = bb_dfs['b1'][bb_dfs['b1']['label'] == 'bb_lr']
        bb_dfs['b2'] = bb_dfs['b2'][bb_dfs['b2']['label'] == 'bb_lr']

    if configuration['only_ho']:
        bb_dfs['b1'] = bb_dfs['b1'][bb_dfs['b1']['label'] == 'bb_ho']
        bb_dfs['b2'] = bb_dfs['b2'][bb_dfs['b2']['label'] == 'bb_ho']
    # Here the datafremes can be edited, e.g. to set bbb intensity
示例#2
0
# # Call leveling module
# if mode=='b4_without_bb':
#     print('Leveling not working in this mode!')
# else:
#     mad.call("modules/module_02_lumilevel.madx")

mad.input('on_disp = 0')

# Prepare bb dataframes
if enable_bb_python:
    bb_dfs = pm.generate_bb_dataframes(mad,
                                       ip_names=['ip1', 'ip2', 'ip5', 'ip8'],
                                       harmonic_number=35640,
                                       numberOfLRPerIRSide=[25, 20, 25, 20],
                                       bunch_spacing_buckets=10,
                                       numberOfHOSlices=11,
                                       bunch_population_ppb=None,
                                       sigmaz_m=None,
                                       z_crab_twiss=0,
                                       remove_dummy_lenses=True)

    # Here the datafremes can be edited, e.g. to set bbb intensity

# Generate mad instance for b4
if generate_b4_from_b2:
    mad_b4 = Madx()
    ost.build_sequence(mad_b4, beam=4)
    ost.apply_optics(mad_b4, optics_file=optics_file)

    pm.configure_b4_from_b2(mad_b4, mad)