CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
relvalmc.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 """
3 _relvalmc_
4 
5 Scenario supporting RelVal MC production
6 
7 """
8 
9 import os
10 import sys
11 
12 from Configuration.DataProcessing.Scenario import Scenario
13 import FWCore.ParameterSet.Config as cms
14 from Configuration.PyReleaseValidation.ConfigBuilder import ConfigBuilder
15 from Configuration.PyReleaseValidation.ConfigBuilder import Options
16 from Configuration.PyReleaseValidation.ConfigBuilder import defaultOptions
17 from Configuration.PyReleaseValidation.ConfigBuilder import installFilteredStream
18 
19 
21  """
22  _relvalmc_
23 
24  Implement configuration building for RelVal MC production
25 
26  """
27 
28 
29  def promptReco(self, globalTag, writeTiers = ['RECO'], **args):
30  """
31  _promptReco_
32 
33  Prompt reco for RelVal MC production
34 
35  """
36 
37  options = Options()
38  options.__dict__.update(defaultOptions.__dict__)
39  options.scenario = "pp"
40  options.step = 'RAW2DIGI,L1Reco,RECO,VALIDATION,DQM,ENDJOB'
41  options.isMC = True
42  options.isData = False
43  options.beamspot = None
44  options.eventcontent = ','.join(writeTiers)
45  options.datatier = ','.join(writeTiers)
46  options.magField = 'AutoFromDBCurrent'
47  options.conditions = "FrontierConditions_GlobalTag,%s" % globalTag
48 
49  process = cms.Process('RECO')
50  cb = ConfigBuilder(options, process = process, with_output = True)
51 
52  # Input source
53  process.source = cms.Source("PoolSource",
54  fileNames = cms.untracked.vstring()
55  )
56  cb.prepare()
57 
58  return process
59 
60 
61  def alcaReco(self, skims, **args):
62  """
63  _alcaReco_
64 
65  AlcaReco processing & skims for RelVal MC production
66 
67  """
68  options = Options()
69  options.__dict__.update(defaultOptions.__dict__)
70  options.scenario = "pp"
71  options.step = 'ALCA:MuAlStandAloneCosmics+DQM,ENDJOB'
72  options.isMC = True
73  options.isData = False
74  options.conditions = "FrontierConditions_GlobalTag,%s" % globalTag
75  options.beamspot = None
76  options.eventcontent = None
77  options.relval = None
78 
79  process = cms.Process('ALCA')
80  cb = ConfigBuilder(options, process = process)
81 
82  # Input source
83  process.source = cms.Source(
84  "PoolSource",
85  fileNames = cms.untracked.vstring()
86  )
87 
88  cb.prepare()
89 
90  # //
91  # // Verify and Edit the list of skims to be written out
92  #// by this job
93  availableStreams = process.outputModules_().keys()
94 
95  # //
96  # // First up: Verify skims are available by output module name
97  #//
98  for skim in skims:
99  if skim not in availableStreams:
100  msg = "Skim named: %s not available " % skim
101  msg += "in Alca Reco Config:\n"
102  msg += "Known Skims: %s\n" % availableStreams
103  raise RuntimeError, msg
104 
105  # //
106  # // Prune any undesired skims
107  #//
108  for availSkim in availableStreams:
109  if availSkim not in skims:
110  self.dropOutputModule(process, availSkim)
111 
112  return process
113 
114 
115  def dqmHarvesting(self, datasetName, runNumber, globalTag, **args):
116  """
117  _dqmHarvesting_
118 
119  DQM Harvesting for RelVal MC production
120 
121  """
122  options = defaultOptions
123  options.scenario = "pp"
124  options.step = "HARVESTING:validationHarvesting+dqmHarvesting"
125  options.isMC = True
126  options.isData = False
127  options.beamspot = None
128  options.eventcontent = None
129  options.name = "EDMtoMEConvert"
130  options.conditions = "FrontierConditions_GlobalTag,%s" % globalTag
131  options.arguments = ""
132  options.evt_type = ""
133  options.filein = []
134 
135  process = cms.Process("HARVESTING")
136  process.source = cms.Source("PoolSource")
137  configBuilder = ConfigBuilder(options, process = process)
138  configBuilder.prepare()
139 
140  #
141  # customise process for particular job
142  #
143  process.source.processingMode = cms.untracked.string('RunsAndLumis')
144  process.source.fileNames = cms.untracked(cms.vstring())
145  process.maxEvents.input = -1
146  process.dqmSaver.workflow = datasetName
147  if args.has_key('referenceFile') and args.get('referenceFile', ''):
148  process.DQMStore.referenceFileName = \
149  cms.untracked.string(args['referenceFile'])
150 
151  return process
static std::string join(char **cmd)
Definition: RemoteFile.cc:18