ATLAS Offline Software
Trigger
TrigAnalysis
TrigInDetAnalysisExample
python
chainString.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2
3
# take a chain string configuration and decode it into the constituent parts,
4
# so that it can be reconstructed without the tags.
5
6
# This is an approximate python implementation of the equivalent c++
7
# class and wouldn't be needed if the setPath() method on the GenericMonitoringTool
8
# worked correctly, since the decoding is done in the c++, and the path could then
9
# be set correctly at that point. sadly, this doesn;t not seem to work, so we need
10
# to decode consistently in the c++ and the python to make sure that things
11
# are consistent
12
13
class
chainString
:
14
15
def
__init__
(self, input ):
16
self.
head
=
""
17
self.
tail
=
""
18
self.
roi
=
""
19
self.
vtx
=
""
20
self.
element
=
""
21
self.
extra
=
""
22
self.
passed
=
""
23
24
if
":"
in
input:
25
parts = input.split(
":"
)
26
else
:
27
parts = [ input ]
28
29
for
part
in
parts :
30
if
part[-4:]==
";DTE"
:
31
self.
passed
=
True
32
part = part[0:-4]
33
if
self.
head
==
""
:
34
self.
head
= part
35
continue
36
if
"key="
in
part:
37
self.
tail
= part[4:]
38
if
"roi="
in
part:
39
self.
roi
= part[4:]
40
if
"vtx="
in
part:
41
self.
vtx
= part[4:]
42
if
"te="
in
part:
43
self.
element
= part[3:]
44
if
"extra="
in
part:
45
self.
extra
= part[6:]
46
47
stuff = [ self.
roi
, self.
vtx
, self.
element
, self.
extra
]
48
49
sum = self.
head
50
51
if
self.
tail
!=
""
:
52
if
sum ==
""
:
53
sum = self.
tail
54
else
:
55
sum +=
"_"
+ self.
tail
56
57
58
for
part
in
stuff:
59
if
part !=
""
:
60
sum +=
"_"
+part
61
62
if
self.
passed
:
63
sum +=
"_DTE"
64
65
self.
sum
= sum
66
67
# provide the summary
68
def
summary
( self ):
69
return
self.
sum
70
71
# printout if needed
72
def
printchain
( self ):
73
print
(
" head: "
, self.
head
)
74
print
(
" tail: "
, self.
tail
)
75
print
(
" vtx: "
, self.
vtx
)
76
print
(
" roi: "
, self.
roi
)
77
print
(
" te: "
, self.
element
)
78
print
(
" extra: "
, self.
extra
)
79
print
(
" passed: "
, self.
passed
)
80
print
(
" sum: "
, self.
sum
)
81
print
(
""
)
82
83
84
# provide the summary without needing the
85
# intermediate class instance
86
87
def
summarise
( input ) :
88
return
chainString
( input ).
summary
()
89
python.chainString.chainString.passed
passed
Definition:
chainString.py:22
python.chainString.chainString.vtx
vtx
Definition:
chainString.py:19
python.chainString.chainString.printchain
def printchain(self)
Definition:
chainString.py:72
python.chainString.chainString.head
head
Definition:
chainString.py:16
python.chainString.summarise
def summarise(input)
Definition:
chainString.py:87
python.chainString.chainString.summary
def summary(self)
Definition:
chainString.py:68
python.chainString.chainString.__init__
def __init__(self, input)
Definition:
chainString.py:15
python.chainString.chainString.extra
extra
Definition:
chainString.py:21
print
void print(char *figname, TCanvas *c1)
Definition:
TRTCalib_StrawStatusPlots.cxx:25
python.chainString.chainString
Definition:
chainString.py:13
python.chainString.chainString.tail
tail
Definition:
chainString.py:17
python.chainString.chainString.sum
sum
Definition:
chainString.py:65
python.chainString.chainString.roi
roi
Definition:
chainString.py:18
python.chainString.chainString.element
element
Definition:
chainString.py:20
SCT_Monitoring::summary
@ summary
Definition:
SCT_MonitoringNumbers.h:65
Generated on Wed Jan 8 2025 21:07:53 for ATLAS Offline Software by
1.8.18