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