CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/Configuration/GlobalRuns/python/reco_TLR_42X.py

Go to the documentation of this file.
00001 import FWCore.ParameterSet.Config as cms
00002 
00003 def memorySavingTracking(process):
00004     toRemove={}
00005     #list of modules in iterative tracking
00006     ## remove rekeying of clusters refs from track producer
00007     trackProducers=['preFilterZeroStepTracks',
00008                     'preFilterStepOneTracks',
00009                     'secWithMaterialTracks',
00010                     'thWithMaterialTracks',
00011                     'fourthWithMaterialTracks',
00012                     'fifthWithMaterialTracks',
00013                     ]
00014 
00015     for tp in trackProducers:
00016         m=getattr(process,tp)
00017         if hasattr(m,"clusterRemovalInfo"):
00018             #print "removing cluter rekeying from",tp
00019             delattr(m,"clusterRemovalInfo")
00020 
00021     measurementTrackers=['MeasurementTracker',
00022                          'newMeasurementTracker',
00023                          'secMeasurementTracker',
00024                          'thMeasurementTracker',
00025                          'fourthMeasurementTracker',
00026                          'fifthMeasurementTracker',
00027                          ]
00028 
00029     # list of measurement tracker, component names
00030     ## create the clusterRef to skip creators (MT+'ToSkip')
00031     for mt in measurementTrackers:
00032         es=getattr(process,mt)
00033         ## modify MT to point to the full cluster list
00034         #if es.pixelClusterProducer.value() == 'siPixelClusters':
00035         #    continue
00036 
00037         #old trackclusterremoval module
00038         removalModule=es.pixelClusterProducer.value()
00039 
00040         if (removalModule != 'siPixelClusters'):
00041             es.skipClusters = cms.InputTag(removalModule)
00042             es.pixelClusterProducer = 'siPixelClusters'
00043             es.stripClusterProducer = 'siStripClusters'
00044             #print mt,es.skipClusters,es.pixelClusterProducer,es.stripClusterProducer
00045             tcremoval = getattr(process,removalModule)
00046             #print removalModule,"turned to using new scheme"
00047             tcremoval.clusterLessSolution= cms.bool(True)
00048             tcremoval.stripClusters = 'siStripClusters'
00049             tcremoval.pixelClusters = 'siPixelClusters'
00050             skipTrackQualityFilter=False
00051             if (skipTrackQualityFilter):
00052                 tcremoval.TrackQuality = cms.string('highPurity')
00053                 #remove the QualityFilter module from the path
00054                 toRemove[tcremoval.trajectories.value()]=True
00055                 qf=getattr(process,tcremoval.trajectories.value())
00056                 tcremoval.trajectories = qf.recTracks
00057         #else:
00058             #print mt,'no cluster to skip',es.pixelClusterProducer,es.stripClusterProducer
00059 
00060     patternRecoModules=[
00061         'fifthTrackCandidates',
00062         'fourthTrackCandidates',
00063         'newTrackCandidateMaker',
00064         'secTrackCandidates',
00065         'stepOneTrackCandidateMaker',
00066         'thTrackCandidates'
00067         ]
00068     
00069     for ckfm in patternRecoModules:
00070         ckf=getattr(process,ckfm)
00071         builder=getattr(process,ckf.TrajectoryBuilder.value())
00072         mtn= builder.MeasurementTrackerName.value()
00073         if mtn!='':
00074             #make it look at the central MT
00075             builder.MeasurementTrackerName=''
00076             mt=getattr(process,mtn)
00077             # transfer the cluster removal from the MT to the builder
00078             builder.clustersToSkip = mt.skipClusters
00079             #print "setting",ckf.TrajectoryBuilder.value(),"via",ckfm,"to look at central MT"
00080             #print "removing MT:",mtn
00081             delattr(process,mtn)
00082         #else:
00083             #print ckfm,"untouched"
00084             
00085     #all seeding layers should point to the same rechits collections
00086     for esp in process.es_producers_().keys():
00087         es = getattr(process,esp)
00088         if es._TypedParameterizable__type != 'SeedingLayersESProducer':
00089             continue
00090         for pm in es.parameters_().keys():
00091             p=getattr(es,pm)
00092             if p.pythonTypeName() == 'cms.PSet':
00093                 if hasattr(p,'HitProducer'):
00094                     #print "pixel",pm,p
00095                     #pixel case
00096                     if p.HitProducer != 'siPixelRecHits':
00097                         toRemove[p.HitProducer.value()]=True
00098                         skip=getattr(process,p.HitProducer.value()).src
00099                         p.HitProducer = 'siPixelRecHits'
00100                         #and set the skipping
00101                         p.skipClusters = cms.InputTag(skip.value())
00102                         #print esp,"modified for new skipping"
00103                         #print esp,pm,p
00104 
00105                 if hasattr(p,'matchedRecHits'):
00106                     #print "strip",pm,p
00107                     #strip case
00108                     ## rename the collection
00109                     if p.matchedRecHits.moduleLabel != 'siStripMatchedRecHits':
00110                         toRemove[p.matchedRecHits.moduleLabel]=True
00111                         skip=getattr(process,p.matchedRecHits.moduleLabel).ClusterProducer
00112                         p.matchedRecHits.setModuleLabel('siStripMatchedRecHits')
00113                         #and set the skipping
00114                         p.skipClusters = cms.InputTag(skip.value())
00115                         #print esp,pm,p
00116 
00117 
00118     for edp in process.producers_():
00119         p=getattr(process,edp)
00120         if hasattr(p,'ClusterCheckPSet'):
00121             #print "resetting cluster check for",edp
00122             p.ClusterCheckPSet.PixelClusterCollectionLabel = 'siPixelClusters'
00123             p.ClusterCheckPSet.ClusterCollectionLabel = 'siStripClusters'
00124 
00125     #force useless module to be removed
00126     toRemove['secStripRecHits']=True
00127     toRemove['fourthPixelRecHits']=True
00128     toRemove['fifthPixelRecHits']=True
00129     
00130     for tr in toRemove:
00131         if hasattr(process,tr):
00132             #print "removing",tr
00133             process.reconstruction_step.remove(getattr(process,tr))
00134 
00135     delattr(process.newCombinedSeeds,'clusterRemovalInfos')
00136         
00137     return (process)
00138 
00139 
00140 def customiseCommon(process):
00141 
00142     process = memorySavingTracking(process)
00143     
00144     return (process)
00145 
00146 
00147 ##############################################################################
00148 def customisePPData(process):
00149     process= customiseCommon(process)
00150 
00151     ## particle flow HF cleaning
00152     process.particleFlowRecHitHCAL.LongShortFibre_Cut = 30.
00153     process.particleFlowRecHitHCAL.ApplyPulseDPG = True
00154 
00155     ## HF cleaning for data only
00156     process.hcalRecAlgos.SeverityLevels[3].RecHitFlags.remove("HFDigiTime")
00157     process.hcalRecAlgos.SeverityLevels[4].RecHitFlags.append("HFDigiTime")
00158 
00159     ##beam-halo-id for data only
00160     process.CSCHaloData.ExpectedBX = cms.int32(3)
00161 
00162     ## hcal hit flagging
00163     process.hfreco.PETstat.flagsToSkip  = 2
00164     process.hfreco.S8S1stat.flagsToSkip = 18
00165     process.hfreco.S9S1stat.flagsToSkip = 26
00166 
00167     ##Ecal time bias correction
00168     process.ecalGlobalUncalibRecHit.doEBtimeCorrection = True
00169     process.ecalGlobalUncalibRecHit.doEEtimeCorrection = True
00170     
00171     return process
00172 
00173 
00174 ##############################################################################
00175 def customisePPMC(process):
00176     process=customiseCommon(process)
00177     
00178     return process
00179 
00180 ##############################################################################
00181 def customiseCosmicData(process):
00182 
00183     return process
00184 
00185 ##############################################################################
00186 def customiseCosmicMC(process):
00187     
00188     return process
00189         
00190 ##############################################################################
00191 def customiseVALSKIM(process):
00192     process= customisePPData(process)
00193     process.reconstruction.remove(process.lumiProducer)
00194     return process
00195                 
00196 ##############################################################################
00197 def customiseExpress(process):
00198     process= customisePPData(process)
00199 
00200     import RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi
00201     process.offlineBeamSpot = RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi.onlineBeamSpotProducer.clone()
00202     
00203     return process
00204 
00205 ##############################################################################
00206 def customisePrompt(process):
00207     process= customisePPData(process)
00208     return process
00209 
00210 ##############################################################################
00211 ##############################################################################
00212 
00213 def customiseCommonHI(process):
00214     
00215     ###############################################################################################
00216     ####
00217     ####  Top level replaces for handling strange scenarios of early HI collisions
00218     ####
00219 
00220     ## Offline Silicon Tracker Zero Suppression
00221     process.siStripZeroSuppression.Algorithms.CommonModeNoiseSubtractionMode = cms.string("IteratedMedian")
00222     process.siStripZeroSuppression.Algorithms.CutToAvoidSignal = cms.double(2.0)
00223     process.siStripZeroSuppression.Algorithms.Iterations = cms.int32(3)
00224     process.siStripZeroSuppression.storeCM = cms.bool(True)
00225 
00226 
00227     ###
00228     ###  end of top level replacements
00229     ###
00230     ###############################################################################################
00231 
00232     return process
00233 
00234 ##############################################################################
00235 def customiseExpressHI(process):
00236     process= customiseCommonHI(process)
00237 
00238     import RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi
00239     process.offlineBeamSpot = RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi.onlineBeamSpotProducer.clone()
00240     
00241     return process
00242 
00243 ##############################################################################
00244 def customisePromptHI(process):
00245     process= customiseCommonHI(process)
00246 
00247     import RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi
00248     process.offlineBeamSpot = RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi.onlineBeamSpotProducer.clone()
00249     
00250     return process
00251 
00252 ##############################################################################