CMS 3D CMS Logo

Functions
autoAlca Namespace Reference

Functions

def buildList (pdList, matrix)
 

Function Documentation

def autoAlca.buildList (   pdList,
  matrix 
)
Takes a list of primary datasets (PDs) and the AlCaRecoMatrix (a dictinary) and returns a string with all the AlCaRecos for the selected PDs separated by the '+' character without duplicates.

Definition at line 63 of file autoAlca.py.

References split.

63 def buildList(pdList, matrix):
64  """Takes a list of primary datasets (PDs) and the AlCaRecoMatrix (a dictinary) and returns a string with all the AlCaRecos for the selected PDs separated by the '+' character without duplicates."""
65  alCaRecoList = []
66  for pd in pdList:
67  alCaRecoList.extend(matrix[pd].split("+"))
68  # remove duplicates converting to a set
69  alCaRecoList = set(alCaRecoList)
70  stringList = ''
71  for alCaReco in alCaRecoList:
72  if stringList == '':
73  stringList += alCaReco
74  else:
75  stringList += '+'+alCaReco
76  return stringList
77 
78 # Update the lists anytime a new PD is added to the matrix
def buildList(pdList, matrix)
Definition: autoAlca.py:63
double split
Definition: MVATrainer.cc:139