CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/SLHCUpgradeSimulations/Configuration/python/phase1TkCustoms.py

Go to the documentation of this file.
00001 import FWCore.ParameterSet.Config as cms
00002 
00003 from RecoTracker.IterativeTracking.iterativeTk_cff import *
00004 from RecoTracker.IterativeTracking.ElectronSeeds_cff import *
00005 from SLHCUpgradeSimulations.Configuration.customise_mixing import customise_pixelMixing_PU
00006 
00007 def customise(process):
00008     if hasattr(process,'DigiToRaw'):
00009         process=customise_DigiToRaw(process)
00010     if hasattr(process,'RawToDigi'):
00011         process=customise_RawToDigi(process)
00012     n=0
00013     if hasattr(process,'reconstruction') or hasattr(process,'dqmoffline_step'):
00014         if hasattr(process,'mix'): 
00015             if hasattr(process.mix,'input'):
00016                 n=process.mix.input.nbPileupEvents.averageNumber.value()
00017         else:
00018             print 'phase1TkCustoms requires a --pileup option to cmsDriver to run the reconstruction/dqm'
00019             print 'Please provide one!'
00020             sys.exit(1)
00021     if hasattr(process,'reconstruction'):
00022         process=customise_Reco(process,float(n))
00023                 
00024     if hasattr(process,'digitisation_step'):
00025         process=customise_Digi(process)
00026     if hasattr(process,'dqmoffline_step'):
00027         process=customise_DQM(process,n)
00028     if hasattr(process,'dqmHarvesting'):
00029         process=customise_harvesting(process)
00030     if hasattr(process,'validation_step'):
00031         process=customise_Validation(process)
00032     process=customise_condOverRides(process)
00033     
00034     return process
00035 
00036 def customise_DigiToRaw(process):
00037     process.digi2raw_step.remove(process.siPixelRawData)
00038     process.digi2raw_step.remove(process.castorRawData)
00039     return process
00040 
00041 def customise_RawToDigi(process):
00042     process.raw2digi_step.remove(process.siPixelDigis)
00043     process.raw2digi_step.remove(process.castorDigis)
00044     return process
00045 
00046 def customise_Digi(process):
00047     process.mix.digitizers.pixel.MissCalibrate = False
00048     process.mix.digitizers.pixel.LorentzAngle_DB = False
00049     process.mix.digitizers.pixel.killModules = False
00050     process.mix.digitizers.pixel.useDB = False
00051     process.mix.digitizers.pixel.DeadModules_DB = False
00052     process.mix.digitizers.pixel.NumPixelBarrel = cms.int32(4)
00053     process.mix.digitizers.pixel.NumPixelEndcap = cms.int32(3)
00054     process.mix.digitizers.pixel.ThresholdInElectrons_FPix = cms.double(2000.0)
00055     process.mix.digitizers.pixel.ThresholdInElectrons_BPix = cms.double(2000.0)
00056     process.mix.digitizers.pixel.ThresholdInElectrons_BPix_L1 = cms.double(2000.0)
00057     process.mix.digitizers.pixel.thePixelColEfficiency_BPix4 = cms.double(0.999)
00058     process.mix.digitizers.pixel.thePixelEfficiency_BPix4 = cms.double(0.999)
00059     process.mix.digitizers.pixel.thePixelChipEfficiency_BPix4 = cms.double(0.999)
00060     process.mix.digitizers.pixel.thePixelColEfficiency_FPix3 = cms.double(0.999)
00061     process.mix.digitizers.pixel.thePixelEfficiency_FPix3 = cms.double(0.999)
00062     process.mix.digitizers.pixel.thePixelChipEfficiency_FPix3 = cms.double(0.999)
00063     process.mix.digitizers.pixel.AddPixelInefficiencyFromPython = cms.bool(True)
00064 
00065     process=customise_pixelMixing_PU(process)
00066     return process
00067 
00068 
00069 # DQM steps change
00070 def customise_DQM(process,pileup):
00071     # We cut down the number of iterative tracking steps
00072 #    process.dqmoffline_step.remove(process.TrackMonStep3)
00073 #    process.dqmoffline_step.remove(process.TrackMonStep4)
00074 #    process.dqmoffline_step.remove(process.TrackMonStep5)
00075 #    process.dqmoffline_step.remove(process.TrackMonStep6)
00076     #
00077     process.dqmoffline_step.remove(process.muonAnalyzer)
00078     process.dqmoffline_step.remove(process.jetMETAnalyzer)
00079 #    process.dqmoffline_step.remove(process.TrackMonStep9)
00080 #    process.dqmoffline_step.remove(process.TrackMonStep10)
00081 #    process.dqmoffline_step.remove(process.PixelTrackingRecHitsValid)
00082 
00083     #put isUpgrade flag==true
00084     process.SiPixelRawDataErrorSource.isUpgrade = cms.untracked.bool(True)
00085     process.SiPixelDigiSource.isUpgrade = cms.untracked.bool(True)
00086     process.SiPixelClusterSource.isUpgrade = cms.untracked.bool(True)
00087     process.SiPixelRecHitSource.isUpgrade = cms.untracked.bool(True)
00088     process.SiPixelTrackResidualSource.isUpgrade = cms.untracked.bool(True)
00089     process.SiPixelHitEfficiencySource.isUpgrade = cms.untracked.bool(True)
00090 
00091     from DQM.TrackingMonitor.customizeTrackingMonitorSeedNumber import customise_trackMon_IterativeTracking_PHASE1PU140
00092     from DQM.TrackingMonitor.customizeTrackingMonitorSeedNumber import customise_trackMon_IterativeTracking_PHASE1PU70
00093 
00094     if pileup>100:
00095         process=customise_trackMon_IterativeTracking_PHASE1PU140(process)
00096     else:
00097         process=customise_trackMon_IterativeTracking_PHASE1PU70(process)
00098     return process
00099 
00100 def customise_Validation(process):
00101     process.validation_step.remove(process.PixelTrackingRecHitsValid)
00102     # We don't run the HLT
00103     process.validation_step.remove(process.HLTSusyExoVal)
00104     process.validation_step.remove(process.hltHiggsValidator)
00105     process.validation_step.remove(process.relvalMuonBits)
00106     return process
00107 
00108 def customise_harvesting(process):
00109     process.dqmHarvesting.remove(process.jetMETDQMOfflineClient)
00110     process.dqmHarvesting.remove(process.dataCertificationJetMET)
00111     process.dqmHarvesting.remove(process.sipixelEDAClient)
00112     process.dqmHarvesting.remove(process.sipixelCertification)
00113     return (process)        
00114 
00115 def customise_condOverRides(process):
00116     process.load('SLHCUpgradeSimulations.Geometry.fakeConditions_Phase1_R30F12_cff')
00117     process.trackerTopologyConstants.pxb_layerStartBit = cms.uint32(20)
00118     process.trackerTopologyConstants.pxb_ladderStartBit = cms.uint32(12)
00119     process.trackerTopologyConstants.pxb_moduleStartBit = cms.uint32(2)
00120     process.trackerTopologyConstants.pxb_layerMask = cms.uint32(15)
00121     process.trackerTopologyConstants.pxb_ladderMask = cms.uint32(255)
00122     process.trackerTopologyConstants.pxb_moduleMask = cms.uint32(1023)
00123     process.trackerTopologyConstants.pxf_diskStartBit = cms.uint32(18)
00124     process.trackerTopologyConstants.pxf_bladeStartBit = cms.uint32(12)
00125     process.trackerTopologyConstants.pxf_panelStartBit = cms.uint32(10)
00126     process.trackerTopologyConstants.pxf_moduleMask = cms.uint32(255)
00127     return process
00128 
00129 def add_detailed_pixel_dqm(process):
00130     #enable modOn
00131     process.SiPixelRawDataErrorSource.modOn = cms.untracked.bool(True)
00132     process.SiPixelDigiSource.modOn = cms.untracked.bool(True)
00133     process.SiPixelClusterSource.modOn = cms.untracked.bool(True)
00134     process.SiPixelRecHitSource.modOn = cms.untracked.bool(True)
00135     process.SiPixelTrackResidualSource.modOn = cms.untracked.bool(True)
00136     process.SiPixelHitEfficiencySource.modOn = cms.untracked.bool(True)
00137 
00138     return process
00139 
00140 
00141 def remove_pixel_ineff(process):
00142     if hasattr(process,'mix'):
00143         process.mix.digitizers.pixel.AddPixelInefficiencyFromPython = cms.bool(False) 
00144 
00145     return process
00146     
00147 
00148 def customise_Reco(process,pileup):
00149 
00150     #this code supports either 70 or 140 pileup configurations - should fix as to support 0
00151     nPU=70
00152     if pileup>100: nPU=140
00153     
00154     #use with latest pixel geometry
00155     process.ClusterShapeHitFilterESProducer.PixelShapeFile = cms.string('RecoPixelVertexing/PixelLowPtUtilities/data/pixelShape_Phase1Tk.par')
00156     # Need this line to stop error about missing siPixelDigis.
00157     process.MeasurementTracker.inactivePixelDetectorLabels = cms.VInputTag()
00158 
00159     # new layer list (3/4 pixel seeding) in InitialStep and pixelTracks
00160     process.pixellayertriplets.layerList = cms.vstring( 'BPix1+BPix2+BPix3',
00161                                                         'BPix2+BPix3+BPix4',
00162                                                         'BPix1+BPix3+BPix4',
00163                                                         'BPix1+BPix2+BPix4',
00164                                                         'BPix2+BPix3+FPix1_pos',
00165                                                         'BPix2+BPix3+FPix1_neg',
00166                                                         'BPix1+BPix2+FPix1_pos',
00167                                                         'BPix1+BPix2+FPix1_neg',
00168                                                         'BPix2+FPix1_pos+FPix2_pos',
00169                                                         'BPix2+FPix1_neg+FPix2_neg',
00170                                                         'BPix1+FPix1_pos+FPix2_pos',
00171                                                         'BPix1+FPix1_neg+FPix2_neg',
00172                                                         'FPix1_pos+FPix2_pos+FPix3_pos',
00173                                                         'FPix1_neg+FPix2_neg+FPix3_neg' )
00174 
00175     # New tracking.  This is really ugly because it redefines globalreco and reconstruction.
00176     # It can be removed if change one line in Configuration/StandardSequences/python/Reconstruction_cff.py
00177     # from RecoTracker_cff.py to RecoTrackerPhase1PU140_cff.py
00178 
00179     # remove all the tracking first
00180     itIndex=process.globalreco.index(process.trackingGlobalReco)
00181     grIndex=process.reconstruction.index(process.globalreco)
00182 
00183     process.reconstruction.remove(process.globalreco)
00184     process.globalreco.remove(process.iterTracking)
00185     process.globalreco.remove(process.electronSeedsSeq)
00186     process.reconstruction_fromRECO.remove(process.trackingGlobalReco)
00187     del process.iterTracking
00188     del process.ckftracks
00189     del process.ckftracks_woBH
00190     del process.ckftracks_wodEdX
00191     del process.ckftracks_plus_pixelless
00192     del process.trackingGlobalReco
00193     del process.electronSeedsSeq
00194     del process.InitialStep
00195     del process.LowPtTripletStep
00196     del process.PixelPairStep
00197     del process.DetachedTripletStep
00198     del process.MixedTripletStep
00199     del process.PixelLessStep
00200     del process.TobTecStep
00201     del process.earlyGeneralTracks
00202     del process.ConvStep
00203     # add the correct tracking back in
00204     process.load("RecoTracker.Configuration.RecoTrackerPhase1PU"+str(nPU)+"_cff")
00205 
00206     process.globalreco.insert(itIndex,process.trackingGlobalReco)
00207     process.reconstruction.insert(grIndex,process.globalreco)
00208     #Note process.reconstruction_fromRECO is broken
00209     
00210     # End of new tracking configuration which can be removed if new Reconstruction is used.
00211 
00212 
00213     process.reconstruction.remove(process.castorreco)
00214     process.reconstruction.remove(process.CastorTowerReco)
00215     process.reconstruction.remove(process.ak7BasicJets)
00216     process.reconstruction.remove(process.ak7CastorJetID)
00217 
00218     #the quadruplet merger configuration     
00219     process.load("RecoPixelVertexing.PixelTriplets.quadrupletseedmerging_cff")
00220     process.pixelseedmergerlayers.BPix.TTRHBuilder = cms.string("PixelTTRHBuilderWithoutAngle" )
00221     process.pixelseedmergerlayers.BPix.HitProducer = cms.string("siPixelRecHits" )
00222     process.pixelseedmergerlayers.FPix.TTRHBuilder = cms.string("PixelTTRHBuilderWithoutAngle" )
00223     process.pixelseedmergerlayers.FPix.HitProducer = cms.string("siPixelRecHits" )    
00224     
00225     # Need these until pixel templates are used
00226     process.load("SLHCUpgradeSimulations.Geometry.recoFromSimDigis_cff")
00227     # PixelCPEGeneric #
00228     process.PixelCPEGenericESProducer.Upgrade = cms.bool(True)
00229     process.PixelCPEGenericESProducer.UseErrorsFromTemplates = cms.bool(False)
00230     process.PixelCPEGenericESProducer.LoadTemplatesFromDB = cms.bool(False)
00231     process.PixelCPEGenericESProducer.TruncatePixelCharge = cms.bool(False)
00232     process.PixelCPEGenericESProducer.IrradiationBiasCorrection = False
00233     process.PixelCPEGenericESProducer.DoCosmics = False
00234     # CPE for other steps
00235     process.siPixelRecHits.CPE = cms.string('PixelCPEGeneric')
00236     # Turn of template use in tracking (iterative steps handled inside their configs)
00237     process.mergedDuplicateTracks.TTRHBuilder = 'WithTrackAngle'
00238     process.ctfWithMaterialTracks.TTRHBuilder = 'WithTrackAngle'
00239     process.muonSeededSeedsInOut.TrackerRecHitBuilder=cms.string('WithTrackAngle')
00240     process.muonSeededTracksInOut.TTRHBuilder=cms.string('WithTrackAngle')
00241     process.muonSeededTracksOutIn.TTRHBuilder=cms.string('WithTrackAngle')
00242     process.muons1stStep.TrackerKinkFinderParameters.TrackerRecHitBuilder=cms.string('WithTrackAngle')
00243     process.regionalCosmicTracks.TTRHBuilder=cms.string('WithTrackAngle')
00244     process.cosmicsVetoTracksRaw.TTRHBuilder=cms.string('WithTrackAngle')
00245     # End of pixel template needed section
00246     
00247     # Make pixelTracks use quadruplets
00248     process.pixelTracks.SeedMergerPSet = cms.PSet(
00249         layerListName = cms.string('PixelSeedMergerQuadruplets'),
00250         addRemainingTriplets = cms.bool(False),
00251         mergeTriplets = cms.bool(True),
00252         ttrhBuilderLabel = cms.string('PixelTTRHBuilderWithoutAngle')
00253         )
00254     process.pixelTracks.FilterPSet.chi2 = cms.double(50.0)
00255     process.pixelTracks.FilterPSet.tipMax = cms.double(0.05)
00256     process.pixelTracks.RegionFactoryPSet.RegionPSet.originRadius =  cms.double(0.02)
00257 
00258 
00259 
00260     return process