Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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[SiT_LV_Current_Type]] load_sit_current ()
 
SiT_LV_Current_Type get_sit_current (float timestamp)
 
def mapChannels (*mapseqArgs)
 
def mapTranslatorCounts (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
 
 SiT_LV_Current_Type = GenericAlias(tuple, (float,)*16)
 
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
 
SiT_LV_Current_Type SIT_LV_CURRENT_LOW = get_sit_current
 
float SIT_LV_CURRENT_HIGH = 0.8
 
int TOF_HV_CURRENT_LOW = 600
 
float TOF_LV_CURRENT_LOW = 1.4
 

Function Documentation

◆ get_sit_current()

SiT_LV_Current_Type python.subdetectors.afp.get_sit_current ( float  timestamp)

Definition at line 294 of file afp.py.

294 def get_sit_current(timestamp:float) -> SiT_LV_Current_Type:
295  timestamp = timestamp / 1e9
296  keys, values = SIT_LV_CURRENT_LOW_DATA
297  index = max(bisect(keys, timestamp) - 1, 0)
298  return values[index] if values else [0] * 16
299 
300 # DCS channels
301 A_FAR_GARAGE, A_NEAR_GARAGE, C_FAR_GARAGE, C_NEAR_GARAGE = 101, 105, 109, 113
302 A_FAR_SIT_HV, A_NEAR_SIT_HV, C_FAR_SIT_HV, C_NEAR_SIT_HV = 1, 5, 9, 13
303 A_FAR_SIT_LV, A_NEAR_SIT_LV, C_FAR_SIT_LV, C_NEAR_SIT_LV = 21, 25, 29, 33
304 A_FAR_TOF_HV, C_FAR_TOF_HV = 17, 19
305 A_FAR_TOF_LV, C_FAR_TOF_LV = 37, 39
306 
307 # TDAQ channels

◆ load_sit_current()

tuple[list[float],list[SiT_LV_Current_Type]] python.subdetectors.afp.load_sit_current ( )

Definition at line 272 of file afp.py.

272 def load_sit_current() -> tuple[list[float],list[SiT_LV_Current_Type]]:
273  from datetime import datetime, timezone
274  from pkg_resources import resource_string
275  sit_current = resource_string('DCSCalculator2.subdetectors.data', 'afp_sit_current.dat').decode().strip().split('\n')
276  result = dict()
277  for line in sit_current:
278  line = line.strip()
279  if not line or line[0] == '#': continue
280  line = line.split()
281  current = tuple(float(x) for x in line[1:])
282  if len(current) != 16:
283  log.warn(f"Wrong number of AFP SiT planes ({len(current)}) in the LV resource from {line[0]}. Setting thresholds to 0...")
284  current = [0] * 16
285  assert(len(current) == 16)
286  time = datetime.fromisoformat(line[0])
287  if time.tzinfo is None: time = time.replace(tzinfo=timezone.utc)
288  time = time.timestamp()
289  result[time] = current
290  keys, values = zip(*sorted(result.items()))
291  return (list(keys), list(values))
292 
293 SIT_LV_CURRENT_LOW_DATA:tuple[list[float],list[SiT_LV_Current_Type]] = load_sit_current()

◆ mapChannels()

def python.subdetectors.afp.mapChannels ( mapseqArgs)

Definition at line 346 of file afp.py.

346 def mapChannels(*mapseqArgs):
347  return dict(chain(*[zip(channels, range(defectChannel, defectChannel + len(channels))) for channels, defectChannel in mapseqArgs]))
348 

◆ mapTranslatorCounts()

def python.subdetectors.afp.mapTranslatorCounts (   countMap)

Definition at line 349 of file afp.py.

349 def mapTranslatorCounts(countMap):
350  return {channel: range(channel, channel + count) for count, channels in countMap.items() for channel in channels}
351 

◆ PBeastIOV()

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

Definition at line 107 of file afp.py.

107 def PBeastIOV(channel, value):
108  "Stores the value of an object's attribute queried from pBeast"
109 

◆ remove_None()

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

Definition at line 352 of file afp.py.

352 def remove_None(value, default):
353  return value if value is not None else default
354 

Variable Documentation

◆ A_FAR_SIT_DISABLED

python.subdetectors.afp.A_FAR_SIT_DISABLED

Definition at line 311 of file afp.py.

◆ A_FAR_TOF_DISABLED

python.subdetectors.afp.A_FAR_TOF_DISABLED

Definition at line 312 of file afp.py.

◆ A_NEAR_SIT_DISABLED

python.subdetectors.afp.A_NEAR_SIT_DISABLED

Definition at line 311 of file afp.py.

◆ C_FAR_SIT_DISABLED

python.subdetectors.afp.C_FAR_SIT_DISABLED

Definition at line 311 of file afp.py.

◆ C_FAR_TOF_DISABLED

python.subdetectors.afp.C_FAR_TOF_DISABLED

Definition at line 312 of file afp.py.

◆ C_NEAR_SIT_DISABLED

python.subdetectors.afp.C_NEAR_SIT_DISABLED

Definition at line 311 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 323 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 315 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 329 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 324 of file afp.py.

◆ SIT_HV_DEAD_BAND

float python.subdetectors.afp.SIT_HV_DEAD_BAND = 0.05

Definition at line 333 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 325 of file afp.py.

◆ SIT_LV_CURRENT_HIGH

float python.subdetectors.afp.SIT_LV_CURRENT_HIGH = 0.8

Definition at line 342 of file afp.py.

◆ SIT_LV_CURRENT_LOW

SiT_LV_Current_Type python.subdetectors.afp.SIT_LV_CURRENT_LOW = get_sit_current

Definition at line 341 of file afp.py.

◆ SiT_LV_Current_Type

python.subdetectors.afp.SiT_LV_Current_Type = GenericAlias(tuple, (float,)*16)

Definition at line 271 of file afp.py.

◆ STOPLESSLY_REMOVED

int python.subdetectors.afp.STOPLESSLY_REMOVED = 5000

Definition at line 309 of file afp.py.

◆ TOF_DISABLED

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

Definition at line 330 of file afp.py.

◆ TOF_HV

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

Definition at line 326 of file afp.py.

◆ TOF_HV_CURRENT_LOW

int python.subdetectors.afp.TOF_HV_CURRENT_LOW = 600

Definition at line 343 of file afp.py.

◆ TOF_HV_DEAD_BAND

float python.subdetectors.afp.TOF_HV_DEAD_BAND = 0.90

Definition at line 334 of file afp.py.

◆ TOF_LV

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

Definition at line 327 of file afp.py.

◆ TOF_LV_CURRENT_LOW

float python.subdetectors.afp.TOF_LV_CURRENT_LOW = 1.4

Definition at line 344 of file afp.py.

◆ TTC_RESTART

int python.subdetectors.afp.TTC_RESTART = 1000

Definition at line 308 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
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
python.subdetectors.afp.mapChannels
def mapChannels(*mapseqArgs)
Definition: afp.py:346
python.subdetectors.afp.get_sit_current
SiT_LV_Current_Type get_sit_current(float timestamp)
Definition: afp.py:294
python.subdetectors.afp.load_sit_current
tuple[list[float], list[SiT_LV_Current_Type]] load_sit_current()
Definition: afp.py:272
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
python.subdetectors.afp.mapTranslatorCounts
def mapTranslatorCounts(countMap)
Definition: afp.py:349
python.subdetectors.afp.PBeastIOV
def PBeastIOV(channel, value)
Definition: afp.py:107
python.subdetectors.afp.remove_None
def remove_None(value, default)
Definition: afp.py:352
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
python.LArMinBiasAlgConfig.float
float
Definition: LArMinBiasAlgConfig.py:65