ATLAS Offline Software
Menu_AllCTPIn_run3_v1.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 #
3 # Run this file in order to print out the empty slots
4 
5 from TriggerMenuMT.L1.Base.L1MenuFlags import L1MenuFlags
6 from TriggerMenuMT.L1.Base.Limits import Limits
7 
9  import logging
10  defineMenu()
11  available = list(set(range(Limits.MaxTrigItems-3)) - set(L1MenuFlags.CtpIdMap.value.values()) - set([508]))
12  freeItems = Limits.MaxTrigItems - len(L1MenuFlags.items.value) # correct for ZB and CALREQ items
13  floatingItems = sorted(list(set(L1MenuFlags.items.value) - set(L1MenuFlags.CtpIdMap.value.keys()))) # these items get their CTPID assigned automatically
14  unusedItemsWithCTPID = set(L1MenuFlags.CtpIdMap.value.keys()) - set(L1MenuFlags.items.value) # this should be empty, otherwise remove the items from the CtpIdMap
15  available.sort()
16  logging.info("There are %d available CTP IDs: %s", len(available), ",".join(map(str,available)))
17  logging.info("IDs >= 472 go in partition 2, IDs >= 492 go in partition 3")
18  logging.info("There are %d free items", freeItems)
19  logging.info("There are %d floating items: %s", len(floatingItems), ",".join(map(str,floatingItems)))
20  logging.info("There are %d unused items with CTP ID: %s", len(unusedItemsWithCTPID), ",".join(map(str,unusedItemsWithCTPID)))
21 
22 
23 def defineMenu():
24 
25  L1MenuFlags.CTPVersion = 4 # new CTP
26 
27  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)
28  L1MenuFlags.BunchGroupNames = ['BCRVeto', 'Paired', 'CalReq', 'Empty',
29  'IsolatedUnpaired', 'NonIsolatedUnpaired', 'EmptyAfterPaired', 'InTrain',
30  'AbortGapNotCalReq', 'VdM', 'ALFA', 'EmptyBeforePaired',
31  'EmptyAndPaired']
32 
33  L1MenuFlags.MenuPartitioning = [0, 472, 492] # partition 1: ctpid 0-471, partition 2: ctpid 472-491, partition 3: ctpid 492-511
34 
35  # Define one item per CTP connector
36  L1MenuFlags.items = [
37  # Direct CTP inputs
38  'L1_CTPCAL_Thresholds',
39  'L1_NIM1_Thresholds',
40  'L1_NIM2_Thresholds',
41 
42  # Legacy connectors
43  'L1_EM1_Thresholds',
44  'L1_EM2_Thresholds',
45  #
46  'L1_TAU1_Thresholds',
47  'L1_TAU2_Thresholds',
48  #
49  'L1_JET1_Thresholds',
50  'L1_JET2_Thresholds',
51  #
52  'L1_EN1_Thresholds',
53  'L1_EN2_Thresholds',
54 
55  ]
56 
57  # CTP ID 509-511 are reserved for CALREQ
58  L1MenuFlags.CtpIdMap = {
59  # to be used to hardcode CTP IDs for specific items
60  # NB: 509-511 for the CALREQ triggers (at the moment, ATR-22654)
61 
62  # High-frequency counters fixed to consecutive CTP IDs
63  # 8 items with the high frequency per-bunch monitoring counters (HF:111)
64  # should be in consecutive cpid, starting a ctpid number with ctpid%16 = 0
65  # ATR-23836
66  "L1_BCM_2A_FIRSTINTRAIN":480,
67  "L1_BCM_2C_FIRSTINTRAIN":481,
68  "L1_J12":482,
69  "L1_MBTS_1":483,
70  "L1_MBTS_2":484,
71  "L1_MBTS_1_1":485,
72  "L1_BCM_Wide":486,
73  # "":487,
74  }
75 
76 
77 if __name__ == "__main__": print_available()
78 
79 
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
python.L1.Menu.Menu_AllCTPIn_run3_v1.defineMenu
def defineMenu()
Definition: Menu_AllCTPIn_run3_v1.py:23
python.L1.Menu.Menu_AllCTPIn_run3_v1.print_available
def print_available()
Definition: Menu_AllCTPIn_run3_v1.py:8