290 """ Does the actual work ... """
291 folderName = folder.fullPath().
split(
'/')[-1]
292 attrNames = [ps.name()
for ps
in folder.payloadSpecification()]
294 attrNames =
filter(
lambda n: n
in attrIncludeList, attrNames)
295 elif attrExcludeList:
296 attrNames =
filter(
lambda n: n
not in attrExcludeList, attrNames)
298 attrTypes = [ps.storageType().
name()
for ps
in folder.payloadSpecification() \
299 if ps.name()
in attrNames]
300 attrNameTypes = zip(attrNames, attrTypes)
302 if not containerName:
303 containerName =
'L1Calo{0}Container'.
format(folderName)
305 objectName =
'L1Calo{0}'.
format(folderName)
309 mapping[
'CommandLine'] =
' '.
join(sys.argv)
310 mapping[
'ContainerName'] = containerName
311 mapping[
'CONTAINERNAME'] = containerName.upper()
312 mapping[
'FolderName'] = folderName
314 mapping[
'ObjectName'] = objectName
315 mapping[
'EnumAttrSpecification'] =
', '.
join([
'e{0}'.
format(n)
for n
in attrNames])
316 mapping[
'FullFolderPath'] = folder.fullPath()
317 mapping[
'ClassDefMacro'] = \
318 'CLASS_DEF( {0}, {1}, 1 )'.
format(containerName,
319 _cliddb.genClidFromName(containerName))
324 mapping[
'AttrList'] =
', '.
join(map(_toCamelCase, attrNames))
331 for not_needed
in (
'ContainerName',
'CONTAINERNAME',
'FolderName',
'folderName',
332 'EnumAttrSpecification',
'ClassDefMacro',
'DefineSpecificationList',
333 'AddSpecificationList',
'ReadSpecificationList',
'AttrList'):
334 del mapping[not_needed]
335 mapping[
'OBJECTNAME'] = objectName.upper()
348 'cont' : containerName,
353 print '[I] Add the following to the selection.xml file:'
354 print ' <class name="{cont}" id="{id}" />'.
format(**mapping)
355 print ' <class name="{cont}::const_iterator" />'.
format(**mapping)
356 print ' <class name="{obj}" />'.
format(**mapping)
358 print '[I] Add the following to the TrigT1CaloCalibConditionsDict.h file:'
359 print '#include "TrigT1CaloCalibConditions/{cont}.h"'.
format(**mapping)
360 print '#include "TrigT1CaloCalibConditions/{obj}.h"'.
format(**mapping)
362 print ' {cont}::const_iterator {cont}ConstInterator;'.
format(**mapping)