CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/Configuration/DataProcessing/python/Reco.py

Go to the documentation of this file.
00001 #!/usr/bin/env python
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 *
00013 from Configuration.DataProcessing.Utils import stepALCAPRODUCER,addMonitoring,dictIO,dqmIOSource,harvestingMode,dqmSeq
00014 import FWCore.ParameterSet.Config as cms
00015 from Configuration.DataProcessing.RecoTLR import customisePrompt,customiseExpress
00016 
00017 class Reco(Scenario):
00018     def __init__(self):
00019         self.recoSeq=''
00020         self.cbSc=self.__class__.__name__
00021     """
00022     _pp_
00023 
00024     Implement configuration building for data processing for proton
00025     collision data taking
00026 
00027     """
00028 
00029     def promptReco(self, globalTag, **args):
00030         """
00031         _promptReco_
00032 
00033         Proton collision data taking prompt reco
00034 
00035         """
00036         step = stepALCAPRODUCER(args['skims'])
00037         dqmStep= dqmSeq(args,'')
00038         options = Options()
00039         options.__dict__.update(defaultOptions.__dict__)
00040         options.scenario = self.cbSc
00041         options.step = 'RAW2DIGI,L1Reco,RECO'+self.recoSeq+step+',DQM'+dqmStep+',ENDJOB'
00042         dictIO(options,args)
00043         options.conditions = globalTag
00044         
00045         process = cms.Process('RECO')
00046         cb = ConfigBuilder(options, process = process, with_output = True)
00047 
00048         # Input source
00049         process.source = cms.Source("PoolSource",
00050             fileNames = cms.untracked.vstring()
00051         )
00052         cb.prepare()
00053 
00054         addMonitoring(process)
00055         
00056         return process
00057 
00058 
00059     def expressProcessing(self, globalTag, **args):
00060         """
00061         _expressProcessing_
00062 
00063         Proton collision data taking express processing
00064 
00065         """
00066         step = stepALCAPRODUCER(args['skims'])
00067         dqmStep= dqmSeq(args,'')
00068         options = Options()
00069         options.__dict__.update(defaultOptions.__dict__)
00070         options.scenario = self.cbSc
00071         options.step = 'RAW2DIGI,L1Reco,RECO'+step+',DQM'+dqmStep+',ENDJOB'
00072         dictIO(options,args)
00073         options.conditions = globalTag
00074         
00075         process = cms.Process('RECO')
00076         cb = ConfigBuilder(options, process = process, with_output = True)
00077 
00078         # Input source
00079         process.source = cms.Source("NewEventStreamFileReader",
00080             fileNames = cms.untracked.vstring()
00081         )
00082         cb.prepare()
00083 
00084         addMonitoring(process)
00085                 
00086         return process
00087 
00088 
00089     def alcaSkim(self, skims, **args):
00090         """
00091         _alcaSkim_
00092 
00093         AlcaReco processing & skims for proton collisions
00094 
00095         """
00096 
00097         step = ""
00098         if 'PromptCalibProd' in skims:
00099             step = "ALCA:PromptCalibProd" 
00100             skims.remove('PromptCalibProd')
00101         
00102         if len( skims ) > 0:
00103             if step != "":
00104                 step += ","
00105             step += "ALCAOUTPUT:"+('+'.join(skims))
00106                 
00107         options = Options()
00108         options.__dict__.update(defaultOptions.__dict__)
00109         options.scenario = self.cbSc
00110         options.step = step
00111         options.conditions = args['globaltag'] if 'globaltag' in args else 'None'
00112         options.triggerResultsProcess = 'RECO'
00113         
00114         process = cms.Process('ALCA')
00115         cb = ConfigBuilder(options, process = process)
00116 
00117         # Input source
00118         process.source = cms.Source(
00119            "PoolSource",
00120            fileNames = cms.untracked.vstring()
00121         )
00122 
00123         cb.prepare() 
00124 
00125         # FIXME: dirty hack..any way around this?
00126         # Tier0 needs the dataset used for ALCAHARVEST step to be a different data-tier
00127         if 'PromptCalibProd' in step:
00128             process.ALCARECOStreamPromptCalibProd.dataset.dataTier = cms.untracked.string('ALCAPROMPT')
00129 
00130         return process
00131 
00132 
00133     def dqmHarvesting(self, datasetName, runNumber, globalTag, **args):
00134         """
00135         _dqmHarvesting_
00136 
00137         Proton collisions data taking DQM Harvesting
00138 
00139         """
00140         options = defaultOptions
00141         options.scenario = self.cbSc
00142         options.step = "HARVESTING"+dqmSeq(args,':dqmHarvesting')
00143         options.name = "EDMtoMEConvert"
00144         options.conditions = globalTag
00145  
00146         process = cms.Process("HARVESTING")
00147         process.source = dqmIOSource(args)
00148         configBuilder = ConfigBuilder(options, process = process)
00149         configBuilder.prepare()
00150 
00151         harvestingMode(process,datasetName,args,rANDl=False)
00152         return process
00153 
00154 
00155     def alcaHarvesting(self, globalTag, datasetName, **args):
00156         """
00157         _alcaHarvesting_
00158 
00159         Proton collisions data taking AlCa Harvesting
00160 
00161         """
00162         if not 'skims' in args: return None
00163         options = defaultOptions
00164         options.scenario = self.cbSc if hasattr(self,'cbSc') else self.__class__.__name__ 
00165         options.step = "ALCAHARVEST:"+('+'.join(args['skims']))
00166         options.name = "ALCAHARVEST"
00167         options.conditions = globalTag
00168  
00169         process = cms.Process("ALCAHARVEST")
00170         process.source = cms.Source("PoolSource")
00171         configBuilder = ConfigBuilder(options, process = process)
00172         configBuilder.prepare()
00173 
00174         #
00175         # customise process for particular job
00176         #
00177         process.source.processingMode = cms.untracked.string('RunsAndLumis')
00178         process.source.fileNames = cms.untracked(cms.vstring())
00179         process.maxEvents.input = -1
00180         process.dqmSaver.workflow = datasetName
00181         
00182         return process
00183 
00184     def skimming(self, skims, globalTag,**options):
00185         """
00186         _skimming_
00187 
00188         skimming method overload for the prompt skiming
00189         
00190         """
00191         options = defaultOptions
00192         options.scenario = self.cbSc if hasattr(self,'cbSc') else self.__class__.__name__
00193         options.step = "SKIM:"+('+'.join(skims))
00194         options.name = "SKIM"
00195         options.conditions = globalTag
00196         process = cms.Process("SKIM")
00197         process.source = cms.Source("PoolSource")
00198         configBuilder = ConfigBuilder(options, process = process)
00199         configBuilder.prepare()
00200 
00201         return process
00202         
00203     """
00204     def repack(self, **args):
00205         options = defaultOptions
00206         dictIO(options,args)
00207         options.filein='file.dat'
00208         options.filetype='DAT'
00209         options.scenario = self.cbSc if hasattr(self,'cbSc') else self.__class__.__name__
00210         process = cms.Process('REPACK')
00211         cb = ConfigBuilder(options, process = process, with_output = True,with_input=True)
00212         cb.prepare()
00213         print cb.pythonCfgCode
00214         return process
00215     """