CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Reco.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 """
3 _pp_
4 
5 Scenario supporting proton collisions
6 
7 """
8 
9 import os
10 import sys
11 
12 from Configuration.DataProcessing.Scenario import Scenario
13 from Configuration.DataProcessing.Utils import stepALCAPRODUCER,addMonitoring,dictIO,dqmIOSource,harvestingMode,dqmSeq
14 import FWCore.ParameterSet.Config as cms
15 from Configuration.PyReleaseValidation.ConfigBuilder import ConfigBuilder
16 from Configuration.PyReleaseValidation.ConfigBuilder import Options
17 from Configuration.PyReleaseValidation.ConfigBuilder import defaultOptions
18 from Configuration.PyReleaseValidation.ConfigBuilder import installFilteredStream
19 from Configuration.DataProcessing.RecoTLR import customisePrompt,customiseExpress
20 
21 class Reco(Scenario):
22  def __init__(self):
23  self.recoSeq=''
24  self.cbSc=self.__class__.__name__
25  """
26  _pp_
27 
28  Implement configuration building for data processing for proton
29  collision data taking
30 
31  """
32 
33  def promptReco(self, globalTag, **args):
34  """
35  _promptReco_
36 
37  Proton collision data taking prompt reco
38 
39  """
40  step = stepALCAPRODUCER(args['skims'])
41  dqmStep= dqmSeq(args,'')
42  options = Options()
43  options.__dict__.update(defaultOptions.__dict__)
44  options.scenario = self.cbSc
45  options.step = 'RAW2DIGI,L1Reco,RECO'+self.recoSeq+step+',DQM'+dqmStep+',ENDJOB'
46  dictIO(options,args)
47  options.conditions = 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  addMonitoring(process)
59 
60  return process
61 
62 
63  def expressProcessing(self, globalTag, **args):
64  """
65  _expressProcessing_
66 
67  Proton collision data taking express processing
68 
69  """
70  step = stepALCAPRODUCER(args['skims'])
71  dqmStep= dqmSeq(args,'')
72  options = Options()
73  options.__dict__.update(defaultOptions.__dict__)
74  options.scenario = self.cbSc
75  options.step = 'RAW2DIGI,L1Reco,RECO'+step+',DQM'+dqmStep+',ENDJOB'
76  dictIO(options,args)
77  options.conditions = globalTag
78  options.filein = 'tobeoverwritten.xyz'
79  if 'inputSource' in args:
80  options.filetype = args['inputSource']
81  process = cms.Process('RECO')
82  cb = ConfigBuilder(options, process = process, with_output = True, with_input = True)
83 
84  cb.prepare()
85 
86  addMonitoring(process)
87 
88  return process
89 
90 
91  def alcaSkim(self, skims, **args):
92  """
93  _alcaSkim_
94 
95  AlcaReco processing & skims for proton collisions
96 
97  """
98 
99  step = ""
100  if 'PromptCalibProd' in skims:
101  step = "ALCA:PromptCalibProd"
102  skims.remove('PromptCalibProd')
103 
104  if len( skims ) > 0:
105  if step != "":
106  step += ","
107  step += "ALCAOUTPUT:"+('+'.join(skims))
108 
109  options = Options()
110  options.__dict__.update(defaultOptions.__dict__)
111  options.scenario = self.cbSc
112  options.step = step
113  options.conditions = args['globaltag'] if 'globaltag' in args else 'None'
114  options.triggerResultsProcess = 'RECO'
115 
116  process = cms.Process('ALCA')
117  cb = ConfigBuilder(options, process = process)
118 
119  # Input source
120  process.source = cms.Source(
121  "PoolSource",
122  fileNames = cms.untracked.vstring()
123  )
124 
125  cb.prepare()
126 
127  # FIXME: dirty hack..any way around this?
128  # Tier0 needs the dataset used for ALCAHARVEST step to be a different data-tier
129  if 'PromptCalibProd' in step:
130  process.ALCARECOStreamPromptCalibProd.dataset.dataTier = cms.untracked.string('ALCAPROMPT')
131 
132  return process
133 
134 
135  def dqmHarvesting(self, datasetName, runNumber, globalTag, **args):
136  """
137  _dqmHarvesting_
138 
139  Proton collisions data taking DQM Harvesting
140 
141  """
142  options = defaultOptions
143  options.scenario = self.cbSc
144  options.step = "HARVESTING"+dqmSeq(args,':dqmHarvesting')
145  options.name = "EDMtoMEConvert"
146  options.conditions = globalTag
147 
148  process = cms.Process("HARVESTING")
149  process.source = dqmIOSource(args)
150  configBuilder = ConfigBuilder(options, process = process)
151  configBuilder.prepare()
152 
153  harvestingMode(process,datasetName,args,rANDl=True)
154  return process
155 
156 
157  def alcaHarvesting(self, globalTag, datasetName, **args):
158  """
159  _alcaHarvesting_
160 
161  Proton collisions data taking AlCa Harvesting
162 
163  """
164  if not 'skims' in args: return None
165  options = defaultOptions
166  options.scenario = self.cbSc if hasattr(self,'cbSc') else self.__class__.__name__
167  options.step = "ALCAHARVEST:"+('+'.join(args['skims']))
168  options.name = "ALCAHARVEST"
169  options.conditions = globalTag
170 
171  process = cms.Process("ALCAHARVEST")
172  process.source = cms.Source("PoolSource")
173  configBuilder = ConfigBuilder(options, process = process)
174  configBuilder.prepare()
175 
176  #
177  # customise process for particular job
178  #
179  process.source.processingMode = cms.untracked.string('RunsAndLumis')
180  process.source.fileNames = cms.untracked(cms.vstring())
181  process.maxEvents.input = -1
182  process.dqmSaver.workflow = datasetName
183 
184  return process
185 
186  """
187  def repack(self, **args):
188  options = defaultOptions
189  dictIO(options,args)
190  options.filein='file.dat'
191  options.filetype='DAT'
192  options.scenario = self.cbSc if hasattr(self,'cbSc') else self.__class__.__name__
193  process = cms.Process('REPACK')
194  cb = ConfigBuilder(options, process = process, with_output = True,with_input=True)
195  cb.prepare()
196  print cb.pythonCfgCode
197  return process
198  """
def alcaHarvesting
Definition: Reco.py:157
def dqmSeq
Definition: Utils.py:116
def stepALCAPRODUCER
Definition: Utils.py:9
def addMonitoring
Definition: Utils.py:23
def __init__
Definition: Reco.py:22
def dqmHarvesting
Definition: Reco.py:135
def promptReco
Definition: Reco.py:33
def dqmIOSource
Definition: Utils.py:88
def dictIO
Definition: Utils.py:108
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def harvestingMode
Definition: Utils.py:99
def alcaSkim
Definition: Reco.py:91
recoSeq
Definition: Reco.py:23
cbSc
Definition: Reco.py:24
def expressProcessing
Definition: Reco.py:63