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  options.filein = 'tobeoverwritten.xyz'
75  if 'inputSource' in args:
76  options.fileType = args['inputSource']
77  process = cms.Process('RECO')
78  cb = ConfigBuilder(options, process = process, with_output = True, with_input = True)
79 
80  cb.prepare()
81 
82  addMonitoring(process)
83 
84  return process
85 
86 
87  def alcaSkim(self, skims, **args):
88  """
89  _alcaSkim_
90 
91  AlcaReco processing & skims for proton collisions
92 
93  """
94 
95  step = ""
96  if 'PromptCalibProd' in skims:
97  step = "ALCA:PromptCalibProd"
98  skims.remove('PromptCalibProd')
99 
100  if len( skims ) > 0:
101  if step != "":
102  step += ","
103  step += "ALCAOUTPUT:"+('+'.join(skims))
104 
105  options = Options()
106  options.__dict__.update(defaultOptions.__dict__)
107  options.scenario = self.cbSc
108  options.step = step
109  options.conditions = args['globaltag'] if 'globaltag' in args else 'None'
110  options.triggerResultsProcess = 'RECO'
111 
112  process = cms.Process('ALCA')
113  cb = ConfigBuilder(options, process = process)
114 
115  # Input source
116  process.source = cms.Source(
117  "PoolSource",
118  fileNames = cms.untracked.vstring()
119  )
120 
121  cb.prepare()
122 
123  # FIXME: dirty hack..any way around this?
124  # Tier0 needs the dataset used for ALCAHARVEST step to be a different data-tier
125  if 'PromptCalibProd' in step:
126  process.ALCARECOStreamPromptCalibProd.dataset.dataTier = cms.untracked.string('ALCAPROMPT')
127 
128  return process
129 
130 
131  def dqmHarvesting(self, datasetName, runNumber, globalTag, **args):
132  """
133  _dqmHarvesting_
134 
135  Proton collisions data taking DQM Harvesting
136 
137  """
138  options = defaultOptions
139  options.scenario = self.cbSc
140  options.step = "HARVESTING"+dqmSeq(args,':dqmHarvesting')
141  options.name = "EDMtoMEConvert"
142  options.conditions = globalTag
143 
144  process = cms.Process("HARVESTING")
145  process.source = dqmIOSource(args)
146  configBuilder = ConfigBuilder(options, process = process)
147  configBuilder.prepare()
148 
149  harvestingMode(process,datasetName,args,rANDl=False)
150  return process
151 
152 
153  def alcaHarvesting(self, globalTag, datasetName, **args):
154  """
155  _alcaHarvesting_
156 
157  Proton collisions data taking AlCa Harvesting
158 
159  """
160  if not 'skims' in args: return None
161  options = defaultOptions
162  options.scenario = self.cbSc if hasattr(self,'cbSc') else self.__class__.__name__
163  options.step = "ALCAHARVEST:"+('+'.join(args['skims']))
164  options.name = "ALCAHARVEST"
165  options.conditions = globalTag
166 
167  process = cms.Process("ALCAHARVEST")
168  process.source = cms.Source("PoolSource")
169  configBuilder = ConfigBuilder(options, process = process)
170  configBuilder.prepare()
171 
172  #
173  # customise process for particular job
174  #
175  process.source.processingMode = cms.untracked.string('RunsAndLumis')
176  process.source.fileNames = cms.untracked(cms.vstring())
177  process.maxEvents.input = -1
178  process.dqmSaver.workflow = datasetName
179 
180  return process
181 
182  def skimming(self, skims, globalTag,**options):
183  """
184  _skimming_
185 
186  skimming method overload for the prompt skiming
187 
188  """
189  options = defaultOptions
190  options.scenario = self.cbSc if hasattr(self,'cbSc') else self.__class__.__name__
191  options.step = "SKIM:"+('+'.join(skims))
192  options.name = "SKIM"
193  options.conditions = globalTag
194  process = cms.Process("SKIM")
195  process.source = cms.Source("PoolSource")
196  configBuilder = ConfigBuilder(options, process = process)
197  configBuilder.prepare()
198 
199  return process
200 
201  """
202  def repack(self, **args):
203  options = defaultOptions
204  dictIO(options,args)
205  options.filein='file.dat'
206  options.filetype='DAT'
207  options.scenario = self.cbSc if hasattr(self,'cbSc') else self.__class__.__name__
208  process = cms.Process('REPACK')
209  cb = ConfigBuilder(options, process = process, with_output = True,with_input=True)
210  cb.prepare()
211  print cb.pythonCfgCode
212  return process
213  """
def alcaHarvesting
Definition: Reco.py:153
def dqmSeq
Definition: Utils.py:116
def stepALCAPRODUCER
Definition: Utils.py:9
def skimming
Definition: Reco.py:182
def addMonitoring
Definition: Utils.py:23
def __init__
Definition: Reco.py:18
def dqmHarvesting
Definition: Reco.py:131
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:87
recoSeq
Definition: Reco.py:19
cbSc
Definition: Reco.py:20
def expressProcessing
Definition: Reco.py:59