CMS 3D CMS Logo

datasetToSource.py
Go to the documentation of this file.
1 from __future__ import absolute_import
2 import os
3 from .dataset import Dataset, CMSDataset, LocalDataset, createDataset, PrivateDataset, createMyDataset
4 
5 import FWCore.ParameterSet.Config as cms
6 
7 def datasetToSource( user, dataset, pattern='.*root', readCache=False):
8 
9  # print user, dataset, pattern
10  data = createDataset(user, dataset, pattern, readCache)
11 
12  source = cms.Source(
13  "PoolSource",
14  noEventSort = cms.untracked.bool(True),
15  duplicateCheckMode = cms.untracked.string("noDuplicateCheck"),
16  fileNames = cms.untracked.vstring()
17  )
18 
19  source.fileNames.extend( data.listOfGoodFiles() )
20 
21  return source
22 
23 
24 def myDatasetToSource( user, dataset, pattern='.*root', dbsInstance=None, readCache=False):
25 
26  #print user, dataset, pattern, dbsInstance
27  data = createMyDataset(user, dataset, pattern, dbsInstance, readCache)
28 
29  source = cms.Source(
30  "PoolSource",
31  noEventSort = cms.untracked.bool(True),
32  duplicateCheckMode = cms.untracked.string("noDuplicateCheck"),
33  fileNames = cms.untracked.vstring()
34  )
35 
36  #print data.listOfGoodFiles()
37  source.fileNames.extend( data.listOfGoodFiles() )
38 
39  return source
40 
datasetToSource.myDatasetToSource
def myDatasetToSource(user, dataset, pattern='.*root', dbsInstance=None, readCache=False)
MM.
Definition: datasetToSource.py:24
datasetToSource.datasetToSource
def datasetToSource(user, dataset, pattern='.*root', readCache=False)
Definition: datasetToSource.py:7
dataset.createDataset
def createDataset(user, dataset, pattern, readcache=False, basedir=None, run_range=None)
Definition: dataset.py:429
dataset.createMyDataset
def createMyDataset(user, dataset, pattern, dbsInstance, readcache=False)
if user == 'CMS': data = CMSDataset( dataset ) elif user == 'LOCAL': if basedir is None: basedir = os...
Definition: dataset.py:471