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