CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
pp.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
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 pp(Scenario):
22  """
23  _pp_
24 
25  Implement configuration building for data processing for proton
26  collision data taking
27 
28  """
29 
30 
31  def promptReco(self, globalTag, writeTiers = ['RECO'], **args):
32  """
33  _promptReco_
34 
35  Proton collision data taking prompt reco
36 
37  """
38 
39  skims = ['TkAlMinBias',
40  'TkAlMuonIsolated',
41  'MuAlCalIsolatedMu',
42  'MuAlOverlaps',
43  'HcalCalIsoTrk',
44  'HcalCalDijets',
45  'SiStripCalMinBias',
46  'EcalCalElectron',
47  'DtCalib',
48  'TkAlJpsiMuMu',
49  'TkAlUpsilonMuMu',
50  'TkAlZMuMu']
51  step = stepALCAPRODUCER(skims)
52  options = Options()
53  options.__dict__.update(defaultOptions.__dict__)
54  options.scenario = "pp"
55  options.step = 'RAW2DIGI,L1Reco,RECO'+step+',L1HwVal,DQM,ENDJOB'
56  options.isMC = False
57  options.isData = True
58  options.beamspot = None
59  options.eventcontent = ','.join(writeTiers)
60  options.datatier = ','.join(writeTiers)
61  options.magField = 'AutoFromDBCurrent'
62  options.conditions = "FrontierConditions_GlobalTag,%s" % globalTag
63  options.relval = False
64 
65  process = cms.Process('RECO')
66  cb = ConfigBuilder(options, process = process, with_output = True)
67 
68  # Input source
69  process.source = cms.Source("PoolSource",
70  fileNames = cms.untracked.vstring()
71  )
72  cb.prepare()
73 
74  #add the former top level patches here
75  customisePrompt(process)
76  addMonitoring(process)
77 
78  return process
79 
80 
81  def expressProcessing(self, globalTag, writeTiers = [], **args):
82  """
83  _expressProcessing_
84 
85  Proton collision data taking express processing
86 
87  """
88 
89  skims = ['SiStripCalZeroBias',
90  'TkAlMinBias',
91  'DtCalib',
92  'MuAlCalIsolatedMu',
93  'SiStripPCLHistos']
94  step = stepALCAPRODUCER(skims)
95  options = Options()
96  options.__dict__.update(defaultOptions.__dict__)
97  options.scenario = "pp"
98  options.step = 'RAW2DIGI,L1Reco,RECO'+step+',L1HwVal,DQM,ENDJOB'
99  options.isMC = False
100  options.isData = True
101  options.beamspot = None
102  options.eventcontent = ','.join(writeTiers)
103  options.datatier = ','.join(writeTiers)
104  options.magField = 'AutoFromDBCurrent'
105  options.conditions = "FrontierConditions_GlobalTag,%s" % globalTag
106  options.relval = False
107 
108  process = cms.Process('RECO')
109  cb = ConfigBuilder(options, process = process, with_output = True)
110 
111  # Input source
112  process.source = cms.Source("NewEventStreamFileReader",
113  fileNames = cms.untracked.vstring()
114  )
115  cb.prepare()
116 
117  #add the former top level patches here
118  customiseExpress(process)
119  addMonitoring(process)
120 
121  return process
122 
123 
124  def alcaSkim(self, skims, **args):
125  """
126  _alcaSkim_
127 
128  AlcaReco processing & skims for proton collisions
129 
130  """
131 
132  globalTag = None
133  if 'globaltag' in args:
134  globalTag = args['globaltag']
135 
136  step = ""
137  if 'PromptCalibProd' in skims:
138  step = "ALCA:PromptCalibProd"
139  skims.remove('PromptCalibProd')
140 
141  if len( skims ) > 0:
142  if step != "":
143  step += ","
144  step += "ALCAOUTPUT:"
145 
146  for skim in skims:
147  step += (skim+"+")
148  options = Options()
149  options.__dict__.update(defaultOptions.__dict__)
150  options.scenario = "pp"
151  options.step = step.rstrip('+')
152  options.isMC = False
153  options.isData = True
154  options.beamspot = None
155  options.eventcontent = None
156  options.relval = None
157  if globalTag != None :
158  options.conditions = "FrontierConditions_GlobalTag,%s" % globalTag
159  options.triggerResultsProcess = 'RECO'
160 
161  process = cms.Process('ALCA')
162  cb = ConfigBuilder(options, process = process)
163 
164  # Input source
165  process.source = cms.Source(
166  "PoolSource",
167  fileNames = cms.untracked.vstring()
168  )
169 
170  cb.prepare()
171 
172  # FIXME: dirty hack..any way around this?
173  # Tier0 needs the dataset used for ALCAHARVEST step to be a different data-tier
174  if 'PromptCalibProd' in step:
175  process.ALCARECOStreamPromptCalibProd.dataset.dataTier = cms.untracked.string('ALCAPROMPT')
176 
177  return process
178 
179 
180  def dqmHarvesting(self, datasetName, runNumber, globalTag, **args):
181  """
182  _dqmHarvesting_
183 
184  Proton collisions data taking DQM Harvesting
185 
186  """
187  options = defaultOptions
188  options.scenario = "pp"
189  options.step = "HARVESTING:dqmHarvesting"
190  options.isMC = False
191  options.isData = True
192  options.beamspot = None
193  options.eventcontent = None
194  options.name = "EDMtoMEConvert"
195  options.conditions = "FrontierConditions_GlobalTag,%s" % globalTag
196  options.arguments = ""
197  options.evt_type = ""
198  options.filein = []
199 
200  process = cms.Process("HARVESTING")
201  process.source = cms.Source("PoolSource")
202  configBuilder = ConfigBuilder(options, process = process)
203  configBuilder.prepare()
204 
205  #
206  # customise process for particular job
207  #
208  process.source.processingMode = cms.untracked.string('RunsAndLumis')
209  process.source.fileNames = cms.untracked(cms.vstring())
210  process.maxEvents.input = -1
211  process.dqmSaver.workflow = datasetName
212  process.dqmSaver.saveByLumiSection = 1
213  if args.has_key('referenceFile') and args.get('referenceFile', ''):
214  process.DQMStore.referenceFileName = \
215  cms.untracked.string(args['referenceFile'])
216 
217  return process
218 
219 
220  def alcaHarvesting(self, globalTag, datasetName, **args):
221  """
222  _alcaHarvesting_
223 
224  Proton collisions data taking AlCa Harvesting
225 
226  """
227  options = defaultOptions
228  options.scenario = "pp"
229  options.step = "ALCAHARVEST:BeamSpotByRun+BeamSpotByLumi+SiStripQuality"
230  options.isMC = False
231  options.isData = True
232  options.beamspot = None
233  options.eventcontent = None
234  options.name = "ALCAHARVEST"
235  options.conditions = globalTag
236  options.arguments = ""
237  options.evt_type = ""
238  options.filein = []
239 
240  process = cms.Process("ALCAHARVEST")
241  process.source = cms.Source("PoolSource")
242  configBuilder = ConfigBuilder(options, process = process)
243  configBuilder.prepare()
244 
245  #
246  # customise process for particular job
247  #
248  process.source.processingMode = cms.untracked.string('RunsAndLumis')
249  process.source.fileNames = cms.untracked(cms.vstring())
250  process.maxEvents.input = -1
251  process.dqmSaver.workflow = datasetName
252 
253  return process
254 
def alcaSkim
Definition: pp.py:124
def promptReco
Definition: pp.py:31
def stepALCAPRODUCER
Definition: Utils.py:9
def addMonitoring
Definition: Utils.py:26
Definition: pp.py:21
def expressProcessing
Definition: pp.py:81
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def customisePrompt
Definition: RecoTLR.py:74
def dqmHarvesting
Definition: pp.py:180
def alcaHarvesting
Definition: pp.py:220
def customiseExpress
Definition: RecoTLR.py:69