CMS 3D CMS Logo

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