Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
MenuCommon.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 
3 from TriggerMenuMT.L1.Base.Limits import Limits
4 
5 def print_available(L1MenuFlags):
6  import logging
7  available = list(set(range(Limits.MaxTrigItems-3)) - set(L1MenuFlags.CtpIdMap.value.values()) - set([508]))
8  freeItems = Limits.MaxTrigItems - len(L1MenuFlags.items.value) # correct for ZB and CALREQ items
9  floatingItems = sorted(list(set(L1MenuFlags.items.value) - set(L1MenuFlags.CtpIdMap.value.keys()))) # these items get their CTPID assigned automatically
10  unusedItemsWithCTPID = set(L1MenuFlags.CtpIdMap.value.keys()) - set(L1MenuFlags.items.value) # this should be empty, otherwise remove the items from the CtpIdMap
11  available.sort()
12  logging.info("There are %d available CTP IDs: %s", len(available), ",".join(map(str,available)))
13  logging.info("There are %d free items", freeItems)
14  logging.info("There are %d floating items: %s", len(floatingItems), ",".join(map(str,floatingItems)))
15  logging.info("There are %d unused items with CTP ID: %s", len(unusedItemsWithCTPID), ",".join(map(str,unusedItemsWithCTPID)))
16 
17 def defineCommonL1Flags(L1MenuFlags):
18  L1MenuFlags.CTPVersion = 4 # new CTP
19 
20  L1MenuFlags.BunchGroupPartitioning = [1, 15, 15] # partition 1: 1-10, partition 2: empty (was 14), partition 3: 15 (note that BGRP0 is used by all items)
21  L1MenuFlags.BunchGroupNames = ['BCRVeto', 'Paired', 'CalReq', 'Empty',
22  'IsolatedUnpaired', 'NonIsolatedUnpaired', 'EmptyBeforeAfterPaired', 'InTrain',
23  'FirstInTrain', 'AfterGlow', 'ALFA', 'EmptyBeforePaired',
24  'AllWithoutCalreq', 'UnpairedBeam1', 'UnpairedBeam2', 'PCC_AfterGlow']
25 
26 
27 # Define here the list of triggers that should be in all L1 menus
28 RequiredL1Items = [
29  #CALREQ
30  'L1_CALREQ0',
31  'L1_CALREQ1',
32  'L1_CALREQ2',
33 
34  # BPTX -- important for CTP timing checks
35  'L1_BPTX0_BGRP12','L1_BPTX1_BGRP12',
36 
37  # NSW Monitoring
38  'L1_NSW_MONITOR',
39 
40  # TRT
41  'L1_TRT_FILLED', 'L1_TRT_EMPTY',
42 
43  # TGC
44  'L1_TGC_BURST',
45 
46  # BCM
47  'L1_BCM_Wide', 'L1_BCM_Wide_CALIB', 'L1_BCM_Wide_EMPTY', 'L1_BCM_Wide_BGRP12', 'L1_BCM_Wide_UNPAIREDB1', 'L1_BCM_Wide_UNPAIREDB2',
48  'L1_BCM_2A_2C_UNPAIRED_ISO', 'L1_BCM_2A_2C_BGRP12',
49  'L1_BCM_2A_CALIB', 'L1_BCM_2C_CALIB',
50  'L1_BCM_2A_EMPTY', 'L1_BCM_2C_EMPTY',
51  'L1_BCM_2A_UNPAIREDB1', 'L1_BCM_2A_UNPAIREDB2', 'L1_BCM_2C_UNPAIREDB1', 'L1_BCM_2C_UNPAIREDB2',
52  'L1_BCM_2A_FIRSTINTRAIN', 'L1_BCM_2C_FIRSTINTRAIN',
53 
54  # RNDM
55  'L1_RD0_FILLED', 'L1_RD0_UNPAIRED_ISO', 'L1_RD0_EMPTY',
56  'L1_RD0_FIRSTEMPTY', 'L1_RD0_BGRP10', 'L1_RD0_BGRP11',
57  'L1_RD0_BGRP7', 'L1_RD0_BGRP15',
58  'L1_RD0_FIRSTINTRAIN',
59  'L1_RD1_EMPTY',
60  'L1_RD1_FILLED',
61  'L1_RD2_EMPTY',
62  'L1_RD2_FILLED',
63  'L1_RD3_EMPTY',
64  'L1_RD3_FILLED',
65  'L1_RD0_LAR_FILLED','L1_RD0_LAR_EMPTY','L1_RD0_LAR_FIRSTEMPTY','L1_RD0_LAR_BGRP7',
66 
67  # ZB
68  'L1_ZeroBias',
69 
70 
71 ]
python.L1.Menu.MenuCommon.defineCommonL1Flags
def defineCommonL1Flags(L1MenuFlags)
Definition: MenuCommon.py:17
python.L1.Menu.MenuCommon.print_available
def print_available(L1MenuFlags)
Definition: MenuCommon.py:5
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10