allpot.pot_tools Namespace Reference

## Functions

def get_14kt_equiv_pot (pot)

## Detailed Description

Module containing useful POT conversion tools.

## Function Documentation

 def allpot.pot_tools.get_14kt_equiv_pot ( pot )
Converts POT to 14 kt equiv.

Uses a piecewise linear fit to the measured POT for each analysis
and then interpolate between the measured analysis POT values to
correct any POT number.

Args:
pot (float): POT value to correct.

Returns:
float: converted POT value.

Definition at line 6 of file pot_tools.py.

7  ''' Converts POT to 14 kt equiv.
8
9  Uses a piecewise linear fit to the measured POT for each analysis
10  and then interpolate between the measured analysis POT values to
11  correct any POT number.
12
13  Args:
14  pot (float): POT value to correct.
15
16  Returns:
17  float: converted POT value.
18  '''
19  # Delivered protons on target during commisioning, prior to first analysis
20  pot_deliv_com = 123.75 # e18
21  pot_equiv_com = 0 # e18
22
23  # Delivered protons on target for first analysis
24  pot_deliv_fa = 617.18 # e18
25  pot_equiv_fa = 273.545182186 # e18
26
27  # Delivered protons on target for second analysis
28  pot_deliv_sa = 943.68 # e18
29  pot_equiv_sa = 604.675092025 # e18
30
31  # Delivered protons on target for third analysis
32  pot_deliv_ta = 1240.53 # e18
33  pot_equiv_ta = 884.556902357 # e18
34
35  # Put these together in a piecewise linear way
36  if (pot <= pot_deliv_com):
37  pot0 = 0.0
38  y0 = 0.0
39  m = (pot_equiv_com - 0.)/(pot_deliv_com - 0.)
40  elif (pot <= pot_deliv_fa):
41  pot0 = pot_deliv_com
42  y0 = pot_equiv_com
43  m = (pot_equiv_fa - pot_equiv_com)/(pot_deliv_fa - pot_deliv_com)
44  elif (pot <= pot_deliv_sa):
45  pot0 = pot_deliv_fa
46  y0 = pot_equiv_fa
47  m = (pot_equiv_sa - pot_equiv_fa)/(pot_deliv_sa - pot_deliv_fa)
48  elif (pot <= pot_deliv_ta):
49  pot0 = pot_deliv_sa
50  y0 = pot_equiv_sa
51  m = (pot_equiv_ta - pot_equiv_sa)/(pot_deliv_ta - pot_deliv_sa)
52  else:
53  pot0 = pot_deliv_ta
54  y0 = pot_equiv_ta
55  m = 0.98 # assumed uptime efficiency
56
57  equiv_pot = y0 + m*(pot-pot0)
58
59  return equiv_pot
60
61
def get_14kt_equiv_pot(pot)
Definition: pot_tools.py:6