Exemple #1
0
def mergeProcess(*inputFiles, **options):
    """
    _mergeProcess_

    Creates and returns a merge process that will merge the provided
    filenames

    supported options:

    - process_name : name of the process, defaults to Merge
    - outputmod_label : label of the output module, defaults to Merged
    - newDQMIO : specifies if the new DQM format should be used to merge the files
    - output_file : sets the output file name
    - output_lfn : sets the output LFN

    """
    #  //
    # // process supported options
    #//
    processName = options.get("process_name", "Merge")
    outputModLabel = options.get("outputmod_label", "Merged")
    outputFilename = options.get("output_file", "Merged.root")
    outputLFN = options.get("output_lfn", None)
    dropDQM = options.get("drop_dqm", False)
    newDQMIO = options.get("newDQMIO", False)
    
    #  //
    # // build process
    #//
    process = Process(processName)

    #  //
    # // input source
    #//
    if newDQMIO:
        process.source = Source("DQMRootSource")
        process.add_(Service("DQMStore"))
    else:
        process.source = Source("PoolSource")
        if dropDQM:
            process.source.inputCommands = CfgTypes.untracked.vstring('keep *','drop *_EDMtoMEConverter_*_*')
    process.source.fileNames = CfgTypes.untracked(CfgTypes.vstring())
    for entry in inputFiles:
        process.source.fileNames.append(str(entry))
 
    #  //
    # // output module
    #//
    if newDQMIO:
        outMod = OutputModule("DQMRootOutputModule")
    else:
        outMod = OutputModule("PoolOutputModule")
    outMod.fileName = CfgTypes.untracked.string(outputFilename)
    if outputLFN != None:
        outMod.logicalFileName = CfgTypes.untracked.string(outputLFN)
    setattr(process, outputModLabel, outMod)

    process.outputPath = EndPath(outMod)

    return process
Exemple #2
0
def mergeProcess(*inputFiles, **options):
    """
    _mergeProcess_

    Creates and returns a merge process that will merge the provided
    filenames

    supported options:

    - process_name : name of the process, defaults to Merge
    - outputmod_label : label of the output module, defaults to Merged
    - newDQMIO : specifies if the new DQM format should be used to merge the files
    - output_file : sets the output file name
    - output_lfn : sets the output LFN

    """
    #  //
    # // process supported options
    # //
    processName = options.get("process_name", "Merge")
    outputModLabel = options.get("outputmod_label", "Merged")
    outputFilename = options.get("output_file", "Merged.root")
    outputLFN = options.get("output_lfn", None)
    dropDQM = options.get("drop_dqm", False)
    newDQMIO = options.get("newDQMIO", False)

    #  //
    # // build process
    # //
    process = Process(processName)

    #  //
    # // input source
    # //
    if newDQMIO:
        process.source = Source("DQMRootSource")
        process.add_(Service("DQMStore"))
    else:
        process.source = Source("PoolSource")
        if dropDQM:
            process.source.inputCommands = CfgTypes.untracked.vstring("keep *", "drop *_EDMtoMEConverter_*_*")
    process.source.fileNames = CfgTypes.untracked(CfgTypes.vstring())
    for entry in inputFiles:
        process.source.fileNames.append(str(entry))

    #  //
    # // output module
    # //
    if newDQMIO:
        outMod = OutputModule("DQMRootOutputModule")
    else:
        outMod = OutputModule("PoolOutputModule")
    outMod.fileName = CfgTypes.untracked.string(outputFilename)
    if outputLFN != None:
        outMod.logicalFileName = CfgTypes.untracked.string(outputLFN)
    setattr(process, outputModLabel, outMod)

    process.outputPath = EndPath(outMod)

    return process
def makeProcess(numEvents = 200):
    """
    _makeProcess_

    Create a new Process instance

    """
    
    proc = Process("HLT")
    proc.include("FWCore/MessageLogger/data/MessageLogger.cfi")
    


    configName =  "fake-streamer-config"
    configVersion = timestamp()
    configAnnot =  "auto generated fake streamer  config"

    proc.configurationMetadata = CmsTypes.untracked(CmsTypes.PSet())
    proc.configurationMetadata.name = CmsTypes.untracked(CmsTypes.string(
        configName))
    proc.configurationMetadata.version = CmsTypes.untracked(CmsTypes.string(
        configVersion))
        
    proc.configurationMetadata.annotation = CmsTypes.untracked(CmsTypes.string(
        configAnnot))

    
    proc.options = CmsTypes.untracked(CmsTypes.PSet())
    proc.options.wantSummary = CmsTypes.untracked(CmsTypes.bool(True))

    proc.source = Source("EmptySource")

    proc.maxEvents = CmsTypes.untracked(CmsTypes.PSet())
    proc.maxEvents.input = CmsTypes.untracked(CmsTypes.int32(numEvents))
    

    proc.prod = EDProducer("StreamThingProducer")
    proc.prod.array_size = CmsTypes.int32(2500)
    proc.prod.instance_count = CmsTypes.int32(150)
    proc.prod.apply_bit_mask = CmsTypes.untracked(CmsTypes.bool(True))
    proc.prod.bit_mask = CmsTypes.untracked( CmsTypes.uint32( 16777215))

    proc.add_(Service("RandomNumberGeneratorService"))
    
    svc = proc.services["RandomNumberGeneratorService"]
    svc.moduleSeeds = CmsTypes.PSet()
    
    proc.makeData = Path(proc.prod)
    
    return proc
Exemple #4
0
def mergeProcess(*inputFiles, **options):
    """
    _mergeProcess_

    Creates and returns a merge process that will merge the provided
    filenames

    supported options:

    - process_name : name of the process, defaults to Merge
    - outputmod_label : label of the output module, defaults to Merged
    - newDQMIO : specifies if the new DQM format should be used to merge the files
    - output_file : sets the output file name
    - output_lfn : sets the output LFN
    - mergeNANO : to merge NanoAOD
    - bypassVersionCheck : to bypass version check in case merging happened in lower version of CMSSW (i.e. UL HLT case). This will be TRUE by default.

    """
    #  //
    # // process supported options
    #//
    processName = options.get("process_name", "Merge")
    outputModLabel = options.get("outputmod_label", "Merged")
    outputFilename = options.get("output_file", "Merged.root")
    outputLFN = options.get("output_lfn", None)
    dropDQM = options.get("drop_dqm", False)
    newDQMIO = options.get("newDQMIO", False)
    mergeNANO = options.get("mergeNANO", False)
    bypassVersionCheck = options.get("bypassVersionCheck", True)
    #  //
    # // build process
    #//
    process = Process(processName)

    #  //
    # // input source
    #//
    if newDQMIO:
        process.source = Source("DQMRootSource")
        process.add_(Service("DQMStore"))
    else:
        process.source = Source("PoolSource")
        process.source.bypassVersionCheck = CfgTypes.untracked.bool(bypassVersionCheck)
        if dropDQM:
            process.source.inputCommands = CfgTypes.untracked.vstring('keep *','drop *_EDMtoMEConverter_*_*')
    process.source.fileNames = CfgTypes.untracked(CfgTypes.vstring())
    for entry in inputFiles:
        process.source.fileNames.append(str(entry))
 
    #  //
    # // output module
    #//
    if newDQMIO:
        outMod = OutputModule("DQMRootOutputModule")
    elif mergeNANO:
        import Configuration.EventContent.EventContent_cff
        outMod = OutputModule("NanoAODOutputModule",Configuration.EventContent.EventContent_cff.NANOAODEventContent.clone())
        process.add_(Service("InitRootHandlers", EnableIMT = CfgTypes.untracked.bool(False)))
    else:
        outMod = OutputModule("PoolOutputModule")

    outMod.fileName = CfgTypes.untracked.string(outputFilename)
    if outputLFN != None:
        outMod.logicalFileName = CfgTypes.untracked.string(outputLFN)
    setattr(process, outputModLabel, outMod)

    process.outputPath = EndPath(outMod)

    return process
Exemple #5
0
def mergeProcess(*inputFiles, **options):
    """
    _mergeProcess_

    Creates and returns a merge process that will merge the provided
    filenames

    supported options:

    - process_name : name of the process, defaults to Merge
    - outputmod_label : label of the output module, defaults to Merged
    - newDQMIO : specifies if the new DQM format should be used to merge the files
    - output_file : sets the output file name
    - output_lfn : sets the output LFN
    - mergeNANO : to merge NanoAOD
    - bypassVersionCheck : to bypass version check in case merging happened in lower version of CMSSW (i.e. UL HLT case). This will be FALSE by default.

    """
    #  //
    # // process supported options
    #//
    processName = options.get("process_name", "Merge")
    outputModLabel = options.get("outputmod_label", "Merged")
    outputFilename = options.get("output_file", "Merged.root")
    outputLFN = options.get("output_lfn", None)
    dropDQM = options.get("drop_dqm", False)
    newDQMIO = options.get("newDQMIO", False)
    mergeNANO = options.get("mergeNANO", False)
    bypassVersionCheck = options.get("bypassVersionCheck", False)
    #  //
    # // build process
    #//
    process = Process(processName)

    #  //
    # // input source
    #//
    if newDQMIO:
        process.source = Source("DQMRootSource")
        process.add_(Service("DQMStore", forceResetOnBeginLumi = CfgTypes.untracked.bool(True)))
    else:
        process.source = Source("PoolSource")
        if bypassVersionCheck:
            process.source.bypassVersionCheck = CfgTypes.untracked.bool(True)
        if dropDQM:
            process.source.inputCommands = CfgTypes.untracked.vstring('keep *','drop *_EDMtoMEConverter_*_*')
    process.source.fileNames = CfgTypes.untracked(CfgTypes.vstring())
    for entry in inputFiles:
        process.source.fileNames.append(str(entry))
 
    #  //
    # // output module
    #//
    if newDQMIO:
        outMod = OutputModule("DQMRootOutputModule")
    elif mergeNANO:
        import Configuration.EventContent.EventContent_cff
        outMod = OutputModule("NanoAODOutputModule",Configuration.EventContent.EventContent_cff.NANOAODEventContent.clone())
        process.add_(Service("InitRootHandlers", EnableIMT = CfgTypes.untracked.bool(False)))
    else:
        outMod = OutputModule("PoolOutputModule")

    outMod.fileName = CfgTypes.untracked.string(outputFilename)
    if outputLFN != None:
        outMod.logicalFileName = CfgTypes.untracked.string(outputLFN)
    setattr(process, outputModLabel, outMod)

    process.outputPath = EndPath(outMod)

    return process