CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/Configuration/DataProcessing/python/Impl/HeavyIons.py

Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 """
00003 _HeavyIons_
00004 
00005 Scenario supporting heavy-ion collisions
00006 
00007 """
00008 
00009 import os
00010 import sys
00011 
00012 from Configuration.DataProcessing.Scenario import Scenario
00013 from Configuration.DataProcessing.Utils import stepALCAPRODUCER,addMonitoring,dictIO,dqmIOSource
00014 import FWCore.ParameterSet.Config as cms
00015 from Configuration.PyReleaseValidation.ConfigBuilder import ConfigBuilder
00016 from Configuration.PyReleaseValidation.ConfigBuilder import Options
00017 from Configuration.PyReleaseValidation.ConfigBuilder import defaultOptions
00018 from Configuration.PyReleaseValidation.ConfigBuilder import installFilteredStream
00019 from Configuration.PyReleaseValidation.ConfigBuilder import addOutputModule
00020 from Configuration.DataProcessing.RecoTLR import customisePromptHI,customiseExpressHI
00021 
00022 class HeavyIons(Scenario):
00023     """
00024     _HeavyIons_
00025 
00026     Implement configuration building for data processing for 
00027     heavy-ion collision data taking
00028 
00029     """
00030 
00031 
00032     def promptReco(self, globalTag, **args):
00033         """
00034         _promptReco_
00035 
00036         Heavy-ion collision data taking prompt reco
00037 
00038         """
00039 
00040         skims = ['SiStripCalZeroBias',
00041                  'SiStripCalMinBias',
00042                  'TkAlMinBiasHI',
00043                  'HcalCalMinBias',
00044                  'DtCalibHI']
00045         step = stepALCAPRODUCER(skims)
00046         options = Options()
00047         options.__dict__.update(defaultOptions.__dict__)
00048         options.scenario = "HeavyIons"
00049         options.step = 'RAW2DIGI,L1Reco,RECO'+step+',DQM,ENDJOB'
00050         options.isRepacked = True
00051         dictIO(options,args)
00052         options.conditions = globalTag
00053         
00054         process = cms.Process('RECO')
00055         cb = ConfigBuilder(options, process = process, with_output=True)
00056 
00057         # Input source
00058         process.source = cms.Source("PoolSource",
00059             fileNames = cms.untracked.vstring()
00060         )
00061         cb.prepare()
00062 
00063         customisePromptHI(process)
00064         addMonitoring(process)
00065         
00066         return process
00067 
00068 
00069     def expressProcessing(self, globalTag, **args):
00070         """
00071         _expressProcessing_
00072 
00073         Heavy-ion collision data taking express processing
00074 
00075         """
00076 
00077         skims = ['SiStripCalZeroBias',
00078                  'TkAlMinBiasHI']
00079         step = stepALCAPRODUCER(skims)
00080         options = Options()
00081         options.__dict__.update(defaultOptions.__dict__)
00082         options.scenario = "HeavyIons"
00083         options.step = 'RAW2DIGI,L1Reco,RECO'+step+',DQM,ENDJOB'
00084         options.isRepacked = True
00085         dictIO(options,args)
00086         options.conditions = globalTag
00087         
00088         process = cms.Process('RECO')
00089         cb = ConfigBuilder(options, process = process, with_output=True)
00090 
00091         # Input source
00092         process.source = cms.Source("NewEventStreamFileReader",
00093             fileNames = cms.untracked.vstring()
00094         )
00095         cb.prepare() 
00096 
00097         customiseExpressHI(process)
00098         addMonitoring(process)
00099         
00100         return process
00101 
00102 
00103     def alcaSkim(self, skims, **args):
00104         """
00105         _alcaSkim_
00106 
00107         AlcaReco processing & skims for heavy-ion collisions
00108 
00109         """
00110 
00111         globalTag = None
00112         if 'globaltag' in args:
00113             globalTag = args['globaltag']
00114 
00115         step = ""
00116         if 'PromptCalibProd' in skims:
00117             step = "ALCA:PromptCalibProd" 
00118             skims.remove('PromptCalibProd')
00119         
00120         if len( skims ) > 0:
00121             if step != "":
00122                 step += ","
00123             step += "ALCAOUTPUT:"
00124                 
00125         for skim in skims:
00126           step += (skim+"+")
00127         options = Options()
00128         options.__dict__.update(defaultOptions.__dict__)
00129         options.scenario = "HeavyIons"
00130         options.step = step.rstrip('+')
00131         options.isMC = False
00132         options.isData = True
00133         options.beamspot = None
00134         options.eventcontent = None
00135         options.relval = None
00136         if globalTag != None :
00137             options.conditions = "FrontierConditions_GlobalTag,%s" % globalTag
00138         options.triggerResultsProcess = 'RECO'
00139         
00140         process = cms.Process('ALCA')
00141         cb = ConfigBuilder(options, process = process)
00142 
00143         # Input source
00144         process.source = cms.Source(
00145            "PoolSource",
00146            fileNames = cms.untracked.vstring()
00147         )
00148 
00149         cb.prepare() 
00150 
00151         # FIXME: dirty hack..any way around this?
00152         # Tier0 needs the dataset used for ALCAHARVEST step to be a different data-tier
00153         if 'PromptCalibProd' in step:
00154             process.ALCARECOStreamPromptCalibProd.dataset.dataTier = cms.untracked.string('ALCAPROMPT')
00155 
00156         return process
00157 
00158 
00159     def dqmHarvesting(self, datasetName, runNumber, globalTag, **args):
00160         """
00161         _dqmHarvesting_
00162 
00163         Heavy-ion collisions data taking DQM Harvesting
00164 
00165         """
00166         options = defaultOptions
00167         options.scenario = "HeavyIons"
00168         options.step = "HARVESTING:dqmHarvesting"
00169         options.isMC = False
00170         options.isData = True
00171         options.beamspot = None
00172         options.eventcontent = None
00173         options.name = "EDMtoMEConvert"
00174         options.conditions = "FrontierConditions_GlobalTag,%s" % globalTag
00175         options.arguments = ""
00176         options.evt_type = ""
00177         options.filein = []
00178  
00179         process = cms.Process("HARVESTING")
00180         if args.get('newDQMIO', False):
00181             process.source = cms.Source("DQMRootSource")
00182         else:
00183             process.source = cms.Source("PoolSource")
00184         configBuilder = ConfigBuilder(options, process = process)
00185         configBuilder.prepare()
00186 
00187         #
00188         # customise process for particular job
00189         #
00190         process.source.processingMode = cms.untracked.string('RunsAndLumis')
00191         process.source.fileNames = cms.untracked(cms.vstring())
00192         process.maxEvents.input = -1
00193         process.dqmSaver.workflow = datasetName
00194         process.dqmSaver.saveByLumiSection = 1
00195         if args.has_key('referenceFile') and args.get('referenceFile', ''):
00196             process.DQMStore.referenceFileName = \
00197                                 cms.untracked.string(args['referenceFile'])
00198 
00199         return process
00200 
00201 
00202     def alcaHarvesting(self, globalTag, datasetName, **args):
00203         """
00204         _alcaHarvesting_
00205 
00206         Heavy-ion collisions data taking AlCa Harvesting
00207 
00208         """
00209         options = defaultOptions
00210         options.scenario = "HeavyIons"
00211         options.step = "ALCAHARVEST:BeamSpotByRun+BeamSpotByLumi"
00212         options.isMC = False
00213         options.isData = True
00214         options.beamspot = None
00215         options.eventcontent = None
00216         options.name = "ALCAHARVEST"
00217         options.conditions = globalTag
00218         options.arguments = ""
00219         options.evt_type = ""
00220         options.filein = []
00221  
00222         process = cms.Process("ALCAHARVEST")
00223         process.source = cms.Source("PoolSource")
00224         configBuilder = ConfigBuilder(options, process = process)
00225         configBuilder.prepare()
00226 
00227         #
00228         # customise process for particular job
00229         #
00230         process.source.processingMode = cms.untracked.string('RunsAndLumis')
00231         process.source.fileNames = cms.untracked(cms.vstring())
00232         process.maxEvents.input = -1
00233         process.dqmSaver.workflow = datasetName
00234         
00235         return process
00236