ATLAS Offline Software
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("IDs >= 472 go in partition 2, IDs >= 492 go in partition 3")
14  logging.info("There are %d free items", freeItems)
15  logging.info("There are %d floating items: %s", len(floatingItems), ",".join(map(str,floatingItems)))
16  logging.info("There are %d unused items with CTP ID: %s", len(unusedItemsWithCTPID), ",".join(map(str,unusedItemsWithCTPID)))
17 
18 def defineCommonL1Flags(L1MenuFlags):
19  L1MenuFlags.CTPVersion = 4 # new CTP
20 
21  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)
22  L1MenuFlags.BunchGroupNames = ['BCRVeto', 'Paired', 'CalReq', 'Empty',
23  'IsolatedUnpaired', 'NonIsolatedUnpaired', 'EmptyAfterPaired', 'InTrain',
24  'AbortGapNotCalReq', 'VdM', 'ALFA', 'EmptyBeforePaired',
25  'EmptyAndPaired']
26 
27  L1MenuFlags.MenuPartitioning = [0, 472, 492] # partition 1: ctpid 0-471, partition 2: ctpid 472-491, partition 3: ctpid 492-511
28 
29 
30 # Define here the list of triggers that should be in all L1 menus
31 RequiredL1Items = [
32  #CALREQ
33  'L1_CALREQ0',
34  'L1_CALREQ1',
35  'L1_CALREQ2',
36 
37  # BPTX -- important for CTP timing checks
38  'L1_BPTX0_BGRP12','L1_BPTX1_BGRP12',
39 
40  # NSW Monitoring
41  'L1_NSW_MONITOR',
42 
43  # TRT
44  'L1_TRT_FILLED', 'L1_TRT_EMPTY',
45 
46  # TGC
47  'L1_TGC_BURST',
48 
49  # BCM
50  'L1_BCM_Wide', 'L1_BCM_Wide_CALIB', 'L1_BCM_Wide_EMPTY', 'L1_BCM_Wide_BGRP12', 'L1_BCM_Wide_UNPAIREDB1', 'L1_BCM_Wide_UNPAIREDB2',
51  'L1_BCM_2A_2C_UNPAIRED_ISO', 'L1_BCM_2A_2C_BGRP12',
52  'L1_BCM_2A_CALIB', 'L1_BCM_2C_CALIB',
53  'L1_BCM_2A_EMPTY', 'L1_BCM_2C_EMPTY',
54  'L1_BCM_2A_UNPAIREDB1', 'L1_BCM_2A_UNPAIREDB2', 'L1_BCM_2C_UNPAIREDB1', 'L1_BCM_2C_UNPAIREDB2',
55  'L1_BCM_2A_FIRSTINTRAIN', 'L1_BCM_2C_FIRSTINTRAIN',
56 
57  # RNDM
58  'L1_RD0_FILLED', 'L1_RD0_UNPAIRED_ISO', 'L1_RD0_EMPTY',
59  'L1_RD0_FIRSTEMPTY', 'L1_RD0_BGRP10', 'L1_RD0_BGRP11',
60  'L1_RD0_BGRP7', 'L1_RD0_BGRP15',
61  'L1_RD0_FIRSTINTRAIN',
62  'L1_RD1_EMPTY',
63  'L1_RD1_FILLED',
64  'L1_RD2_EMPTY',
65  'L1_RD2_FILLED',
66  'L1_RD3_EMPTY',
67  'L1_RD3_FILLED',
68 
69  # ZB
70  'L1_ZeroBias',
71 
72 
73 ]
74 
75 FixedIDMap = {
76  # to be used to hardcode CTP IDs for specific items
77  # NB: 509-511 for the CALREQ triggers (at the moment, ATR-22654)
78 
79  # High-frequency counters fixed to consecutive CTP IDs
80  # 8 items with the high frequency per-bunch monitoring counters (HF:111)
81  # should be in consecutive cpid, starting a ctpid number with ctpid%16 = 0
82  # ATR-23836
83  "L1_BCM_2A_FIRSTINTRAIN":480,
84  "L1_BCM_2C_FIRSTINTRAIN":481,
85  "L1_jJ30":482,
86  "L1_MBTS_1":483,
87  "L1_MBTS_2":484,
88  "L1_MBTS_1_1":485,
89  "L1_BCM_Wide":486,
90  # "":487,
91  }
python.L1.Menu.MenuCommon.defineCommonL1Flags
def defineCommonL1Flags(L1MenuFlags)
Definition: MenuCommon.py:18
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:224
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10