ATLAS Offline Software
find_tgc_unfilled_channelids.py
Go to the documentation of this file.
1 #! /usr/bin/env python
2 
3 from IPython.Shell import IPShellEmbed; ip = IPShellEmbed(["-pdb"])
4 
5 from DCSCalculator2.subdetectors.tgc import TGC, DCSC_Variable_TGC_HV, TGC_Database, get_mapping
6 from DQUtils import fetch_iovs
7 from DQUtils.iov_arrangement import inverse_lblb
8 from itertools import chain
9 
10 runs = 165732, 165733
11 
12 iovs = inverse_lblb(fetch_iovs("LBLB", runs=runs))
13 start, end = iovs.first.since, iovs.last.until
14 
15 TGC_data = DCSC_Variable_TGC_HV(None, None)
16 TGC_data.db = TGC_Database()
17 mapping = get_mapping(TGC_data.db)
18 TGC_data.all_channels = set(chain(*mapping.values()))
19 
20 tgc_conditions = TGC_data.read_tgc_conditions(start.date, end.date)
21 tgc_channels_nonempty = set(iov.channel for iov in tgc_conditions if iov)
22 
23 print "Total IoVs for query range:", len(tgc_conditions)
24 print "Channels with IoV data:", len(tgc_conditions.channels)
25 print "Channels with nonempty IoV data:", len(tgc_channels_nonempty)
26 print "Channels in mapping table:", len(TGC_data.all_channels)
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
python.iov_arrangement.inverse_lblb
def inverse_lblb(iovs)
Definition: iov_arrangement.py:34
python.db.fetch_iovs
def fetch_iovs(folder_name, since=None, until=None, channels=None, tag="", what="all", max_records=-1, with_channel=True, loud=False, database=None, convert_time=False, named_channels=False, selection=None, runs=None, with_time=False, unicode_strings=False)
Definition: DQUtils/python/db.py:67
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