CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
shallowTree_test_template.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValTTbarPileUpGENSIMRECO
3 import das
4 #from pdb import set_trace
5 
6 def add_rawRelVals(process):
7  dataset = das.query('dataset file=%s' % process.source.fileNames[0], verbose=True)
8  if not dataset:
9  raise RuntimeError(
10  'Das returned no dataset parent of the input file: %s \n'
11  'The parenthood is needed to add RAW secondary input files' % process.source.fileNames[0]
12  )
13  raw_dataset = dataset[0].replace('GEN-SIM-RECO','GEN-SIM-DIGI-RAW-HLTDEBUG')
14  raw_files = das.query('file dataset=%s' % raw_dataset, verbose=True)
15  if not raw_files:
16  raise RuntimeError('No files found belonging to the GEN-SIM-DIGI-RAW-HLTDEBUG sample!')
17  #convert from unicode into normal string since vstring does not pick it up
18  raw_files = [str(i) for i in raw_files]
19  process.source.secondaryFileNames = cms.untracked.vstring(*raw_files)
20  return process
21 
22 process = cms.Process('JustATest')
23 process.load('Configuration/StandardSequences/MagneticField_AutoFromDBCurrent_cff')
24 process.load("Configuration.Geometry.GeometryRecoDB_cff")
25 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
26 from Configuration.AlCa.GlobalTag import GlobalTag
27 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc')
28 
29 process.load('FWCore.MessageService.MessageLogger_cfi')
30 process.load('Configuration.StandardSequences.Services_cff')
31 process.TFileService = cms.Service(
32  "TFileService",
33  fileName = cms.string( 'FIXME' ),
34  closeFileFast = cms.untracked.bool(True)
35  )
36 
37 ## Maximal Number of Events
38 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(10) )
39 process.source = cms.Source (
40  "PoolSource",
41  fileNames = filesRelValTTbarPileUpGENSIMRECO
42  )
43 
44 process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )
45 process.MessageLogger.cerr.FwkReport.reportEvery = 1
46 
47 process.options = cms.untracked.PSet(
48  Rethrow = cms.untracked.vstring('OtherCMS',
49  'StdException',
50  'Unknown',
51  'BadAlloc',
52  'BadExceptionType',
53  'ProductNotFound',
54  'DictionaryNotFound',
55  'InsertFailure',
56  'Configuration',
57  'LogicError',
58  'UnimplementedFeature',
59  'InvalidReference',
60  'NullPointerError',
61  'NoProductSpecified',
62  'EventTimeout',
63  'EventCorruption',
64  'ScheduleExecutionFailure',
65  'EventProcessorFailure',
66  'FileInPathError',
67  'FileOpenError',
68  'FileReadError',
69  'FatalRootError',
70  'MismatchedInputFiles',
71  'ProductDoesNotSupportViews',
72  'ProductDoesNotSupportPtr',
73  'NotFound')
74 )
def query
Definition: das.py:5