CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
SequenceTypes._CopyAndExcludeSequenceVisitorOld Class Reference
Inheritance diagram for SequenceTypes._CopyAndExcludeSequenceVisitorOld:

Public Member Functions

def __init__ (self, modulesToRemove)
 
def didExclude (self)
 
def enter (self, visitee)
 
def leave (self, visitee)
 
def result (self)
 

Private Attributes

 __didExclude
 
 __modulesToIgnore
 
 __result
 
 __stack
 

Detailed Description

Traverses a Sequence and constructs a new sequence which does not contain modules from the specified list

Definition at line 950 of file SequenceTypes.py.

Constructor & Destructor Documentation

def SequenceTypes._CopyAndExcludeSequenceVisitorOld.__init__ (   self,
  modulesToRemove 
)

Definition at line 952 of file SequenceTypes.py.

952  def __init__(self,modulesToRemove):
953  self.__modulesToIgnore = modulesToRemove
954  self.__stack = list()
955  self.__stack.append(list())
956  self.__result = None
957  self.__didExclude = False
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run

Member Function Documentation

def SequenceTypes._CopyAndExcludeSequenceVisitorOld.didExclude (   self)

Definition at line 1033 of file SequenceTypes.py.

References SequenceTypes._CopyAndExcludeSequenceVisitorOld.__didExclude.

1033  def didExclude(self):
1034  return self.__didExclude
1035 
1036 
1037 # This visitor can also be used on Tasks.
def SequenceTypes._CopyAndExcludeSequenceVisitorOld.enter (   self,
  visitee 
)

Definition at line 958 of file SequenceTypes.py.

References SequenceTypes._CopyAndExcludeSequenceVisitorOld.__didExclude, SequenceTypes._CopyAndExcludeSequenceVisitorOld.__modulesToIgnore, SequenceTypes._CopyAndExcludeSequenceVisitorOld.__stack, mps_setup.append, and list().

958  def enter(self,visitee):
959  if len(self.__stack) > 0:
960  #add visitee to its parent's stack entry
961  self.__stack[-1].append([visitee,False])
962  if visitee.isLeaf():
963  if visitee in self.__modulesToIgnore:
964  self.__didExclude = True
965  self.__stack[-1][-1]=[None,True]
966  elif isinstance(visitee, Sequence):
967  if visitee in self.__modulesToIgnore:
968  self.__didExclude = True
969  self.__stack[-1][-1]=[None,True]
970  self.__stack.append(list())
971  else:
972  #need to add a stack entry to keep track of children
973  self.__stack.append(list())
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
def SequenceTypes._CopyAndExcludeSequenceVisitorOld.leave (   self,
  visitee 
)

Definition at line 974 of file SequenceTypes.py.

References SequenceTypes._CopyAndExcludeSequenceVisitorOld.__didExclude, SequenceTypes._CopyAndExcludeSequenceVisitorOld.__stack, and list().

974  def leave(self,visitee):
975  node = visitee
976  if not visitee.isLeaf():
977  #were any children changed?
978  l = self.__stack[-1]
979  changed = False
980  countNulls = 0
981  nonNulls = list()
982  for c in l:
983  if c[1] == True:
984  changed = True
985  if c[0] is None:
986  countNulls +=1
987  else:
988  nonNulls.append(c[0])
989  if changed:
990  self.__didExclude = True
991  if countNulls != 0:
992  #this node must go away
993  if len(nonNulls) == 0:
994  #all subnodes went away
995  node = None
996  else:
997  node = nonNulls[0]
998  for n in nonNulls[1:]:
999  node = node+n
1000  else:
1001  #some child was changed so we need to clone
1002  # this node and replace it with one that holds
1003  # the new child(ren)
1004  children = [x[0] for x in l ]
1005  if not isinstance(visitee,Sequence):
1006  node = visitee.__new__(type(visitee))
1007  node.__init__(*children)
1008  else:
1009  node = nonNulls[0]
1010  if node != visitee:
1011  #we had to replace this node so now we need to
1012  # change parent's stack entry as well
1013  if len(self.__stack) > 1:
1014  p = self.__stack[-2]
1015  #find visitee and replace
1016  for i,c in enumerate(p):
1017  if c[0]==visitee:
1018  c[0]=node
1019  c[1]=True
1020  break
1021  if not visitee.isLeaf():
1022  self.__stack = self.__stack[:-1]
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
def SequenceTypes._CopyAndExcludeSequenceVisitorOld.result (   self)

Definition at line 1023 of file SequenceTypes.py.

References SequenceTypes._CopyAndExcludeSequenceVisitorOld.__stack.

1023  def result(self):
1024  result = None
1025  for n in (x[0] for x in self.__stack[0]):
1026  if n is None:
1027  continue
1028  if result is None:
1029  result = n
1030  else:
1031  result = result+n
1032  return result

Member Data Documentation

SequenceTypes._CopyAndExcludeSequenceVisitorOld.__didExclude
private
SequenceTypes._CopyAndExcludeSequenceVisitorOld.__modulesToIgnore
private
SequenceTypes._CopyAndExcludeSequenceVisitorOld.__result
private
SequenceTypes._CopyAndExcludeSequenceVisitorOld.__stack
private