CMS 3D CMS Logo

AlCa.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 """
3 _AlCa_
4 
5 Scenario supporting proton collisions
6 
7 """
8 
9 import os
10 import sys
11 
13 from Configuration.DataProcessing.Utils import stepALCAPRODUCER,dqmIOSource,harvestingMode,dictIO,gtNameAndConnect,addMonitoring
14 import FWCore.ParameterSet.Config as cms
15 
16 class AlCa(Scenario):
17  def __init__(self):
18  Scenario.__init__(self)
19 
20  """
21  _AlCa_
22 
23  Implement configuration building for data processing for proton
24  collision data taking
25 
26  """
27 
28  def skimsIfNotGiven(self,args,sl):
29  if not 'skims' in args:
30  args['skims']=sl
31 
32  def promptReco(self, globalTag, **args):
33  if not 'skims' in args:
34  args['skims']=self.skims
35  step = stepALCAPRODUCER(args['skims'])
36  options = Options()
37  options.__dict__.update(defaultOptions.__dict__)
38  options.scenario = "pp"
39  options.step = step
40  dictIO(options,args)
41  options.conditions = gtNameAndConnect(globalTag, args)
42 
43  process = cms.Process('RECO', self.eras)
44  cb = ConfigBuilder(options, process = process, with_output = True)
45 
46  # Input source
47  process.source = cms.Source("PoolSource",
48  fileNames = cms.untracked.vstring()
49  )
50  cb.prepare()
51 
52  return process
53 
54  def alcaSkim(self, skims, **args):
55  """
56  _alcaSkim_
57 
58  AlcaReco processing & skims for proton collisions
59 
60  """
61  step = ""
62  pclWflws = [x for x in skims if "PromptCalibProd" in x]
63  skims = filter(lambda x: x not in pclWflws, skims)
64 
65  if len(pclWflws):
66  step += 'ALCA:'+('+'.join(pclWflws))
67 
68  if len(skims) > 0:
69  if step != "":
70  step += ","
71  step += "ALCAOUTPUT:"+('+'.join(skims))
72 
73  options = Options()
74  options.__dict__.update(defaultOptions.__dict__)
75  options.scenario = "pp"
76  options.step = step
77  options.conditions = args['globaltag'] if 'globaltag' in args else 'None'
78  if 'globalTagConnect' in args and args['globalTagConnect'] != '':
79  options.conditions += ','+args['globalTagConnect']
80 
81  options.triggerResultsProcess = 'RECO'
82 
83  process = cms.Process('ALCA', self.eras)
84  cb = ConfigBuilder(options, process=process)
85 
86  # Input source
87  process.source = cms.Source(
88  "PoolSource",
89  fileNames=cms.untracked.vstring()
90  )
91 
92  cb.prepare()
93 
94  # FIXME: dirty hack..any way around this?
95  # Tier0 needs the dataset used for ALCAHARVEST step to be a different data-tier
96  for wfl in pclWflws:
97  methodToCall = getattr(process, 'ALCARECOStream'+wfl)
98  methodToCall.dataset.dataTier = cms.untracked.string('ALCAPROMPT')
99 
100  return process
101 
102 
103  def dqmHarvesting(self, datasetName, runNumber, globalTag, **args):
104  """
105  _dqmHarvesting_
106 
107  Proton collisions data taking DQM Harvesting
108 
109  """
110  options = defaultOptions
111  options.scenario = "pp"
112  options.step = "HARVESTING:alcaHarvesting"
113  options.name = "EDMtoMEConvert"
114  options.conditions = gtNameAndConnect(globalTag, args)
115 
116  process = cms.Process("HARVESTING", self.eras)
117  process.source = dqmIOSource(args)
118  configBuilder = ConfigBuilder(options, process = process)
119  configBuilder.prepare()
120 
121  #
122  # customise process for particular job
123  #
124  #process.source.processingMode = cms.untracked.string('RunsAndLumis')
125  #process.source.fileNames = cms.untracked(cms.vstring())
126  #process.maxEvents.input = -1
127  #process.dqmSaver.workflow = datasetName
128  #process.dqmSaver.saveByLumiSection = 1
129  #if args.has_key('referenceFile') and args.get('referenceFile', ''):
130  # process.DQMStore.referenceFileName = \
131  # cms.untracked.string(args['referenceFile'])
132  harvestingMode(process,datasetName,args)
133 
134  return process
def harvestingMode(process, datasetName, args, rANDl=True)
Definition: Utils.py:114
def gtNameAndConnect(globalTag, args)
Definition: Utils.py:137
def dqmHarvesting(self, datasetName, runNumber, globalTag, args)
Definition: AlCa.py:103
def dictIO(options, args)
Definition: Utils.py:123
def skimsIfNotGiven(self, args, sl)
Definition: AlCa.py:28
def promptReco(self, globalTag, args)
Definition: AlCa.py:32
def alcaSkim(self, skims, args)
Definition: AlCa.py:54
def stepALCAPRODUCER(skims)
Definition: Utils.py:9
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def __init__(self)
Definition: AlCa.py:17
def dqmIOSource(args)
Definition: Utils.py:103