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

References split.

105 def buildList(pdList, matrix):
106  """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."""
107  alCaRecoList = []
108  for pd in pdList:
109  alCaRecoList.extend(matrix[pd].split("+"))
110  # remove duplicates converting to a set
111  alCaRecoList = set(alCaRecoList)
112  stringList = ''
113  for alCaReco in alCaRecoList:
114  if stringList == '':
115  stringList += alCaReco
116  else:
117  stringList += '+'+alCaReco
118  return stringList
119 
120 # Update the lists anytime a new PD is added to the matrix
def buildList(pdList, matrix)
Definition: autoAlca.py:105
double split
Definition: MVATrainer.cc:139