Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:14:47

0001 import FWCore.ParameterSet.Config as cms
0002 from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValTTbarPileUpGENSIMRECO
0003 import Utilities.General.cmssw_das_client as cmssw_das_client
0004 #from pdb import set_trace
0005 
0006 ######
0007 #
0008 # Ideally to be used, unfortunately sample is not at CERN
0009 #
0010 # from PhysicsTools.PatAlgos.tools.cmsswVersionTools import pickRelValInputFiles
0011 # filesRelValTTbarPileUpGENSIMRECO = cms.untracked.vstring(
0012 #    pickRelValInputFiles( cmsswVersion  = 'CMSSW_9_2_3'
0013 #                          , relVal        = 'RelValTTbar_13'
0014 #                          , globalTag     = 'PUpmx25ns_92X_upgrade2017_realistic_v2_earlyBS2017'
0015 #                          , dataTier      = 'GEN-SIM-RECO'
0016 #                          , maxVersions   = 1
0017 #                          , numberOfFiles = 1
0018 #                          , useDAS        = True
0019 #                          )
0020 #    )
0021 
0022 def add_rawRelVals(process):   
0023    query='dataset file=%s' % process.source.fileNames[0]
0024    dataset = cmssw_das_client.get_data(query, limit = 0)
0025    if not dataset:
0026       raise RuntimeError(
0027          'Das returned no dataset parent of the input file: %s \n'
0028          'The parenthood is needed to add RAW secondary input files' % process.source.fileNames[0]
0029          )
0030    raw_dataset = dataset['data'][0]['dataset'][0]['name'].replace('GEN-SIM-RECO','GEN-SIM-DIGI-RAW-HLTDEBUG')
0031    raw_files = cmssw_das_client.get_data('file dataset=%s' % raw_dataset, limit=0)['data']
0032    
0033    if not raw_files:
0034       raise RuntimeError('No files found belonging to the GEN-SIM-DIGI-RAW-HLTDEBUG sample!')
0035 
0036    #convert from unicode into normal string since vstring does not pick it up
0037    raw_files = [str(i) for i in raw_files]
0038    process.source.secondaryFileNames = cms.untracked.vstring(*raw_files)
0039    return process
0040 
0041 process = cms.Process('JustATest')
0042 process.load('Configuration.StandardSequences.MagneticField_cff')
0043 process.load("Configuration.Geometry.GeometryRecoDB_cff")
0044 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0045 from Configuration.AlCa.GlobalTag import GlobalTag
0046 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2017_realistic')
0047 
0048 process.load('FWCore.MessageService.MessageLogger_cfi')
0049 process.load('Configuration.StandardSequences.Services_cff')
0050 process.TFileService = cms.Service( 
0051    "TFileService",
0052    fileName = cms.string( 'FIXME' ),
0053    closeFileFast = cms.untracked.bool(True)  
0054    ) 
0055 
0056 ## Maximal Number of Events
0057 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(10) )
0058 process.source = cms.Source (
0059     "PoolSource",
0060     fileNames = filesRelValTTbarPileUpGENSIMRECO
0061     )
0062 
0063 process.options   = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )
0064 process.MessageLogger.cerr.FwkReport.reportEvery = 1
0065 
0066 process.options = cms.untracked.PSet(
0067     Rethrow = cms.untracked.vstring('OtherCMS', 
0068         'StdException', 
0069         'Unknown', 
0070         'BadAlloc', 
0071         'BadExceptionType', 
0072         'ProductNotFound', 
0073         'DictionaryNotFound', 
0074         'InsertFailure', 
0075         'Configuration', 
0076         'LogicError', 
0077         'UnimplementedFeature', 
0078         'InvalidReference', 
0079         'NullPointerError', 
0080         'NoProductSpecified', 
0081         'EventTimeout', 
0082         'EventCorruption', 
0083         'ScheduleExecutionFailure', 
0084         'EventProcessorFailure', 
0085         'FileInPathError', 
0086         'FileOpenError', 
0087         'FileReadError', 
0088         'FatalRootError', 
0089         'MismatchedInputFiles', 
0090         'ProductDoesNotSupportViews', 
0091         'ProductDoesNotSupportPtr', 
0092         'NotFound')
0093 )