CMS 3D CMS Logo

Functions
shallowTree_test_template Namespace Reference

Functions

def add_rawRelVals (process)
 Ideally to be used, unfortunately sample is not at CERN. More...
 

Function Documentation

def shallowTree_test_template.add_rawRelVals (   process)

Ideally to be used, unfortunately sample is not at CERN.

from PhysicsTools.PatAlgos.tools.cmsswVersionTools import pickRelValInputFiles filesRelValTTbarPileUpGENSIMRECO = cms.untracked.vstring( pickRelValInputFiles( cmsswVersion = 'CMSSW_9_2_3' , relVal = 'RelValTTbar_13' , globalTag = 'PUpmx25ns_92X_upgrade2017_realistic_v2_earlyBS2017' , dataTier = 'GEN-SIM-RECO' , maxVersions = 1 , numberOfFiles = 1 , useDAS = True ) )

Definition at line 22 of file shallowTree_test_template.py.

References cmssw_das_client.get_data(), python.rootplot.root2matplotlib.replace(), and str.

22 def add_rawRelVals(process):
23  query='dataset file=%s' % process.source.fileNames[0]
24  dataset = cmssw_das_client.get_data(query, limit = 0)
25  if not dataset:
26  raise RuntimeError(
27  'Das returned no dataset parent of the input file: %s \n'
28  'The parenthood is needed to add RAW secondary input files' % process.source.fileNames[0]
29  )
30  raw_dataset = dataset['data'][0]['dataset'][0]['name'].replace('GEN-SIM-RECO','GEN-SIM-DIGI-RAW-HLTDEBUG')
31  raw_files = cmssw_das_client.get_data('file dataset=%s' % raw_dataset, limit=0)['data']
32 
33  if not raw_files:
34  raise RuntimeError('No files found belonging to the GEN-SIM-DIGI-RAW-HLTDEBUG sample!')
35 
36  #convert from unicode into normal string since vstring does not pick it up
37  raw_files = [str(i) for i in raw_files]
38  process.source.secondaryFileNames = cms.untracked.vstring(*raw_files)
39  return process
40 
def add_rawRelVals(process)
Ideally to be used, unfortunately sample is not at CERN.
def replace(string, replacements)
def get_data(query, limit=None, threshold=None, idx=None, host=None, cmd=None)
#define str(s)