CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
SequenceTypes._MutatingSequenceVisitor Class Reference
Inheritance diagram for SequenceTypes._MutatingSequenceVisitor:
SequenceTypes._CopyAndExcludeSequenceVisitor SequenceTypes._CopyAndRemoveFirstSequenceVisitor SequenceTypes._CopyAndReplaceSequenceVisitor

Public Member Functions

def __init__
 
def enter
 
def leave
 
def result
 

Private Member Functions

def _didApply
 

Private Attributes

 __didApply
 
 __operator
 
 __result
 
 __stack
 

Detailed Description

Traverses a Sequence and constructs a new sequence by applying the operator to each element of the sequence

Definition at line 697 of file SequenceTypes.py.

Constructor & Destructor Documentation

def SequenceTypes._MutatingSequenceVisitor.__init__ (   self,
  operator 
)

Definition at line 699 of file SequenceTypes.py.

700  def __init__(self,operator):
701  self.__operator = operator
702  self.__stack = list()
703  self.__stack.append(list())
704  self.__result = None
self.__didApply = 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._MutatingSequenceVisitor._didApply (   self)
private

Definition at line 778 of file SequenceTypes.py.

References SequenceTypes._MutatingSequenceVisitor.__didApply.

Referenced by SequenceTypes._CopyAndExcludeSequenceVisitor.didExclude(), SequenceTypes._CopyAndRemoveFirstSequenceVisitor.didRemove(), and SequenceTypes._CopyAndReplaceSequenceVisitor.didReplace().

779  def _didApply(self):
780  return self.__didApply
def SequenceTypes._MutatingSequenceVisitor.enter (   self,
  visitee 
)

Definition at line 705 of file SequenceTypes.py.

References SequenceTypes._MutatingSequenceVisitor.__didApply, SequenceTypes._MutatingSequenceVisitor.__operator, SequenceTypes._CopyAndExcludeSequenceVisitorOld.__stack, SequenceTypes._MutatingSequenceVisitor.__stack, python.multivaluedict.append(), and list().

706  def enter(self,visitee):
707  if len(self.__stack) > 0:
708  #add visitee to its parent's stack entry
709  self.__stack[-1].append([visitee,False])
710  v = self.__operator(visitee)
711  if v is not visitee:
712  #was changed
713  self.__didApply = True
714  self.__stack[-1][-1]=[v,True]
715  if not isinstance(visitee, _SequenceLeaf):
716  #need to add a stack entry to keep track of children
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._MutatingSequenceVisitor.leave (   self,
  visitee 
)

Definition at line 717 of file SequenceTypes.py.

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

718  def leave(self,visitee):
719  node = visitee
720  if not visitee.isLeaf():
721  #were any children changed?
722  l = self.__stack[-1]
723  changed = False
724  countNulls = 0
725  nonNulls = list()
726  for c in l:
727  if c[1] == True:
728  changed = True
729  if c[0] is None:
730  countNulls +=1
731  else:
732  nonNulls.append(c[0])
733  if changed:
734  if countNulls != 0:
735  #this node must go away
736  if len(nonNulls) == 0:
737  #all subnodes went away
738  node = None
739  else:
740  node = nonNulls[0]
741  for n in nonNulls[1:]:
742  node = node+n
743  else:
744  #some child was changed so we need to clone
745  # this node and replace it with one that holds
746  # the new child(ren)
747  children = [x[0] for x in l ]
748  if not isinstance(visitee,Sequence):
749  node = visitee.__new__(type(visitee))
750  node.__init__(*children)
751  else:
752  node = nonNulls[0]
753  for n in nonNulls[1:]:
754  node = node+n
755 
756  if node != visitee:
757  #we had to replace this node so now we need to
758  # change parent's stack entry as well
759  if len(self.__stack) > 1:
760  p = self.__stack[-2]
761  #find visitee and replace
762  for i,c in enumerate(p):
763  if c[0]==visitee:
764  c[0]=node
765  c[1]=True
766  break
767  if not visitee.isLeaf():
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._MutatingSequenceVisitor.result (   self)

Definition at line 768 of file SequenceTypes.py.

References SequenceTypes._CopyAndExcludeSequenceVisitorOld.__stack, and SequenceTypes._MutatingSequenceVisitor.__stack.

769  def result(self):
770  result = None
771  for n in (x[0] for x in self.__stack[0]):
772  if n is None:
773  continue
774  if result is None:
775  result = n
776  else:
777  result = result+n
return result

Member Data Documentation

SequenceTypes._MutatingSequenceVisitor.__didApply
private

Definition at line 704 of file SequenceTypes.py.

Referenced by SequenceTypes._MutatingSequenceVisitor._didApply(), and SequenceTypes._MutatingSequenceVisitor.enter().

SequenceTypes._MutatingSequenceVisitor.__operator
private

Definition at line 700 of file SequenceTypes.py.

Referenced by SequenceTypes._MutatingSequenceVisitor.enter().

SequenceTypes._MutatingSequenceVisitor.__result
private

Definition at line 703 of file SequenceTypes.py.

Referenced by selectionParser.selectionParser.numls(), csvSelectionParser.csvSelectionParser.numls(), pileupParser.pileupParser.numls(), csvLumibyLSParser.csvLumibyLSParser.numls(), selectionParser.selectionParser.runsandls(), csvSelectionParser.csvSelectionParser.runsandls(), pileupParser.pileupParser.runsandls(), and csvLumibyLSParser.csvLumibyLSParser.runsandls().

SequenceTypes._MutatingSequenceVisitor.__stack
private

Definition at line 701 of file SequenceTypes.py.

Referenced by SequenceTypes._MutatingSequenceVisitor.enter(), SequenceTypes._MutatingSequenceVisitor.leave(), and SequenceTypes._MutatingSequenceVisitor.result().