856 def __init__(self, name, viewMaker=None, isProbe=False, **viewMakerArgs):
857 super( InViewRecoCA, self ).
__init__()
858 self.name = name +
"_probe" if isProbe
else name
859 def updateHandle(baseTool, probeTool, handleName):
860 if hasattr(baseTool, handleName)
and getattr(baseTool, handleName).Path!=
"StoreGateSvc+":
861 setattr(probeTool, handleName, getattr(probeTool, handleName).Path +
"_probe")
863 if len(viewMakerArgs) != 0:
864 assert viewMaker
is None,
"No support for explicitly passed view maker and args for EventViewCreatorAlgorithm"
867 assert len(viewMakerArgs) == 0,
"No support for explicitly passed view maker and args for EventViewCreatorAlgorithm"
869 self.viewMakerAlg = viewMaker.__class__(viewMaker.getName()+
'_probe', **viewMaker._properties)
870 self.viewMakerAlg.Views = viewMaker.Views+
'_probe'
871 roiTool = self.viewMakerAlg.RoITool.__class.__(self.viewMakerAlg.RoITool.getName()+
'_probe', **self.viewMakerAlg.RoITool._properties)
872 log.debug(f
"InViewRecoCA: Setting InputCachedViews on {self.viewMaker.getName()} to read decisions from tag leg {viewMaker.getName()}: {viewMaker.InputMakerOutputDecisions}")
873 self.viewMakerAlg.InputCachedViews = viewMaker.InputMakerOutputDecisions
874 updateHandle(viewMakerArgs[
'RoITool'], roiTool,
"RoisWriteHandleKey")
875 if hasattr(viewMakerArgs[
'RoITool'],
"RoiCreator"):
876 updateHandle(viewMakerArgs[
'RoITool'], roiTool,
"ExtraPrefetchRoIsKey")
877 updateHandle(viewMakerArgs[
'RoITool'].RoiCreator, roiTool.RoiCreator,
"RoisWriteHandleKey")
879 self.viewMakerAlg.RoITool = roiTool
881 self.viewMakerAlg = viewMaker
883 assert 'name' not in viewMakerArgs,
"The name of view maker is predefined by the name of sequence"
884 assert 'Views' not in viewMakerArgs,
"The Views is predefined by the name of sequence"
885 assert 'ViewsNodeName' not in viewMakerArgs,
"The ViewsNodeName is predefined by the name of sequence"
886 if 'RoITool' in viewMakerArgs:
887 roiTool = viewMakerArgs[
'RoITool']
889 roiTool = CompFactory.ViewCreatorInitialROITool()
892 args = {
'name': f
'IM_{self.name}',
893 'ViewFallThrough' :
True,
894 'RoIsLink' :
'initialRoI',
896 'InViewRoIs' : f
'{name}RoIs',
897 'Views' : f
'{name}Views'+
'_probe' if isProbe
else f
'{name}Views',
898 'ViewNodeName' : f
'{name}InViews'+
'_probe' if isProbe
else f
'{name}InViews',
899 'RequireParentView' :
False,
900 'mergeUsingFeature' :
False }
901 args.update(**viewMakerArgs)
902 self.viewMakerAlg = CompFactory.EventViewCreatorAlgorithm(**args)
904 updateHandle(args[
'RoITool'], roiTool,
"RoisWriteHandleKey")
905 if hasattr(args[
'RoITool'],
"RoiCreator"):
906 updateHandle(args[
'RoITool'], roiTool,
"ExtraPrefetchRoIsKey")
907 updateHandle(args[
'RoITool'].RoiCreator, roiTool.RoiCreator,
"RoisWriteHandleKey")
908 self.viewsSeq =
parOR( self.viewMakerAlg.ViewNodeName )
909 self.addSequence( self.viewsSeq )