00001
00002 """
00003 _pp_
00004
00005 Scenario supporting proton 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,harvestingMode,dqmSeq
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 customisePrompt,customiseExpress
00020
00021 class Reco(Scenario):
00022 def __init__(self):
00023 self.recoSeq=''
00024 self.cbSc=self.__class__.__name__
00025 """
00026 _pp_
00027
00028 Implement configuration building for data processing for proton
00029 collision data taking
00030
00031 """
00032
00033 def promptReco(self, globalTag, **args):
00034 """
00035 _promptReco_
00036
00037 Proton collision data taking prompt reco
00038
00039 """
00040 step = stepALCAPRODUCER(args['skims'])
00041 dqmStep= dqmSeq(args,'')
00042 options = Options()
00043 options.__dict__.update(defaultOptions.__dict__)
00044 options.scenario = self.cbSc
00045 options.step = 'RAW2DIGI,L1Reco,RECO'+self.recoSeq+step+',DQM'+dqmStep+',ENDJOB'
00046 dictIO(options,args)
00047 options.conditions = globalTag
00048
00049 process = cms.Process('RECO')
00050 cb = ConfigBuilder(options, process = process, with_output = True)
00051
00052
00053 process.source = cms.Source("PoolSource",
00054 fileNames = cms.untracked.vstring()
00055 )
00056 cb.prepare()
00057
00058 addMonitoring(process)
00059
00060 return process
00061
00062
00063 def expressProcessing(self, globalTag, **args):
00064 """
00065 _expressProcessing_
00066
00067 Proton collision data taking express processing
00068
00069 """
00070 step = stepALCAPRODUCER(args['skims'])
00071 dqmStep= dqmSeq(args,'')
00072 options = Options()
00073 options.__dict__.update(defaultOptions.__dict__)
00074 options.scenario = self.cbSc
00075 options.step = 'RAW2DIGI,L1Reco,RECO'+step+',DQM'+dqmStep+',ENDJOB'
00076 dictIO(options,args)
00077 options.conditions = globalTag
00078
00079 process = cms.Process('RECO')
00080 cb = ConfigBuilder(options, process = process, with_output = True)
00081
00082
00083 process.source = cms.Source("NewEventStreamFileReader",
00084 fileNames = cms.untracked.vstring()
00085 )
00086 cb.prepare()
00087
00088 addMonitoring(process)
00089
00090 return process
00091
00092
00093 def alcaSkim(self, skims, **args):
00094 """
00095 _alcaSkim_
00096
00097 AlcaReco processing & skims for proton collisions
00098
00099 """
00100
00101 step = ""
00102 if 'PromptCalibProd' in skims:
00103 step = "ALCA:PromptCalibProd"
00104 skims.remove('PromptCalibProd')
00105
00106 if len( skims ) > 0:
00107 if step != "":
00108 step += ","
00109 step += "ALCAOUTPUT:"+('+'.join(skims))
00110
00111 options = Options()
00112 options.__dict__.update(defaultOptions.__dict__)
00113 options.scenario = self.cbSc
00114 options.step = step
00115 options.conditions = args['globaltag'] if 'globaltag' in args else 'None'
00116 options.triggerResultsProcess = 'RECO'
00117
00118 process = cms.Process('ALCA')
00119 cb = ConfigBuilder(options, process = process)
00120
00121
00122 process.source = cms.Source(
00123 "PoolSource",
00124 fileNames = cms.untracked.vstring()
00125 )
00126
00127 cb.prepare()
00128
00129
00130
00131 if 'PromptCalibProd' in step:
00132 process.ALCARECOStreamPromptCalibProd.dataset.dataTier = cms.untracked.string('ALCAPROMPT')
00133
00134 return process
00135
00136
00137 def dqmHarvesting(self, datasetName, runNumber, globalTag, **args):
00138 """
00139 _dqmHarvesting_
00140
00141 Proton collisions data taking DQM Harvesting
00142
00143 """
00144 options = defaultOptions
00145 options.scenario = self.cbSc
00146 options.step = "HARVESTING"+dqmSeq(args,':dqmHarvesting')
00147 options.name = "EDMtoMEConvert"
00148 options.conditions = globalTag
00149
00150 process = cms.Process("HARVESTING")
00151 process.source = dqmIOSource(args)
00152 configBuilder = ConfigBuilder(options, process = process)
00153 configBuilder.prepare()
00154
00155 harvestingMode(process,datasetName,args,rANDl=True)
00156 return process
00157
00158
00159 def alcaHarvesting(self, globalTag, datasetName, **args):
00160 """
00161 _alcaHarvesting_
00162
00163 Proton collisions data taking AlCa Harvesting
00164
00165 """
00166 if not 'skims' in args: return None
00167 options = defaultOptions
00168 options.scenario = self.cbSc if hasattr(self,'cbSc') else self.__class__.__name__
00169 options.step = "ALCAHARVEST:"+('+'.join(args['skims']))
00170 options.name = "ALCAHARVEST"
00171 options.conditions = globalTag
00172
00173 process = cms.Process("ALCAHARVEST")
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
00186 return process
00187
00188 """
00189 def repack(self, **args):
00190 options = defaultOptions
00191 dictIO(options,args)
00192 options.filein='file.dat'
00193 options.filetype='DAT'
00194 options.scenario = self.cbSc if hasattr(self,'cbSc') else self.__class__.__name__
00195 process = cms.Process('REPACK')
00196 cb = ConfigBuilder(options, process = process, with_output = True,with_input=True)
00197 cb.prepare()
00198 print cb.pythonCfgCode
00199 return process
00200 """