CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions | Variables
dataset Namespace Reference

Classes

class  BaseDataset
 
class  CMSDataset
 
class  Dataset
 
class  EOSDataset
 
class  IntegrityCheckError
 
class  LocalDataset
 
class  PrivateDataset
 

Functions

def createDataset
 
def createMyDataset
 if user == 'CMS': data = CMSDataset( dataset ) elif user == 'LOCAL': if basedir is None: basedir = os.environ['CMGLOCALBASEDIR'] data = LocalDataset( dataset, basedir, pattern ) else: data = Dataset( user, dataset, pattern ) More...
 
def getDatasetFromCache
 
def writeDatasetToCache
 

Variables

tuple dataset = Dataset( datasetName )
 
string datasetName = '/MinimumBias/Run2012D-TkAlMinBias-v1/ALCARECO'
 
string end = "20121128"
 
string firstRun = "207800"
 
tuple jsonFile
 
 jsonPath = jsonFile,
 

Function Documentation

def dataset.createDataset (   user,
  dataset,
  pattern,
  readcache = False,
  basedir = None,
  run_range = None 
)

Definition at line 426 of file dataset.py.

References getDatasetFromCache(), and writeDatasetToCache().

Referenced by writeDatasetToCache().

427  basedir = None, run_range = None):
428 
429 
430  def cacheFileName(data, user, pattern):
431  return '{user}%{name}%{pattern}.pck'.format( user = user, name = data.replace('/','_'), pattern = pattern)
432 
433  def writeCache(dataset):
434  writeDatasetToCache( cacheFileName(dataset.name, dataset.user, dataset.pattern), dataset )
435 
436  def readCache(data, user, pattern):
437  return getDatasetFromCache( cacheFileName(data, user, pattern) )
438 
439  if readcache:
440  try:
441  data = readCache(dataset, user, pattern)
442  except IOError:
443  readcache = False
444  if not readcache:
445  if user == 'CMS':
446  data = CMSDataset( dataset , run_range = run_range)
447  info = False
448  elif user == 'LOCAL':
449  data = LocalDataset( dataset, basedir, pattern)
450  info = False
451  else:
452  data = Dataset( dataset, user, pattern)
writeCache(data)
def writeDatasetToCache
Definition: dataset.py:418
def getDatasetFromCache
Definition: dataset.py:412
def dataset.createMyDataset (   user,
  dataset,
  pattern,
  dbsInstance,
  readcache = False 
)

if user == 'CMS': data = CMSDataset( dataset ) elif user == 'LOCAL': if basedir is None: basedir = os.environ['CMGLOCALBASEDIR'] data = LocalDataset( dataset, basedir, pattern ) else: data = Dataset( user, dataset, pattern )

MM

Definition at line 464 of file dataset.py.

References join().

465 def createMyDataset( user, dataset, pattern, dbsInstance, readcache=False):
466 
467  cachedir = '/'.join( [os.environ['HOME'],'.cmgdataset'])
468 
469  def cacheFileName(data, user, dbsInstance, pattern):
470  cf = data.replace('/','_')
471  name = '{dir}/{user}%{dbsInstance}%{name}%{pattern}.pck'.format(
472  dir = cachedir,
473  user = user,
474  dbsInstance = dbsInstance,
475  name = cf,
476  pattern = pattern)
477  return name
478 
479  def writeCache(dataset):
480  if not os.path.exists(cachedir):
481  os.mkdir(cachedir)
482  cachename = cacheFileName(dataset.name,
483  dataset.user,
484  dataset.dbsInstance,
485  dataset.pattern)
486  pckfile = open( cachename, 'w')
487  pickle.dump(dataset, pckfile)
488 
489  def readCache(data, user, dbsInstance, pattern):
490  cachename = cacheFileName(data, user, dbsInstance, pattern)
491 
492  pckfile = open( cachename)
493  dataset = pickle.load(pckfile)
494  #print 'reading cache'
495  return dataset
496 
497  if readcache:
498  try:
499  data = readCache(dataset, user, dbsInstance, pattern)
500  except IOError:
501  readcache = False
502  if not readcache:
503  if user == 'PRIVATE':
504  data = PrivateDataset( dataset, dbsInstance )
505  info = False
506  writeCache(data)
return data
def createMyDataset
if user == 'CMS': data = CMSDataset( dataset ) elif user == 'LOCAL': if basedir is None: basedir = os...
Definition: dataset.py:464
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def dataset.getDatasetFromCache (   cachename)

Definition at line 412 of file dataset.py.

References join().

Referenced by createDataset().

413 def getDatasetFromCache( cachename ) :
414  cachedir = '/'.join( [os.environ['HOME'],'.cmgdataset'])
415  pckfile = open( cachedir + "/" + cachename )
416  dataset = pickle.load(pckfile)
417  return dataset
def getDatasetFromCache
Definition: dataset.py:412
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def dataset.writeDatasetToCache (   cachename,
  dataset 
)

Definition at line 418 of file dataset.py.

References createDataset(), and join().

Referenced by createDataset().

419 def writeDatasetToCache( cachename, dataset ):
420  cachedir = '/'.join( [os.environ['HOME'],'.cmgdataset'])
421  if not os.path.exists(cachedir):
422  os.mkdir(cachedir)
423  pckfile = open( cachedir + "/" + cachename, 'w')
424  pickle.dump(dataset, pckfile)
def writeDatasetToCache
Definition: dataset.py:418
static std::string join(char **cmd)
Definition: RemoteFile.cc:18

Variable Documentation

tuple dataset.dataset = Dataset( datasetName )

Definition at line 840 of file dataset.py.

Referenced by EcalTPGParamBuilder.analyze(), CalibratedElectronProducer.CalibratedElectronProducer(), CalibratedPatElectronProducer.CalibratedPatElectronProducer(), HcalDQMDbInterface.createFooter(), TriggerRatesMonitor.dqmBeginRun(), dumpObject_(), popcon::EcalSRPHandler.getNewObjects(), popcon::EcalTPGLinConstHandler.getNewObjects(), popcon::EcalTPGBadStripHandler.getNewObjects(), popcon::EcalTPGLutIdMapHandler.getNewObjects(), popcon::EcalTPGBadTTHandler.getNewObjects(), popcon::EcalTPGPhysicsConstHandler.getNewObjects(), popcon::EcalTPGWeightIdMapHandler.getNewObjects(), popcon::EcalTPGFineGrainEBIdMapHandler.getNewObjects(), popcon::EcalTPGBadXTHandler.getNewObjects(), popcon::EcalTPGFineGrainEBGroupHandler.getNewObjects(), popcon::EcalTPGFineGrainTowerEEHandler.getNewObjects(), popcon::EcalTPGWeightGroupHandler.getNewObjects(), popcon::EcalTPGPedestalsHandler.getNewObjects(), popcon::EcalTPGSlidingWindowHandler.getNewObjects(), popcon::EcalTPGFineGrainStripEEHandler.getNewObjects(), popcon::EcalTPGLutGroupHandler.getNewObjects(), popcon::EcalTPGSpikeThresholdHandler.getNewObjects(), popcon::EcalADCToGeVHandler.getNewObjects(), popcon::EcalIntercalibHandler.getNewObjects(), popcon::EcalDCSHandler.getNewObjects(), XMLDocument.makeDataset(), XMLDocument.makeElementDataset(), and ecaldqm::SummaryWriter.run().

string dataset.datasetName = '/MinimumBias/Run2012D-TkAlMinBias-v1/ALCARECO'

Definition at line 836 of file dataset.py.

string dataset.end = "20121128"

Definition at line 843 of file dataset.py.

string dataset.firstRun = "207800"

Definition at line 842 of file dataset.py.

Referenced by TkModuleGroupSelector.createModuleGroups(), SiPixelDcsInfo.dqmEndLuminosityBlock(), plotData.plotData(), HDQMInspector.setRange(), and SiPixelDcsInfo.SiPixelDcsInfo().

tuple dataset.jsonFile
Initial value:
1 = ( '/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/'
2  'Collisions12/8TeV/Prompt/'
3  'Cert_190456-207898_8TeV_PromptReco_Collisions12_JSON.txt' )

Definition at line 837 of file dataset.py.

dataset.jsonPath = jsonFile,

Definition at line 845 of file dataset.py.