ATLAS Offline Software
Classes | Functions | Variables
python.subdetectors.afp Namespace Reference

Classes

class  AFP
 
class  DCSC_Merged_Variable
 
class  DCSC_Multi_Channel_Variable
 
class  DCSC_Variable_With_Mapping
 
class  TDAQC_Array_Variable
 
class  TDAQC_Bit_Flag_Variable
 
class  TDAQC_Multi_Channel_Variable
 
class  TDAQC_Variable
 

Functions

def PBeastIOV (channel, value)
 
tuple[list[float], list[tuple[float,...]]] load_current (str filename, int n_modules)
 
tuple[float,...] get_current (tuple[list[float], list[tuple[float,...]]] data, float timestamp)
 
dict[int, int] mapChannels (*tuple[Collection[int], int] mapseqArgs)
 
dict[int, range] mapTranslatorCounts (Mapping[int, Iterable[int]] countMap)
 
def remove_None (value, default)
 

Variables

string pbeastDefaultServer = 'https://pc-atlas-www.cern.ch' if os.getenv('PBEAST_SERVER_HTTPS_PROXY', '').startswith('atlasgw') else 'https://atlasop.cern.ch'
 
 pbeastServer = os.getenv('PBEAST_SERVER', pbeastDefaultServer)
 
 pbeast
 
 log
 
 get_sit_current = functools.partial(get_current, load_current('afp_sit_current.dat', 16))
 
 get_tdc_current = functools.partial(get_current, load_current('afp_tdc_current.dat', 4))
 
 A_FAR_GARAGE
 
 A_NEAR_GARAGE
 
 C_FAR_GARAGE
 
 C_NEAR_GARAGE
 
 A_FAR_SIT_HV
 
 A_NEAR_SIT_HV
 
 C_FAR_SIT_HV
 
 C_NEAR_SIT_HV
 
 A_FAR_SIT_LV
 
 A_NEAR_SIT_LV
 
 C_FAR_SIT_LV
 
 C_NEAR_SIT_LV
 
 A_FAR_TOF_HV
 
 C_FAR_TOF_HV
 
 A_FAR_TOF_LV
 
 C_FAR_TOF_LV
 
int TTC_RESTART = 1000
 
int STOPLESSLY_REMOVED = 5000
 
 A_FAR_SIT_DISABLED
 
 A_NEAR_SIT_DISABLED
 
 C_FAR_SIT_DISABLED
 
 C_NEAR_SIT_DISABLED
 
 A_FAR_TOF_DISABLED
 
 C_FAR_TOF_DISABLED
 
list NAMING
 
list GARAGE = [A_FAR_GARAGE, A_NEAR_GARAGE, C_FAR_GARAGE, C_NEAR_GARAGE]
 
list SIT_HV = [A_FAR_SIT_HV, A_NEAR_SIT_HV, C_FAR_SIT_HV, C_NEAR_SIT_HV]
 
list SIT_LV = [A_FAR_SIT_LV, A_NEAR_SIT_LV, C_FAR_SIT_LV, C_NEAR_SIT_LV]
 
list TOF_HV = [A_FAR_TOF_HV, C_FAR_TOF_HV]
 
list TOF_LV = [A_FAR_TOF_LV, C_FAR_TOF_LV]
 
list SIT_DISABLED = [A_FAR_SIT_DISABLED, A_NEAR_SIT_DISABLED, C_FAR_SIT_DISABLED, C_NEAR_SIT_DISABLED]
 
list TOF_DISABLED = [A_FAR_TOF_DISABLED, C_FAR_TOF_DISABLED]
 
float SIT_HV_DEAD_BAND = 0.05
 
float TOF_HV_DEAD_BAND = 0.90
 
float SIT_LV_CURRENT_HIGH = 0.8
 
int TOF_HV_CURRENT_LOW = 600
 

Function Documentation

◆ get_current()

tuple[float, ...] python.subdetectors.afp.get_current ( tuple[list[float],list[tuple[float,...]]]  data,
float  timestamp 
)

Definition at line 287 of file afp.py.

287 def get_current(data: tuple[list[float],list[tuple[float,...]]], timestamp:float) -> tuple[float, ...]:
288  timestamp = timestamp / 1e9
289  keys, values = data
290  index = max(bisect(keys, timestamp) - 1, 0)
291  return values[index]
292 

◆ load_current()

tuple[list[float],list[tuple[float,...]]] python.subdetectors.afp.load_current ( str  filename,
int  n_modules 
)

Definition at line 266 of file afp.py.

266 def load_current(filename:str, n_modules:int) -> tuple[list[float],list[tuple[float,...]]]:
267  from datetime import datetime, timezone
268  from pkg_resources import resource_string
269  data = resource_string('DCSCalculator2.subdetectors.data', filename).decode().strip().split('\n')
270  result = {}
271  for line in data:
272  line = line.strip()
273  if not line or line[0] == '#': continue
274  line = line.split()
275  current = tuple(float(x) for x in line[1:])
276  if len(current) != n_modules:
277  log.warning(f"Wrong number of modules ({len(current)}) in resource '{filename}' from {line[0]}. Setting thresholds to 0...")
278  current = (0.,) * n_modules
279  time = datetime.fromisoformat(line[0])
280  if time.tzinfo is None: time = time.replace(tzinfo=timezone.utc)
281  time = time.timestamp()
282  result[time] = current
283  keys, values = zip(*sorted(result.items()))
284  if not values: keys, values = [0.], [(0.,) * n_modules]
285  return (list(keys), list(values))
286 

◆ mapChannels()

dict[int, int] python.subdetectors.afp.mapChannels ( *tuple[Collection[int], int]  mapseqArgs)

Definition at line 335 of file afp.py.

335 def mapChannels(*mapseqArgs: tuple[Collection[int], int]) -> dict[int, int]:
336  return dict(chain(*[zip(channels, range(defectChannel, defectChannel + len(channels))) for channels, defectChannel in mapseqArgs]))
337 

◆ mapTranslatorCounts()

dict[int, range] python.subdetectors.afp.mapTranslatorCounts ( Mapping[int,Iterable[int]]  countMap)

Definition at line 338 of file afp.py.

338 def mapTranslatorCounts(countMap:Mapping[int,Iterable[int]]) -> dict[int, range]:
339  return {channel: range(channel, channel + count) for count, channels in countMap.items() for channel in channels}
340 

◆ PBeastIOV()

def python.subdetectors.afp.PBeastIOV (   channel,
  value 
)

Definition at line 102 of file afp.py.

102 def PBeastIOV(channel, value):
103  "Stores the value of an object's attribute queried from pBeast"
104 

◆ remove_None()

def python.subdetectors.afp.remove_None (   value,
  default 
)

Definition at line 341 of file afp.py.

341 def remove_None(value, default):
342  return value if value is not None else default
343 

Variable Documentation

◆ A_FAR_GARAGE

python.subdetectors.afp.A_FAR_GARAGE

Definition at line 297 of file afp.py.

◆ A_FAR_SIT_DISABLED

python.subdetectors.afp.A_FAR_SIT_DISABLED

Definition at line 307 of file afp.py.

◆ A_FAR_SIT_HV

python.subdetectors.afp.A_FAR_SIT_HV

Definition at line 298 of file afp.py.

◆ A_FAR_SIT_LV

python.subdetectors.afp.A_FAR_SIT_LV

Definition at line 299 of file afp.py.

◆ A_FAR_TOF_DISABLED

python.subdetectors.afp.A_FAR_TOF_DISABLED

Definition at line 308 of file afp.py.

◆ A_FAR_TOF_HV

python.subdetectors.afp.A_FAR_TOF_HV

Definition at line 300 of file afp.py.

◆ A_FAR_TOF_LV

python.subdetectors.afp.A_FAR_TOF_LV

Definition at line 301 of file afp.py.

◆ A_NEAR_GARAGE

python.subdetectors.afp.A_NEAR_GARAGE

Definition at line 297 of file afp.py.

◆ A_NEAR_SIT_DISABLED

python.subdetectors.afp.A_NEAR_SIT_DISABLED

Definition at line 307 of file afp.py.

◆ A_NEAR_SIT_HV

python.subdetectors.afp.A_NEAR_SIT_HV

Definition at line 298 of file afp.py.

◆ A_NEAR_SIT_LV

python.subdetectors.afp.A_NEAR_SIT_LV

Definition at line 299 of file afp.py.

◆ C_FAR_GARAGE

python.subdetectors.afp.C_FAR_GARAGE

Definition at line 297 of file afp.py.

◆ C_FAR_SIT_DISABLED

python.subdetectors.afp.C_FAR_SIT_DISABLED

Definition at line 307 of file afp.py.

◆ C_FAR_SIT_HV

python.subdetectors.afp.C_FAR_SIT_HV

Definition at line 298 of file afp.py.

◆ C_FAR_SIT_LV

python.subdetectors.afp.C_FAR_SIT_LV

Definition at line 299 of file afp.py.

◆ C_FAR_TOF_DISABLED

python.subdetectors.afp.C_FAR_TOF_DISABLED

Definition at line 308 of file afp.py.

◆ C_FAR_TOF_HV

python.subdetectors.afp.C_FAR_TOF_HV

Definition at line 300 of file afp.py.

◆ C_FAR_TOF_LV

python.subdetectors.afp.C_FAR_TOF_LV

Definition at line 301 of file afp.py.

◆ C_NEAR_GARAGE

python.subdetectors.afp.C_NEAR_GARAGE

Definition at line 297 of file afp.py.

◆ C_NEAR_SIT_DISABLED

python.subdetectors.afp.C_NEAR_SIT_DISABLED

Definition at line 307 of file afp.py.

◆ C_NEAR_SIT_HV

python.subdetectors.afp.C_NEAR_SIT_HV

Definition at line 298 of file afp.py.

◆ C_NEAR_SIT_LV

python.subdetectors.afp.C_NEAR_SIT_LV

Definition at line 299 of file afp.py.

◆ GARAGE

list python.subdetectors.afp.GARAGE = [A_FAR_GARAGE, A_NEAR_GARAGE, C_FAR_GARAGE, C_NEAR_GARAGE]

Definition at line 319 of file afp.py.

◆ get_sit_current

python.subdetectors.afp.get_sit_current = functools.partial(get_current, load_current('afp_sit_current.dat', 16))

Definition at line 293 of file afp.py.

◆ get_tdc_current

python.subdetectors.afp.get_tdc_current = functools.partial(get_current, load_current('afp_tdc_current.dat', 4))

Definition at line 294 of file afp.py.

◆ log

python.subdetectors.afp.log

Definition at line 8 of file afp.py.

◆ NAMING

list python.subdetectors.afp.NAMING
Initial value:
1 = ['FSA0', 'FSA1', 'FSA2', 'FSA3',
2  'NSA0', 'NSA1', 'NSA2', 'NSA3',
3  'FSC0', 'FSC1', 'FSC2', 'FSC3',
4  'NSC0', 'NSC1', 'NSC2', 'NSC3',
5  'TDC-A-1', 'TDC-A-2',
6  'TDC-C-1', 'TDC-C-2']

Definition at line 311 of file afp.py.

◆ pbeast

python.subdetectors.afp.pbeast

Definition at line 7 of file afp.py.

◆ pbeastDefaultServer

string python.subdetectors.afp.pbeastDefaultServer = 'https://pc-atlas-www.cern.ch' if os.getenv('PBEAST_SERVER_HTTPS_PROXY', '').startswith('atlasgw') else 'https://atlasop.cern.ch'

Definition at line 4 of file afp.py.

◆ pbeastServer

python.subdetectors.afp.pbeastServer = os.getenv('PBEAST_SERVER', pbeastDefaultServer)

Definition at line 5 of file afp.py.

◆ SIT_DISABLED

list python.subdetectors.afp.SIT_DISABLED = [A_FAR_SIT_DISABLED, A_NEAR_SIT_DISABLED, C_FAR_SIT_DISABLED, C_NEAR_SIT_DISABLED]

Definition at line 325 of file afp.py.

◆ SIT_HV

list python.subdetectors.afp.SIT_HV = [A_FAR_SIT_HV, A_NEAR_SIT_HV, C_FAR_SIT_HV, C_NEAR_SIT_HV]

Definition at line 320 of file afp.py.

◆ SIT_HV_DEAD_BAND

float python.subdetectors.afp.SIT_HV_DEAD_BAND = 0.05

Definition at line 329 of file afp.py.

◆ SIT_LV

list python.subdetectors.afp.SIT_LV = [A_FAR_SIT_LV, A_NEAR_SIT_LV, C_FAR_SIT_LV, C_NEAR_SIT_LV]

Definition at line 321 of file afp.py.

◆ SIT_LV_CURRENT_HIGH

float python.subdetectors.afp.SIT_LV_CURRENT_HIGH = 0.8

Definition at line 332 of file afp.py.

◆ STOPLESSLY_REMOVED

int python.subdetectors.afp.STOPLESSLY_REMOVED = 5000

Definition at line 305 of file afp.py.

◆ TOF_DISABLED

list python.subdetectors.afp.TOF_DISABLED = [A_FAR_TOF_DISABLED, C_FAR_TOF_DISABLED]

Definition at line 326 of file afp.py.

◆ TOF_HV

list python.subdetectors.afp.TOF_HV = [A_FAR_TOF_HV, C_FAR_TOF_HV]

Definition at line 322 of file afp.py.

◆ TOF_HV_CURRENT_LOW

int python.subdetectors.afp.TOF_HV_CURRENT_LOW = 600

Definition at line 333 of file afp.py.

◆ TOF_HV_DEAD_BAND

float python.subdetectors.afp.TOF_HV_DEAD_BAND = 0.90

Definition at line 330 of file afp.py.

◆ TOF_LV

list python.subdetectors.afp.TOF_LV = [A_FAR_TOF_LV, C_FAR_TOF_LV]

Definition at line 323 of file afp.py.

◆ TTC_RESTART

int python.subdetectors.afp.TTC_RESTART = 1000

Definition at line 304 of file afp.py.

DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename R::value_type > sorted(const R &r, PROJ proj={})
Helper function to create a sorted vector from an unsorted range.
AtlasMcWeight::decode
double decode(number_type binnedWeight)
Convert weight from unsigned to double.
Definition: AtlasMcWeight.cxx:32
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
python.subdetectors.afp.mapChannels
dict[int, int] mapChannels(*tuple[Collection[int], int] mapseqArgs)
Definition: afp.py:335
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
python.subdetectors.afp.load_current
tuple[list[float], list[tuple[float,...]]] load_current(str filename, int n_modules)
Definition: afp.py:266
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
python.subdetectors.afp.PBeastIOV
def PBeastIOV(channel, value)
Definition: afp.py:102
python.subdetectors.afp.mapTranslatorCounts
dict[int, range] mapTranslatorCounts(Mapping[int, Iterable[int]] countMap)
Definition: afp.py:338
python.subdetectors.afp.get_current
tuple[float,...] get_current(tuple[list[float], list[tuple[float,...]]] data, float timestamp)
Definition: afp.py:287
python.subdetectors.afp.remove_None
def remove_None(value, default)
Definition: afp.py:341
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
python.LArMinBiasAlgConfig.float
float
Definition: LArMinBiasAlgConfig.py:65