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 59 of file autoAlca.py.

References split.

59 def buildList(pdList, matrix):
60  """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."""
61  alCaRecoList = []
62  for pd in pdList:
63  alCaRecoList.extend(matrix[pd].split("+"))
64  # remove duplicates converting to a set
65  alCaRecoList = set(alCaRecoList)
66  stringList = ''
67  for alCaReco in alCaRecoList:
68  if stringList == '':
69  stringList += alCaReco
70  else:
71  stringList += '+'+alCaReco
72  return stringList
73 
74 # Update the lists anytime a new PD is added to the matrix
def buildList(pdList, matrix)
Definition: autoAlca.py:59
double split
Definition: MVATrainer.cc:139