127 def _do_action( self, *args, **kwds ):
128 from AthenaCommon import CfgMgr
129 from AthenaCommon import AppMgr
130 if not hasattr(AppMgr.ServiceMgr,"THistSvc"):
131 AppMgr.ServiceMgr += CfgMgr.THistSvc()
132
133 for output in self.StoredValue:
134 if ":" not in output:
135 self.StoredValue.remove(output)
136 raise ValueError("HistOutputs: %s must be in format '<streamName>:<fileName>'" % output)
137
138 streamName = output.split(":",1)[0]
139 fileName = output.split(":",1)[1]
140
141
142 outputs = AppMgr.ServiceMgr.THistSvc.Output
143 foundStream=False
144 for hsOutput in outputs:
145 hsStreamName = hsOutput.split(" ",1)[0]
146 if hsStreamName==streamName:
147 foundStream=True
148 break
149 if not foundStream:
150 AppMgr.ServiceMgr.THistSvc.Output += ["%s DATAFILE='%s' OPT='RECREATE'" % (streamName,fileName)]
151
152