コード例 #1
0
 def AddNTUPToInputFilesOfConfigDic(self):
     # Add NTUP skim to input files of ConfigDic
     try:
         from PATJobTransforms.Configuration import AddDPDFunctionMaker, AddToConfigDic, AddInputNTUPFunctionMaker
         from PyJobTransformsCore.full_trfarg import NtupleFileArg
         from NTUPtoNTUPCore.NTUPtoNTUPProdFlags import listAllKnownNTUPtoNTUP
         for ntup in listAllKnownNTUPtoNTUP:
             dpdName = ntup.StreamName
             inName = 'input' + (dpdName.lstrip("Stream")) + 'File'
             if self.tree_name != '':
                 tree_names = [self.tree_name]
             else:
                 tree_names = ntup.TreeNames
             function = AddInputNTUPFunctionMaker(inName, tree_names)
             AddToConfigDic(inName, function)
             pass
     except ImportError:
         print "WARNING NTUPtoNTUPProdFlags is not available. Only OK if you're using job transforms without the AtlasAnalysis project."
コード例 #2
0
    def __init__(self, inDic):
        JobTransform.__init__(
            self,
            authors=[Author('Michiru Kaneda', '*****@*****.**')],
            skeleton='NTUPtoNTUPCore/skeleton.NTUPtoNTUP_trf.py',
            help=__doc__)

        if not isinstance(inDic, dict):
            raise TypeError("inDic has type '%s' but should be a dictionary." %
                            type(inDic))
        # Add tree_name to ConfigDic
        from PyJobTransformsCore.full_trfarg import BasicStringArg
        from PATJobTransforms.Configuration import AddToConfigDic

        def AddTreeName(trf, inDic):
            trf.add(BasicStringArg(name='tree_name'))

        AddToConfigDic('tree_name', AddTreeName)

        # Set tree_name if it is in arguments
        self.tree_name = ''
        if inDic.has_key('tree_name'):
            self.tree_name = inDic['tree_name']
        else:
            self.tree_name = ''
            inDic['tree_name'] = ''

        # Add NTUPtoNTUP types to input files of ConfigDic
        self.AddNTUPToInputFilesOfConfigDic()

        # Check tree name from input file
        if self.tree_name == '': self.CheckTreeName(inDic)

        # Add NTUPtoNTUP types to output files of ConfigDic
        self.AddNTUPToOutputFilesOfConfigDic()

        # set tree_name in arguments
        inDic['tree_name'] = self.tree_name

        # Auto Configure From Dictionary
        from PATJobTransforms.ConfigDicUtils import AutoConfigureFromDic
        self.inDic = inDic
        AutoConfigureFromDic(self, inDic)
コード例 #3
0
 def AddNTUPToOutputFilesOfConfigDic(self):
     # Add NTUP skim to output files of ConfigDic
     try:
         from PATJobTransforms.Configuration import AddDPDFunctionMaker, AddToConfigDic, AddInputNTUPFunctionMaker
         from PyJobTransformsCore.full_trfarg import NtupleFileArg
         from NTUPtoNTUPCore.NTUPtoNTUPProdFlags import listAllKnownNTUPtoNTUP
         for ntup in listAllKnownNTUPtoNTUP:
             kw = {}
             fileArg = NtupleFileArg
             if self.tree_name != '':
                 kw['tree_names'] = [self.tree_name]
             else:
                 kw['tree_names'] = ntup.TreeNames
             dpdName = ntup.StreamName
             outName = 'output' + (dpdName.lstrip("Stream")) + 'File'
             function = AddDPDFunctionMaker(outName, fileArg, **kw)
             function.isOutput = 'root'
             function.subSteps = ntup.SubSteps
             AddToConfigDic(outName, function)
             pass
     except ImportError:
         print "WARNING NTUPtoNTUPProdFlags is not available. Only OK if you're using job transforms without the AtlasAnalysis project."