Skip to content

Repository files navigation

Tool for the analysis of LHC filling schemes

Authors: G. Iadarola, A. Poyet, G. Sterbini

Requirements: Python 3.7, numpy, pandas

To install:

git clone https://github.com/PyCOMPLETE/FillingPatterns.git
pip install ./FillingPatterns

To run an example:

cd FillingPatterns/examples
python 001_from_csv_analyze_bb.py

Usage

Loading a filling scheme

The filling scheme can be loaded in different ways:

  • From a json file (as provided by the LPC filling scheme tool):
importfillingpatternsasfppatt=fp.FillingPattern.from_json('fname.json')
  • From a csv file (which can be generated by this tool):
importfillingpatternsasfppatt=fp.FillingPattern.from_csv('fname.csv')
  • By providing two boolean arrays with the scheme:
importfillingpatternsasfppatt=fp.FillingPattern(pattern_b1, pattern_b2)

Analyzing the filling scheme

The filling scheme object has several attributes with characteristics of the filling scheme. For example:

patt.b1.n_bunchespatt.n_coll_ATLASpatt.n_coll_LHCbpatt.n_coll_ALICEpatt.b1.n_injectionspatt.b1.n_unused_slotspatt.b1.inj_composition_typespatt.b1.inj_pattern_typespatt.b1.gap_lengthspatt.b1.agap_length

The example 000_json_to_csv_and_comparison.py illustrates their usage.

To compute the beam-beam schedules for the two beams, using the previous algorithm:

patt.compute_beam_beam_schedule(n_lr_per_side=16, previous_algorithm=1)

This attaches to the object two pandas dataframes with information on the beam-beam encounters

patt.b1.bb_schedulepatt.b2.bb_schedule

To inspect the available information:

patt.b1.bb_schedule.keys()
# Returns:# Index(['HO partner in ALICE', '# of LR in ALICE', 'BB partners in ALICE',# 'Positions in ALICE', 'HO partner in ATLAS/CMS', '# of LR in ATLAS/CMS',# 'BB partners in ATLAS/CMS', 'Positions in ATLAS/CMS',# 'HO partner in LHCB', '# of LR in LHCB', 'BB partners in LHCB',# 'Positions in LHCB', 'collides in ATLAS/CMS', 'collides in ALICE',# 'collides in LHCB'],# dtype='object')

To access one colum:

patt.b1.bb_schedule[ 'BB partners in LHCB']

An example plotting some beam-beam properties is available at 001_from_csv_analyze_bb.py.

It's possible to compute the same output using another algorithm, implemented now, faster than the previous one:

patt.compute_beam_beam_schedule(n_lr_per_side=16, previous_algorithm=0)

About

Filling pattern analysis for the LHC

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages