00001
00002 """
00003 _cosmics_
00004
00005 Scenario supporting cosmic data taking
00006
00007 """
00008
00009 import os
00010 import sys
00011
00012 from Configuration.DataProcessing.Scenario import Scenario
00013 from Configuration.DataProcessing.Utils import stepALCAPRODUCER
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.DataProcessing.RecoTLR import customiseCosmicData
00020
00021 class cosmics(Scenario):
00022 """
00023 _cosmics_
00024
00025 Implement configuration building for data processing for cosmic
00026 data taking
00027
00028 """
00029
00030
00031 def promptReco(self, globalTag, writeTiers = ['RECO'], **args):
00032 """
00033 _promptReco_
00034
00035 Cosmic data taking prompt reco
00036
00037 """
00038
00039 skims = ['TkAlBeamHalo',
00040 'MuAlBeamHaloOverlaps',
00041 'MuAlBeamHalo',
00042 'TkAlCosmics0T',
00043 'MuAlGlobalCosmics',
00044 'MuAlCalIsolatedMu',
00045 'HcalCalHOCosmics',
00046 'DtCalib']
00047 step = stepALCAPRODUCER(skims)
00048 options = Options()
00049 options.__dict__.update(defaultOptions.__dict__)
00050 options.scenario = "cosmics"
00051 options.step = 'RAW2DIGI,L1Reco,RECO'+step+',L1HwVal,DQM,ENDJOB'
00052 options.isMC = False
00053 options.isData = True
00054 options.beamspot = None
00055 options.eventcontent = ','.join(writeTiers)
00056 options.datatier = ','.join(writeTiers)
00057 options.magField = 'AutoFromDBCurrent'
00058 options.conditions = "FrontierConditions_GlobalTag,%s" % globalTag
00059 options.relval = False
00060
00061 process = cms.Process('RECO')
00062 cb = ConfigBuilder(options, process = process, with_output = True)
00063
00064
00065 process.source = cms.Source("PoolSource",
00066 fileNames = cms.untracked.vstring()
00067 )
00068 cb.prepare()
00069
00070 customiseCosmicData(process)
00071 return process
00072
00073
00074 def expressProcessing(self, globalTag, writeTiers = [], **args):
00075 """
00076 _expressProcessing_
00077
00078 Cosmic data taking express processing
00079
00080 """
00081
00082 skims = ['SiStripCalZeroBias',
00083 'MuAlCalIsolatedMu']
00084 step = stepALCAPRODUCER(skims)
00085 options = Options()
00086 options.__dict__.update(defaultOptions.__dict__)
00087 options.scenario = "cosmics"
00088 options.step = 'RAW2DIGI,L1Reco,RECO'+step+',L1HwVal,DQM,ENDJOB'
00089 options.isMC = False
00090 options.isData = True
00091 options.beamspot = None
00092 options.eventcontent = ','.join(writeTiers)
00093 options.datatier = ','.join(writeTiers)
00094 options.magField = 'AutoFromDBCurrent'
00095 options.conditions = "FrontierConditions_GlobalTag,%s" % globalTag
00096 options.relval = False
00097
00098 process = cms.Process('RECO')
00099 cb = ConfigBuilder(options, process = process, with_output = True)
00100
00101
00102 process.source = cms.Source("NewEventStreamFileReader",
00103 fileNames = cms.untracked.vstring()
00104 )
00105 cb.prepare()
00106
00107 customiseCosmicData(process)
00108 return process
00109
00110
00111 def alcaSkim(self, skims, **args):
00112 """
00113 _alcaSkim_
00114
00115 AlcaReco processing & skims for cosmics
00116
00117 """
00118
00119 globalTag = None
00120 if 'globaltag' in args:
00121 globalTag = args['globaltag']
00122
00123 step = "ALCAOUTPUT:"
00124 for skim in skims:
00125 step += (skim+"+")
00126 options = Options()
00127 options.__dict__.update(defaultOptions.__dict__)
00128 options.scenario = "cosmics"
00129 options.step = step.rstrip('+')
00130 options.isMC = False
00131 options.isData = True
00132 options.beamspot = None
00133 options.eventcontent = None
00134 options.relval = None
00135 if globalTag != None :
00136 options.conditions = "FrontierConditions_GlobalTag,%s" % globalTag
00137 options.triggerResultsProcess = 'RECO'
00138
00139 process = cms.Process('ALCA')
00140 cb = ConfigBuilder(options, process = process)
00141
00142
00143 process.source = cms.Source(
00144 "PoolSource",
00145 fileNames = cms.untracked.vstring()
00146 )
00147
00148 cb.prepare()
00149
00150 return process
00151
00152
00153 def dqmHarvesting(self, datasetName, runNumber, globalTag, **args):
00154 """
00155 _dqmHarvesting_
00156
00157 Cosmic data taking DQM Harvesting
00158
00159 """
00160 options = defaultOptions
00161 options.scenario = "cosmics"
00162 options.step = "HARVESTING:dqmHarvesting"
00163 options.isMC = False
00164 options.isData = True
00165 options.beamspot = None
00166 options.eventcontent = None
00167 options.name = "EDMtoMEConvert"
00168 options.conditions = "FrontierConditions_GlobalTag,%s" % globalTag
00169 options.arguments = ""
00170 options.evt_type = ""
00171 options.filein = []
00172
00173 process = cms.Process("HARVESTING")
00174 process.source = cms.Source("PoolSource")
00175 configBuilder = ConfigBuilder(options, process = process)
00176 configBuilder.prepare()
00177
00178
00179
00180
00181 process.source.processingMode = cms.untracked.string('RunsAndLumis')
00182 process.source.fileNames = cms.untracked(cms.vstring())
00183 process.maxEvents.input = -1
00184 process.dqmSaver.workflow = datasetName
00185 process.dqmSaver.saveByLumiSection = 1
00186 if args.has_key('referenceFile') and args.get('referenceFile', ''):
00187 process.DQMStore.referenceFileName = \
00188 cms.untracked.string(args['referenceFile'])
00189
00190 return process