ATLAS Offline Software
Loading...
Searching...
No Matches
python.DetStatusLib.DetStatusReq Class Reference
Collaboration diagram for python.DetStatusLib.DetStatusReq:

Public Member Functions

 __init__ (self)
 setFromString (self, reqstring)
 getDict (self)
 __str__ (self)

Public Attributes

dict req = {}
 names = DetStatusNames()

Detailed Description

Definition at line 126 of file DetStatusLib.py.

Constructor & Destructor Documentation

◆ __init__()

python.DetStatusLib.DetStatusReq.__init__ ( self)

Definition at line 129 of file DetStatusLib.py.

129 def __init__(self):
130 "Initialise to empty set of requirements"
131 # requirements are stored as dict[status_channelID]=minimum value
132 self.req={}
133 # access to name/number translation
134 self.names=DetStatusNames()
135

Member Function Documentation

◆ __str__()

python.DetStatusLib.DetStatusReq.__str__ ( self)

Definition at line 163 of file DetStatusLib.py.

163 def __str__(self):
164 "Print representation of status requirements"
165 result=""
166 for (key,val) in self.req.items():
167 result+="%s %i " % (self.names.name(key),val)
168 return result
169

◆ getDict()

python.DetStatusLib.DetStatusReq.getDict ( self)

Definition at line 159 of file DetStatusLib.py.

159 def getDict(self):
160 "Return the dictionary holding the requirements (channel/value pairs)"
161 return self.req
162

◆ setFromString()

python.DetStatusLib.DetStatusReq.setFromString ( self,
reqstring )
Set requirements from a space-separated string with flag req pairs
e.g. 'SCTB 3 EMEC G' (numbers or letters for status)

Definition at line 136 of file DetStatusLib.py.

136 def setFromString(self,reqstring):
137 """Set requirements from a space-separated string with flag req pairs
138 e.g. 'SCTB 3 EMEC G' (numbers or letters for status)"""
139 self.req={}
140 namelist=self.names.allNames()
141 tokens=str(reqstring).split()
142 ix=0
143 while (ix+1<len(tokens)):
144 flagname=tokens[ix]
145 val=colourVal(tokens[ix+1])
146 if (val is not None):
147 used=False
148 # check if the name matches any flags
149 for name in namelist:
150 if (flagname==name[0:len(flagname)]):
151 self.req[self.names.num(name)]=val
152 used=True
153 if (not used):
154 print ("Name %s does not match any status flag" % flagname)
155 else:
156 print ("Value %s does not define a status" % tokens[ix+1])
157 ix+=2
158
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:177

Member Data Documentation

◆ names

python.DetStatusLib.DetStatusReq.names = DetStatusNames()

Definition at line 134 of file DetStatusLib.py.

◆ req

dict python.DetStatusLib.DetStatusReq.req = {}

Definition at line 132 of file DetStatusLib.py.


The documentation for this class was generated from the following file: