Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-05-12 22:39:48

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 def addL3ToHLT(process):
0004     def filters_by_type(process, type):
0005         return (filter for filter in process._Process__filters.values() if filter._TypedParameterizable__type == type)
0006     
0007     for l3Filter in filters_by_type(process, 'HLTMuonL3PreFilter'):
0008         if hasattr(l3Filter, 'CandTag'):
0009             if (l3Filter.CandTag==cms.InputTag("hltL3MuonCandidates")):
0010                 l3Filter.CandTag=cms.InputTag("hltIterL3MuonCandidates")
0011                 l3Filter.InputLinks=cms.InputTag( "hltIterL3MuonsLinksCombination")
0012 
0013     if hasattr(process, 'hltPixelTracksForSeedsL3Muon'):
0014         process.hltPixelTracksForSeedsL3Muon.RegionFactoryPSet.RegionPSet.input=cms.InputTag("hltIterL3MuonCandidates")
0015     if hasattr(process, 'hltIter1L3MuonPixelSeeds'):
0016         process.hltIter1L3MuonPixelSeeds.RegionFactoryPSet.RegionPSet.input=cms.InputTag("hltIterL3MuonCandidates")
0017     if hasattr(process, 'hltIter2L3MuonPixelSeeds'):
0018         process.hltIter2L3MuonPixelSeeds.RegionFactoryPSet.RegionPSet.input=cms.InputTag("hltIterL3MuonCandidates")
0019 
0020     def producers_by_type(process, type):
0021             return (module for module in process._Process__producers.values() if module._TypedParameterizable__type == type)
0022 
0023     for PFModule in producers_by_type(process, 'MuonHLTRechitInRegionsProducer'):
0024         if hasattr(PFModule, 'l1TagIsolated'):
0025             if(PFModule.l1TagIsolated==cms.InputTag("hltL3MuonCandidates")):
0026                 PFModule.l1TagIsolated=cms.InputTag("hltIterL3MuonCandidates")
0027     #Isolation paths:
0028     for PFModule in producers_by_type(process, 'L3MuonCombinedRelativeIsolationProducer'):
0029         if hasattr(PFModule, 'inputMuonCollection'):
0030             if(PFModule.inputMuonCollection==cms.InputTag("hltL3MuonCandidates")):
0031                 PFModule.inputMuonCollection=cms.InputTag("hltIterL3MuonCandidates")
0032 
0033     for l3Filter in filters_by_type(process, 'HLTMuonIsoFilter'):
0034         if hasattr(l3Filter, 'CandTag'):
0035             if (l3Filter.CandTag==cms.InputTag("hltL3MuonCandidates")):
0036                 l3Filter.CandTag=cms.InputTag("hltIterL3MuonCandidates")
0037 
0038     for l3Filter in filters_by_type(process, 'HLTMuonDimuonL3Filter'):
0039         if hasattr(l3Filter, 'CandTag'):
0040             if (l3Filter.CandTag==cms.InputTag("hltL3MuonCandidates")):
0041                 l3Filter.CandTag=cms.InputTag("hltIterL3MuonCandidates")
0042 
0043     if hasattr(process, 'hltMuonEcalPFClusterIsoForMuons'):
0044         process.hltMuonEcalPFClusterIsoForMuons.recoCandidateProducer = cms.InputTag("hltIterL3MuonCandidates")
0045 
0046     if hasattr(process, 'hltDiMuonLinks'):
0047         process.hltDiMuonLinks.LinkCollection = cms.InputTag("hltIterL3MuonsLinksCombination")
0048     #############################################################
0049     #Making Pixel Vertices:
0050         from RecoTracker.TkTrackingRegions.globalTrackingRegionFromBeamSpot_cfi import globalTrackingRegionFromBeamSpot as _globalTrackingRegionFromBeamSpot
0051         from RecoTracker.TkHitPairs.hitPairEDProducer_cfi import hitPairEDProducer as _hitPairEDProducer
0052         from RecoPixelVertexing.PixelTriplets.pixelTripletHLTEDProducer_cfi import pixelTripletHLTEDProducer as _pixelTripletHLTEDProducer
0053         from RecoPixelVertexing.PixelTrackFitting.pixelTrackFilterByKinematics_cfi import pixelTrackFilterByKinematics as _pixelTrackFilterByKinematics
0054         from RecoPixelVertexing.PixelTrackFitting.pixelFitterByHelixProjections_cfi import pixelFitterByHelixProjections as _pixelFitterByHelixProjections
0055         from RecoPixelVertexing.PixelTrackFitting.pixelTrackCleanerBySharedHits_cfi import pixelTrackCleanerBySharedHits as _pixelTrackCleanerBySharedHits
0056         process.hltPixelTracksTrackingRegions = _globalTrackingRegionFromBeamSpot.clone(
0057             precise = True,
0058             originRadius = 0.2,
0059             ptMin = 0.9,
0060             originHalfLength = 24.0,
0061         beamSpot = "hltOnlineBeamSpot"
0062         )
0063         process.hltPixelTracksHitDoublets = _hitPairEDProducer.clone(
0064             clusterCheck = "",
0065             seedingLayers = "hltPixelLayerTriplets",
0066             trackingRegions = "hltPixelTracksTrackingRegions",
0067             maxElement = 0,
0068             produceIntermediateHitDoublets = True,
0069         )
0070         process.hltPixelTracksHitTriplets = _pixelTripletHLTEDProducer.clone(
0071             useBending = True,
0072         useFixedPreFiltering = False,
0073         maxElement = 100000,
0074         phiPreFiltering = 0.3,
0075         extraHitRPhitolerance = 0.06,
0076         useMultScattering = True,
0077         SeedComparitorPSet = dict(
0078                 ComponentName = "LowPtClusterShapeSeedComparitor",
0079             clusterShapeCacheSrc = cms.InputTag( "hltSiPixelClustersCache" )
0080             ),
0081         extraHitRZtolerance = 0.06,
0082         )
0083         process.hltPixelTracksFitter = _pixelFitterByHelixProjections.clone()
0084         process.hltPixelTrackFilterByKinematics = _pixelTrackFilterByKinematics.clone()
0085         process.hltPixelTracksCleaner = _pixelTrackCleanerBySharedHits.clone(
0086             ComponentName = "hltPixelTracksCleaner",
0087         )
0088     process.hltPixelTracks = cms.EDProducer( "PixelTrackProducer",
0089         Filter = cms.InputTag("hltPixelTrackFilterByKinematics"),
0090         passLabel = cms.string( "Pixel triplet primary tracks with vertex constraint" ),
0091         FitterPSet = cms.InputTag("hltPixelTracksFitter"),
0092         Cleaner = cms.string("hltPixelTracksCleaner"),
0093             SeedingHitSets = cms.InputTag("hltPixelTracksHitTriplets"),
0094     )
0095     
0096     process.hltPixelVertices = cms.EDProducer( "PixelVertexProducer",
0097         WtAverage = cms.bool( True ),
0098         Method2 = cms.bool( True ),
0099         beamSpot = cms.InputTag( "hltOnlineBeamSpot" ),
0100         PVcomparer = cms.PSet(  refToPSet_ = cms.string( "HLTPSetPvClusterComparerForIT" ) ),
0101         Verbosity = cms.int32( 0 ),
0102         UseError = cms.bool( True ),
0103         TrackCollection = cms.InputTag( "hltPixelTracks" ),
0104         PtMin = cms.double( 1.0 ),
0105         NTrkMin = cms.int32( 2 ),
0106         ZOffset = cms.double( 5.0 ),
0107         Finder = cms.string( "DivisiveVertexFinder" ),
0108         ZSeparation = cms.double( 0.05 )
0109     )
0110     #/Making Pixel Vertices, could probably use the following PTP tho?
0111     
0112     process.HLTRecopixelvertexingSequence = cms.Sequence(
0113      process.hltPixelLayerTriplets
0114          + process.hltPixelTracksTrackingRegions
0115          + process.hltPixelTracksHitDoublets
0116          + process.hltPixelTracksHitTriplets
0117          + process.hltPixelTracksFitter
0118      + process.hltPixelTrackFilterByKinematics
0119      + process.hltPixelTracks
0120      + process.hltPixelVertices
0121     )
0122     
0123     ######### Define Master MTRB ROI, OPTIMISED FOR IO 
0124     MasterMuonTrackingRegionBuilder = cms.PSet(
0125             Rescale_eta = cms.double( 3.0 ),
0126             Rescale_phi = cms.double( 3.0 ),
0127             Rescale_Dz = cms.double( 4.0 ),                 
0128             EtaR_UpperLimit_Par1 = cms.double( 0.25 ),      
0129             EtaR_UpperLimit_Par2 = cms.double( 0.15 ),      
0130             PhiR_UpperLimit_Par1 = cms.double( 0.6 ),       
0131             PhiR_UpperLimit_Par2 = cms.double( 0.2 ),       
0132             UseVertex = cms.bool( False ),                  
0133             Pt_fixed = cms.bool( False ),                   
0134             Z_fixed = cms.bool( False ),    
0135             Phi_fixed = cms.bool( True ),   
0136             Eta_fixed = cms.bool( True ),   
0137             Pt_min = cms.double( 3.0 ),     
0138             Phi_min = cms.double( 0.1 ),
0139             Eta_min = cms.double( 0.1 ),
0140             DeltaZ = cms.double( 24.2 ),    
0141             DeltaR = cms.double( 0.025 ),   
0142             DeltaEta = cms.double( 0.2 ),  
0143             DeltaPhi = cms.double( 0.15 ), 
0144             maxRegions = cms.int32( 2 ),
0145             precise = cms.bool( True ),
0146             OnDemand = cms.int32( -1 ),
0147             MeasurementTrackerName = cms.InputTag( "hltESPMeasurementTracker" ),
0148             beamSpot = cms.InputTag( "hltOnlineBeamSpot" ),
0149             vertexCollection = cms.InputTag( "pixelVertices" ), 
0150             input = cms.InputTag( 'hltL2Muons','UpdatedAtVtx' )
0151     )
0152 
0153     
0154     IterMasterMuonTrackingRegionBuilder = MasterMuonTrackingRegionBuilder
0155     IterMasterMuonTrackingRegionBuilder.input = cms.InputTag( 'hltL2SelectorForL3OI')   #Switch off for IO Only
0156     
0157     
0158     ########## OI Algorthim:
0159     #Trajectory Filter
0160     process.HLTPSetCkfTrajectoryFilterIterL3OI = cms.PSet(
0161        minPt = cms.double( 0.9 ),
0162        minHitsMinPt = cms.int32( 3 ),
0163        ComponentType = cms.string( "CkfBaseTrajectoryFilter" ),
0164        maxLostHits = cms.int32( 1 ),
0165        maxNumberOfHits = cms.int32( -1 ),
0166        maxConsecLostHits = cms.int32( 1 ),
0167        minimumNumberOfHits = cms.int32( 5 ),
0168        nSigmaMinPt = cms.double( 5.0 ),
0169        chargeSignificance = cms.double( -1.0 ),
0170        minGoodStripCharge = cms.PSet(  refToPSet_ = cms.string( "HLTSiStripClusterChargeCutNone" ) ),
0171        maxCCCLostHits = cms.int32( 9999 ),
0172        seedExtension = cms.int32( 0 ),
0173        strictSeedExtension = cms.bool( False ),
0174        minNumberOfHitsForLoopers = cms.int32( 13 ),
0175        minNumberOfHitsPerLoop = cms.int32( 4 ),
0176        extraNumberOfHitsBeforeTheFirstLoop = cms.int32( 4 ),
0177        maxLostHitsFraction = cms.double( 999.0 ),
0178        constantValueForLostHitsFractionFilter = cms.double( 1.0 ),
0179        seedPairPenalty = cms.int32( 0 )
0180     )
0181     
0182     process.HLTPSetCkfTrajectoryBuilderIterL3OI = cms.PSet(
0183       propagatorAlong = cms.string( "PropagatorWithMaterial" ),
0184       trajectoryFilter = cms.PSet(  refToPSet_ = cms.string( "HLTPSetCkfTrajectoryFilterIterL3OI" ) ),
0185       maxCand = cms.int32( 5 ),
0186       ComponentType = cms.string( "CkfTrajectoryBuilder" ),
0187       propagatorOpposite = cms.string( "PropagatorWithMaterialOpposite" ),
0188       MeasurementTrackerName = cms.string( "hltESPMeasurementTracker" ),
0189       estimator = cms.string( "hltESPChi2MeasurementEstimator30" ),
0190       TTRHBuilder = cms.string( "hltESPTTRHBWithTrackAngle" ),
0191       updator = cms.string( "hltESPKFUpdator" ),
0192       alwaysUseInvalidHits = cms.bool( True ),
0193       intermediateCleaning = cms.bool( True ),
0194       lostHitPenalty = cms.double( 1.0 )
0195     )
0196     
0197     process.hltESPChi2MeasurementEstimator100 = cms.ESProducer( "Chi2MeasurementEstimatorESProducer",
0198       MaxChi2 = cms.double( 100.0 ),
0199       nSigma = cms.double( 4.0 ),
0200       ComponentName = cms.string( "hltESPChi2MeasurementEstimator100" )
0201     )
0202     
0203     
0204     #OI Seeding:
0205     process.hltIterL3OISeedsFromL2Muons = cms.EDProducer("TSGForOI",
0206             MeasurementTrackerEvent = cms.InputTag("hltSiStripClusters"),
0207             UseHitSeeds = cms.bool(True),
0208             adjustErrorsDynamicallyForHitless = cms.bool(True),
0209             adjustErrorsDynamicallyForHits = cms.bool(True),
0210             debug = cms.untracked.bool(False),
0211             estimator = cms.string('hltESPChi2MeasurementEstimator100'),
0212             fixedErrorRescaleFactorForHitless = cms.double(5.0),
0213             fixedErrorRescaleFactorForHits = cms.double(2.0),
0214         pT1 = cms.double(13.0),                    
0215         pT2 = cms.double(30.0),                    
0216         pT3 = cms.double(70.0),                    
0217         eta1 = cms.double(1.0),                    
0218         eta2 = cms.double(1.4),                    
0219                 SF1 = cms.double(3.0),
0220                 SF2 = cms.double(4.0),
0221                 SF3 = cms.double(5.0),
0222                 SF4 = cms.double(7.0),
0223                 SF5 = cms.double(10.0),
0224         hitsToTry = cms.int32(5),
0225             layersToTry = cms.int32(3),
0226             maxEtaForTOB = cms.double(1.1),
0227             maxSeeds = cms.uint32(1),
0228             minEtaForTEC = cms.double(0.9),
0229             src = cms.InputTag("hltL2Muons","UpdatedAtVtx")
0230     )
0231     
0232     ###---------- Trajectory Cleaner, deciding how overlapping track candidates are arbitrated  ----------------
0233     import TrackingTools.TrajectoryCleaning.TrajectoryCleanerBySharedHits_cfi
0234     process.muonSeededTrajectoryCleanerBySharedHits = TrackingTools.TrajectoryCleaning.TrajectoryCleanerBySharedHits_cfi.trajectoryCleanerBySharedHits.clone(
0235         ComponentName = cms.string('muonSeededTrajectoryCleanerBySharedHits'),
0236         fractionShared = cms.double(0.1),
0237         ValidHitBonus = cms.double(1000.0),
0238         MissingHitPenalty = cms.double(1.0),
0239         ComponentType = cms.string('TrajectoryCleanerBySharedHits'),
0240         allowSharedFirstHit = cms.bool(True)
0241     )
0242     
0243     #OI Trajectory Building:
0244     process.hltIterL3OITrackCandidates = cms.EDProducer("CkfTrackCandidateMaker",
0245         RedundantSeedCleaner = cms.string('CachingSeedCleanerBySharedInput'),
0246         TrajectoryCleaner = cms.string('muonSeededTrajectoryCleanerBySharedHits'), #TrajectoryCleanerBySharedHits
0247         cleanTrajectoryAfterInOut = cms.bool(True),
0248         useHitsSplitting = cms.bool(True),
0249         doSeedingRegionRebuilding = cms.bool(True),
0250         maxNSeeds = cms.uint32(500000),
0251         maxSeedsBeforeCleaning = cms.uint32(5000),
0252         src = cms.InputTag('hltIterL3OISeedsFromL2Muons'),
0253         SimpleMagneticField = cms.string(''),
0254         NavigationSchool = cms.string('SimpleNavigationSchool'),
0255         TrajectoryBuilder = cms.string('CkfTrajectoryBuilder'),
0256         TrajectoryBuilderPSet = cms.PSet(refToPSet_ = cms.string('HLTPSetCkfTrajectoryBuilderIterL3OI')),      #Was HLTPSetCkfTrajectoryBuilder
0257         TransientInitialStateEstimatorParameters = cms.PSet(
0258             propagatorAlongTISE = cms.string('PropagatorWithMaterialParabolicMf'),  # parabolic magnetic field
0259             propagatorOppositeTISE = cms.string('PropagatorWithMaterialParabolicMfOpposite'), # parabolic magnetic field
0260             numberMeasurementsForFit = cms.int32(4)
0261         ),
0262         MeasurementTrackerEvent = cms.InputTag("hltSiStripClusters"),
0263         reverseTrajectories = cms.bool( True ),
0264     )
0265     
0266     ###-------------  Fitter-Smoother -------------------
0267 #   process.load("TrackingTools.MaterialEffects.RungeKuttaTrackerPropagator_cfi")
0268 #   import TrackingTools.TrackFitters.RungeKuttaFitters_cff
0269     process.load("TrackingTools.TrackFitters.RungeKuttaFitters_cff")
0270 
0271     process.RKTrajectoryFitter.Propagator = "hltESPRungeKuttaTrackerPropagator"
0272     process.RKTrajectorySmoother.Propagator = "hltESPRungeKuttaTrackerPropagator"
0273     process.RKTrajectoryFitter.Updator = "hltESPKFUpdator"
0274     process.RKTrajectorySmoother.Updator = "hltESPKFUpdator"
0275     process.RKTrajectoryFitter.Estimator = "hltESPChi2MeasurementEstimator30"
0276     process.RKTrajectorySmoother.Estimator = "hltESPChi2MeasurementEstimator30"
0277     process.RKTrajectoryFitter.RecoGeometry = "hltESPGlobalDetLayerGeometry"
0278     process.RKTrajectorySmoother.RecoGeometry = "hltESPGlobalDetLayerGeometry"
0279 
0280     process.muonSeededFittingSmootherWithOutliersRejectionAndRK = TrackingTools.TrackFitters.RungeKuttaFitters_cff.KFFittingSmootherWithOutliersRejectionAndRK.clone(
0281         ComponentName = cms.string("muonSeededFittingSmootherWithOutliersRejectionAndRK"),
0282         BreakTrajWith2ConsecutiveMissing = cms.bool(False),
0283         EstimateCut = cms.double(50.), ## was 20.
0284     )
0285 
0286     #OI Track Producer:
0287     process.hltIterL3MuonSeededTracksOutIn = cms.EDProducer("TrackProducer",
0288         useSimpleMF = cms.bool(False),
0289         SimpleMagneticField = cms.string(""),
0290         src = cms.InputTag("hltIterL3OITrackCandidates"),       #Modified
0291         clusterRemovalInfo = cms.InputTag(""),
0292         beamSpot = cms.InputTag("hltOnlineBeamSpot"),       #Modified
0293         Fitter = cms.string('muonSeededFittingSmootherWithOutliersRejectionAndRK'),       #Modified
0294         useHitsSplitting = cms.bool(False),
0295         alias = cms.untracked.string('ctfWithMaterialTracks'),
0296         TrajectoryInEvent = cms.bool(True),
0297         TTRHBuilder = cms.string('hltESPTTRHBWithTrackAngle'),      #Was: WithAngleAndTemplate
0298         AlgorithmName = cms.string('iter10'),       #Modified
0299         Propagator = cms.string('hltESPRungeKuttaTrackerPropagator'), #Others use PropagatorWithMaterial
0300         GeometricInnerState = cms.bool(False),
0301         NavigationSchool = cms.string('SimpleNavigationSchool'),  #Others are blank        
0302         MeasurementTracker = cms.string("hltESPMeasurementTracker"),
0303         MeasurementTrackerEvent = cms.InputTag('hltSiStripClusters'),       #Modified     
0304     )
0305     
0306     #OI L3 Muon Producer:
0307     process.hltL3MuonsIterL3OI = cms.EDProducer( "L3MuonProducer",
0308         ServiceParameters = cms.PSet(
0309           Propagators = cms.untracked.vstring( 'hltESPSmartPropagatorAny',
0310             'SteppingHelixPropagatorAny',
0311             'hltESPSmartPropagator',
0312             'hltESPSteppingHelixPropagatorOpposite' ),
0313           RPCLayers = cms.bool( True ),
0314           UseMuonNavigation = cms.untracked.bool( True )
0315         ),
0316         L3TrajBuilderParameters = cms.PSet(
0317           ScaleTECyFactor = cms.double( -1.0 ),
0318           GlbRefitterParameters = cms.PSet(
0319             TrackerSkipSection = cms.int32( -1 ),
0320             DoPredictionsOnly = cms.bool( False ),
0321             PropDirForCosmics = cms.bool( False ),
0322             HitThreshold = cms.int32( 1 ),
0323             RefitFlag = cms.bool( True ),          #Usually true
0324             MuonHitsOption = cms.int32( 1 ),
0325             Chi2CutRPC = cms.double( 1.0 ),
0326             Fitter = cms.string( "hltESPL3MuKFTrajectoryFitter" ),
0327             DTRecSegmentLabel = cms.InputTag( "hltDt4DSegments" ),
0328             TrackerRecHitBuilder = cms.string( "hltESPTTRHBWithTrackAngle" ),
0329             MuonRecHitBuilder = cms.string( "hltESPMuonTransientTrackingRecHitBuilder" ),
0330             RefitDirection = cms.string( "insideOut" ),
0331             CSCRecSegmentLabel = cms.InputTag( "hltCscSegments" ),
0332             Chi2CutCSC = cms.double( 150.0 ),
0333             Chi2CutDT = cms.double( 10.0 ),
0334             RefitRPCHits = cms.bool( True ),
0335             SkipStation = cms.int32( -1 ),
0336             Propagator = cms.string( "hltESPSmartPropagatorAny" ),
0337             TrackerSkipSystem = cms.int32( -1 ),
0338             DYTthrs = cms.vint32( 30, 15 )
0339           ),
0340           ScaleTECxFactor = cms.double( -1.0 ),
0341           TrackerRecHitBuilder = cms.string( "hltESPTTRHBWithTrackAngle" ),
0342           MuonRecHitBuilder = cms.string( "hltESPMuonTransientTrackingRecHitBuilder" ),
0343 #         MuonTrackingRegionBuilder = MasterMuonTrackingRegionBuilder,      #Using the master Muon ROI params - Although it is not used
0344              MuonTrackingRegionBuilder = cms.PSet(
0345             Rescale_eta = cms.double( 3.0 ),
0346             Rescale_phi = cms.double( 3.0 ),
0347             Rescale_Dz = cms.double( 4.0 ),                 
0348             EtaR_UpperLimit_Par1 = cms.double( 0.25 ),      
0349             EtaR_UpperLimit_Par2 = cms.double( 0.15 ),      
0350             PhiR_UpperLimit_Par1 = cms.double( 0.6 ),       
0351             PhiR_UpperLimit_Par2 = cms.double( 0.2 ),       
0352             UseVertex = cms.bool( False ),                  
0353             Pt_fixed = cms.bool( False ),                   
0354             Z_fixed = cms.bool( False ),    
0355             Phi_fixed = cms.bool( True ),   
0356             Eta_fixed = cms.bool( True ),   
0357             Pt_min = cms.double( 3.0 ),     
0358             Phi_min = cms.double( 0.1 ),
0359             Eta_min = cms.double( 0.1 ),
0360             DeltaZ = cms.double( 24.2 ),    
0361             DeltaR = cms.double( 0.025 ),   
0362             DeltaEta = cms.double( 0.2 ),  
0363             DeltaPhi = cms.double( 0.15 ), 
0364             maxRegions = cms.int32( 2 ),
0365             precise = cms.bool( True ),
0366             OnDemand = cms.int32( -1 ),
0367             MeasurementTrackerName = cms.InputTag( "hltESPMeasurementTracker" ),
0368             beamSpot = cms.InputTag( "hltOnlineBeamSpot" ),
0369             vertexCollection = cms.InputTag( "pixelVertices" ), 
0370             input = cms.InputTag( 'hltL2Muons','UpdatedAtVtx' )
0371           ),
0372           RefitRPCHits = cms.bool( True ),
0373           PCut = cms.double( 2.5 ),
0374           TrackTransformer = cms.PSet(
0375             DoPredictionsOnly = cms.bool( False ),
0376             Fitter = cms.string( "hltESPL3MuKFTrajectoryFitter" ),
0377             TrackerRecHitBuilder = cms.string( "hltESPTTRHBWithTrackAngle" ),
0378             Smoother = cms.string( "hltESPKFTrajectorySmootherForMuonTrackLoader" ),
0379             MuonRecHitBuilder = cms.string( "hltESPMuonTransientTrackingRecHitBuilder" ),
0380             RefitDirection = cms.string( "insideOut" ),
0381             RefitRPCHits = cms.bool( True ),
0382             Propagator = cms.string( "hltESPSmartPropagatorAny" )
0383           ),
0384           GlobalMuonTrackMatcher = cms.PSet(
0385             Pt_threshold1 = cms.double( 0.0 ),
0386             DeltaDCut_3 = cms.double( 15.0 ),
0387             MinP = cms.double( 2.5 ),
0388             MinPt = cms.double( 1.0 ),
0389             Chi2Cut_1 = cms.double( 50.0 ),
0390             Pt_threshold2 = cms.double( 9.99999999E8 ),
0391             LocChi2Cut = cms.double( 0.001 ),
0392             Eta_threshold = cms.double( 1.2 ),
0393             Quality_3 = cms.double( 7.0 ),
0394             Quality_2 = cms.double( 15.0 ),
0395             Chi2Cut_2 = cms.double( 50.0 ),
0396             Chi2Cut_3 = cms.double( 200.0 ),
0397             DeltaDCut_1 = cms.double( 40.0 ),
0398             DeltaRCut_2 = cms.double( 0.2 ),
0399             DeltaRCut_3 = cms.double( 1.0 ),
0400             DeltaDCut_2 = cms.double( 10.0 ),
0401             DeltaRCut_1 = cms.double( 0.1 ),
0402             Propagator = cms.string( "hltESPSmartPropagator" ),
0403             Quality_1 = cms.double( 20.0 )
0404           ),
0405           PtCut = cms.double( 1.0 ),
0406           TrackerPropagator = cms.string( "SteppingHelixPropagatorAny" ),
0407           tkTrajLabel = cms.InputTag( "hltIterL3MuonSeededTracksOutIn" ),    #Feed tracks from iterations into L3MTB
0408           tkTrajBeamSpot = cms.InputTag( "hltOnlineBeamSpot" ),
0409           tkTrajMaxChi2 = cms.double( 9999.0 ),
0410           tkTrajMaxDXYBeamSpot = cms.double( 9999.0 ),      #Using same values as old algos
0411           tkTrajVertex = cms.InputTag( "hltPixelVertices" ),        #From pixelVertice      #From pixelVerticesss
0412           tkTrajUseVertex = cms.bool( False ),
0413           matchToSeeds = cms.bool( True )
0414         ),
0415         TrackLoaderParameters = cms.PSet(
0416           PutTkTrackIntoEvent = cms.untracked.bool( False ),
0417           beamSpot = cms.InputTag( "hltOnlineBeamSpot" ),
0418           SmoothTkTrack = cms.untracked.bool( False ),
0419           MuonSeededTracksInstance = cms.untracked.string( "L2Seeded" ),
0420           Smoother = cms.string( "hltESPKFTrajectorySmootherForMuonTrackLoader" ),
0421           MuonUpdatorAtVertexParameters = cms.PSet(
0422             MaxChi2 = cms.double( 1000000.0 ),
0423             Propagator = cms.string( "hltESPSteppingHelixPropagatorOpposite" ),
0424             BeamSpotPositionErrors = cms.vdouble( 0.1, 0.1, 5.3 )
0425           ),
0426           VertexConstraint = cms.bool( False ),
0427           DoSmoothing = cms.bool( False )    #Usually true
0428         ),
0429         MuonCollectionLabel = cms.InputTag( 'hltL2Muons','UpdatedAtVtx' )
0430     )
0431     
0432     process.hltIterL3OIL3MuonsLinksCombination = cms.EDProducer( "L3TrackLinksCombiner",
0433         labels = cms.VInputTag( 'hltL3MuonsIterL3OI' )
0434     )
0435     process.hltIterL3OIL3Muons = cms.EDProducer( "L3TrackCombiner",
0436         labels = cms.VInputTag( 'hltL3MuonsIterL3OI' )
0437     )
0438     process.hltIterL3OIL3MuonCandidates = cms.EDProducer( "L3MuonCandidateProducer",
0439         InputLinksObjects = cms.InputTag( "hltIterL3OIL3MuonsLinksCombination" ),
0440         InputObjects = cms.InputTag( "hltIterL3OIL3Muons" ),
0441         MuonPtOption = cms.string( "Tracker" )
0442     )
0443     
0444     process.hltL2SelectorForL3IO = cms.EDProducer("HLTMuonL2SelectorForL3IO",
0445         l2Src = cms.InputTag('hltL2Muons','UpdatedAtVtx'),
0446         l3OISrc = cms.InputTag('hltIterL3OIL3MuonCandidates'),
0447         InputLinks = cms.InputTag('hltIterL3OIL3MuonsLinksCombination'),                          
0448 #       useOuterHitPosition = cms.bool( True ) ,
0449         applyL3Filters = cms.bool( False ),                           
0450 #       xDiffMax = cms.double( 0.5 ) ,
0451 #            yDiffMax = cms.double( 0.5 ) ,
0452 #            zDiffMax = cms.double( 9999.0 ) ,
0453 #            dRDiffMax  = cms.double( 0.01 ),
0454             MaxNormalizedChi2 = cms.double( 20.0 ),
0455             MaxPtDifference = cms.double( 0.3 ),
0456             MinNhits = cms.int32( 1 ),
0457             MinNmuonHits = cms.int32( 1 )
0458     )
0459     
0460     
0461     ########## IO Algorthim:
0462     #Making Pixel Vertices:
0463     process.hltPixelTracks = cms.EDProducer( "PixelTrackProducer",
0464         Filter = cms.InputTag("hltPixelTrackFilterByKinematics"),
0465         passLabel = cms.string( "Pixel triplet primary tracks with vertex constraint" ),
0466         Fitter = cms.InputTag("hltPixelTracksFitter"),
0467         CleanerPSet = cms.string("hltPixelTracksCleaner"),
0468             SeedingHitSets = cms.InputTag("hltPixelTracksHitTriplets"),
0469     )
0470     
0471     process.hltPixelVertices = cms.EDProducer( "PixelVertexProducer",
0472         WtAverage = cms.bool( True ),
0473         Method2 = cms.bool( True ),
0474         beamSpot = cms.InputTag( "hltOnlineBeamSpot" ),
0475         PVcomparer = cms.PSet(  refToPSet_ = cms.string( "HLTPSetPvClusterComparerForIT" ) ),
0476         Verbosity = cms.int32( 0 ),
0477         UseError = cms.bool( True ),
0478         TrackCollection = cms.InputTag( "hltPixelTracks" ),
0479         PtMin = cms.double( 1.0 ),
0480         NTrkMin = cms.int32( 2 ),
0481         ZOffset = cms.double( 5.0 ),
0482         Finder = cms.string( "DivisiveVertexFinder" ),
0483         ZSeparation = cms.double( 0.05 )
0484     )
0485     #/Making Pixel Vertices, could probably use the following PTP tho?
0486     
0487     #Start Iterative tracking:
0488     process.hltIterL3Iter0HighPtTkMuPixelTracks = cms.EDProducer( "PixelTrackProducer",
0489         Filter = cms.InputTag("hltPixelTrackFilterByKinematics"),
0490         passLabel = cms.string( "Pixel triplet primary tracks with vertex constraint" ),
0491         Fitter = cms.InputTag("hltPixelTracksFitter"),
0492         RegionFactoryPSet = IterMasterMuonTrackingRegionBuilder,
0493         CleanerPSet = cms.string("hltPixelTracksCleaner"),
0494         OrderedHitsFactoryPSet = cms.PSet(
0495           ComponentName = cms.string( "StandardHitTripletGenerator" ),
0496           GeneratorPSet = cms.PSet(
0497             useBending = cms.bool( True ),
0498             useFixedPreFiltering = cms.bool( False ),
0499             maxElement = cms.uint32( 100000 ),
0500             phiPreFiltering = cms.double( 0.3 ),
0501             extraHitRPhitolerance = cms.double( 0.06 ),
0502             useMultScattering = cms.bool( True ),
0503             SeedComparitorPSet = cms.PSet(
0504               ComponentName = cms.string( "LowPtClusterShapeSeedComparitor" ),
0505               clusterShapeCacheSrc = cms.InputTag( "hltSiPixelClustersCache" )
0506             ),
0507             extraHitRZtolerance = cms.double( 0.06 ),
0508             ComponentName = cms.string( "PixelTripletHLTGenerator" )
0509           ),
0510           SeedingLayers = cms.InputTag( "hltPixelLayerTriplets" )
0511         )
0512     )
0513     process.hltIterL3Iter0HighPtTkMuPixelTracks.RegionFactoryPSet.ComponentName = cms.string( "MuonTrackingRegionBuilder" )
0514     process.hltIterL3Iter0HighPtTkMuPixelTracks.RegionFactoryPSet.DeltaR = cms.double( 0.2 )
0515     
0516     process.hltIterL3Iter0HighPtTkMuPixelSeedsFromPixelTracks = cms.EDProducer( "SeedGeneratorFromProtoTracksEDProducer",
0517         useEventsWithNoVertex = cms.bool( True ),
0518         originHalfLength = cms.double( 1.0E9 ),
0519         useProtoTrackKinematics = cms.bool( False ),
0520         usePV = cms.bool( False ),
0521         SeedCreatorPSet = cms.PSet(  refToPSet_ = cms.string( "HLTSeedFromProtoTracks" ) ),
0522         InputVertexCollection = cms.InputTag( "" ),
0523         TTRHBuilder = cms.string( "hltESPTTRHBWithTrackAngle" ),
0524         InputCollection = cms.InputTag( "hltIterL3Iter0HighPtTkMuPixelTracks" ),
0525         originRadius = cms.double( 1.0E9 )
0526     )
0527 
0528     process.hltIterL3Iter0HighPtTkMuCkfTrackCandidates = cms.EDProducer( "CkfTrackCandidateMaker",
0529         src = cms.InputTag( "hltIterL3Iter0HighPtTkMuPixelSeedsFromPixelTracks" ),
0530         maxSeedsBeforeCleaning = cms.uint32( 1000 ),
0531         SimpleMagneticField = cms.string( "ParabolicMf" ),
0532         TransientInitialStateEstimatorParameters = cms.PSet(
0533           propagatorAlongTISE = cms.string( "PropagatorWithMaterialParabolicMf" ),
0534           numberMeasurementsForFit = cms.int32( 4 ),
0535           propagatorOppositeTISE = cms.string( "PropagatorWithMaterialParabolicMfOpposite" )
0536         ),
0537         TrajectoryCleaner = cms.string( "hltESPTrajectoryCleanerBySharedHits" ),
0538         MeasurementTrackerEvent = cms.InputTag( "hltSiStripClusters" ),
0539         cleanTrajectoryAfterInOut = cms.bool( False ),
0540         useHitsSplitting = cms.bool( False ),
0541         RedundantSeedCleaner = cms.string( "CachingSeedCleanerBySharedInput" ),
0542         doSeedingRegionRebuilding = cms.bool( False ),
0543         maxNSeeds = cms.uint32( 100000 ),
0544         TrajectoryBuilderPSet = cms.PSet(  refToPSet_ = cms.string( "HLTIter0HighPtTkMuPSetTrajectoryBuilderIT" ) ),
0545         NavigationSchool = cms.string( "SimpleNavigationSchool" ),
0546         TrajectoryBuilder = cms.string( "" ),
0547     )
0548     process.hltIterL3Iter0HighPtTkMuCtfWithMaterialTracks = cms.EDProducer( "TrackProducer",
0549         src = cms.InputTag( "hltIterL3Iter0HighPtTkMuCkfTrackCandidates" ),
0550         SimpleMagneticField = cms.string( "ParabolicMf" ),
0551         clusterRemovalInfo = cms.InputTag( "" ),
0552         beamSpot = cms.InputTag( "hltOnlineBeamSpot" ),
0553         MeasurementTrackerEvent = cms.InputTag( "hltSiStripClusters" ),
0554         Fitter = cms.string( "hltESPFittingSmootherIT" ),
0555         useHitsSplitting = cms.bool( False ),
0556         MeasurementTracker = cms.string( "" ),
0557         AlgorithmName = cms.string( "iter0" ),
0558         alias = cms.untracked.string( "ctfWithMaterialTracks" ),
0559         NavigationSchool = cms.string( "" ),
0560         TrajectoryInEvent = cms.bool( True ),
0561         TTRHBuilder = cms.string( "hltESPTTRHBWithTrackAngle" ),
0562         GeometricInnerState = cms.bool( True ),
0563         useSimpleMF = cms.bool( True ),
0564         Propagator = cms.string( "hltESPRungeKuttaTrackerPropagator" )
0565     )
0566     process.hltIterL3Iter0HighPtTkMuTrackSelectionHighPurity = cms.EDProducer( "AnalyticalTrackSelector",
0567         max_d0 = cms.double( 100.0 ),
0568         minNumber3DLayers = cms.uint32( 0 ),
0569         max_lostHitFraction = cms.double( 1.0 ),
0570         applyAbsCutsIfNoPV = cms.bool( False ),
0571         qualityBit = cms.string( "highPurity" ),
0572         minNumberLayers = cms.uint32( 3 ),
0573         chi2n_par = cms.double( 0.7 ),
0574         useVtxError = cms.bool( False ),
0575         nSigmaZ = cms.double( 4.0 ),
0576         dz_par2 = cms.vdouble( 0.4, 4.0 ),
0577         applyAdaptedPVCuts = cms.bool( True ),
0578         min_eta = cms.double( -9999.0 ),
0579         dz_par1 = cms.vdouble( 0.35, 4.0 ),
0580         copyTrajectories = cms.untracked.bool( True ),
0581         vtxNumber = cms.int32( -1 ),
0582         max_d0NoPV = cms.double( 100.0 ),
0583         keepAllTracks = cms.bool( False ),
0584         maxNumberLostLayers = cms.uint32( 1 ),
0585         beamspot = cms.InputTag( "hltOnlineBeamSpot" ),
0586         max_relpterr = cms.double( 9999.0 ),
0587         copyExtras = cms.untracked.bool( True ),
0588         max_z0NoPV = cms.double( 100.0 ),
0589         vertexCut = cms.string( "tracksSize>=3" ),
0590         max_z0 = cms.double( 100.0 ),
0591         useVertices = cms.bool( False ),
0592         min_nhits = cms.uint32( 0 ),
0593         src = cms.InputTag( "hltIterL3Iter0HighPtTkMuCtfWithMaterialTracks" ),
0594         max_minMissHitOutOrIn = cms.int32( 99 ),
0595         chi2n_no1Dmod_par = cms.double( 9999.0 ),
0596         vertices = cms.InputTag( "notUsed" ),
0597         max_eta = cms.double( 9999.0 ),
0598         d0_par2 = cms.vdouble( 0.4, 4.0 ),
0599         d0_par1 = cms.vdouble( 0.3, 4.0 ),
0600         res_par = cms.vdouble( 0.003, 0.001 ),
0601         minHitsToBypassChecks = cms.uint32( 20 )
0602     )
0603     process.hltIterL3Iter2HighPtTkMuClustersRefRemoval = cms.EDProducer( "HLTTrackClusterRemoverIterL3",
0604         doStrip = cms.bool( True ),
0605         doStripChargeCheck = cms.bool( True ),
0606         trajectories = cms.InputTag( "hltIterL3Iter0HighPtTkMuTrackSelectionHighPurity" ),
0607         oldClusterRemovalInfo = cms.InputTag( "" ),
0608         stripClusters = cms.InputTag( "hltSiStripRawToClustersFacility" ),
0609         pixelClusters = cms.InputTag( "hltSiPixelClusters" ),
0610         Common = cms.PSet(
0611           maxChi2 = cms.double( 16.0 ),
0612           minGoodStripCharge = cms.double( 60.0 )
0613         ),
0614         doPixel = cms.bool( True )
0615     )
0616     process.hltIterL3Iter2HighPtTkMuMaskedMeasurementTrackerEvent = cms.EDProducer( "MaskedMeasurementTrackerEventProducer",
0617         clustersToSkip = cms.InputTag( "hltIterL3Iter2HighPtTkMuClustersRefRemoval" ),
0618         OnDemand = cms.bool( False ),
0619         src = cms.InputTag( "hltSiStripClusters" )
0620     )
0621     process.hltIterL3Iter2HighPtTkMuPixelLayerPairs = cms.EDProducer( "SeedingLayersEDProducer",
0622         layerList = cms.vstring( 'BPix1+BPix2',
0623           'BPix1+BPix3',
0624           'BPix2+BPix3',
0625           'BPix1+FPix1_pos',
0626           'BPix1+FPix1_neg',
0627           'BPix1+FPix2_pos',
0628           'BPix1+FPix2_neg',
0629           'BPix2+FPix1_pos',
0630           'BPix2+FPix1_neg',
0631           'BPix2+FPix2_pos',
0632           'BPix2+FPix2_neg',
0633           'FPix1_pos+FPix2_pos',
0634           'FPix1_neg+FPix2_neg' ),
0635         MTOB = cms.PSet(  ),
0636         TEC = cms.PSet(  ),
0637         MTID = cms.PSet(  ),
0638         FPix = cms.PSet(
0639           HitProducer = cms.string( "hltSiPixelRecHits" ),
0640           hitErrorRZ = cms.double( 0.0036 ),
0641           useErrorsFromParam = cms.bool( True ),
0642           TTRHBuilder = cms.string( "hltESPTTRHBuilderPixelOnly" ),
0643           skipClusters = cms.InputTag( "hltIterL3Iter2HighPtTkMuClustersRefRemoval" ),
0644           hitErrorRPhi = cms.double( 0.0051 )
0645         ),
0646         MTEC = cms.PSet(  ),
0647         MTIB = cms.PSet(  ),
0648         TID = cms.PSet(  ),
0649         TOB = cms.PSet(  ),
0650         BPix = cms.PSet(
0651           HitProducer = cms.string( "hltSiPixelRecHits" ),
0652           hitErrorRZ = cms.double( 0.006 ),
0653           useErrorsFromParam = cms.bool( True ),
0654           TTRHBuilder = cms.string( "hltESPTTRHBuilderPixelOnly" ),
0655           skipClusters = cms.InputTag( "hltIterL3Iter2HighPtTkMuClustersRefRemoval" ),
0656           hitErrorRPhi = cms.double( 0.0027 )
0657         ),
0658         TIB = cms.PSet(  )
0659     )
0660     process.hltIterL3Iter2HighPtTkMuPixelSeeds = cms.EDProducer( "SeedGeneratorFromRegionHitsEDProducer",
0661         RegionFactoryPSet = IterMasterMuonTrackingRegionBuilder,
0662         SeedComparitorPSet = cms.PSet(
0663           ComponentName = cms.string( "PixelClusterShapeSeedComparitor" ),
0664           ClusterShapeHitFilterName = cms.string( "ClusterShapeHitFilter" ),
0665           FilterPixelHits = cms.bool( True ), #Usually True 
0666           FilterStripHits = cms.bool( False ),
0667           FilterAtHelixStage = cms.bool( True ), #Usually True 
0668           ClusterShapeCacheSrc = cms.InputTag( "hltSiPixelClustersCache" )
0669         ),
0670         ClusterCheckPSet = cms.PSet(
0671           PixelClusterCollectionLabel = cms.InputTag( "hltSiPixelClusters" ),
0672           MaxNumberOfCosmicClusters = cms.uint32( 50000 ),
0673           doClusterCheck = cms.bool( False ),
0674           ClusterCollectionLabel = cms.InputTag( "hltSiStripClusters" ),
0675           MaxNumberOfPixelClusters = cms.uint32( 10000 )
0676         ),
0677         OrderedHitsFactoryPSet = cms.PSet(
0678           maxElement = cms.uint32( 0 ),
0679           ComponentName = cms.string( "StandardHitPairGenerator" ),
0680           GeneratorPSet = cms.PSet(
0681             maxElement = cms.uint32( 100000 ),
0682             SeedComparitorPSet = cms.PSet(  ComponentName = cms.string( "none" ) )
0683           ),
0684           SeedingLayers = cms.InputTag( "hltIterL3Iter2HighPtTkMuPixelLayerPairs" )
0685         ),
0686         SeedCreatorPSet = cms.PSet(  refToPSet_ = cms.string( "HLTSeedFromConsecutiveHitsCreatorIT" ) ),
0687         TTRHBuilder = cms.string( "hltESPTTRHBWithTrackAngle" )
0688     )
0689     process.hltIterL3Iter2HighPtTkMuPixelSeeds.RegionFactoryPSet.ComponentName = cms.string( "MuonTrackingRegionBuilder" )
0690     process.hltIterL3Iter2HighPtTkMuPixelSeeds.RegionFactoryPSet.DeltaR = cms.double( 0.025 )
0691     
0692     process.hltIterL3Iter2HighPtTkMuCkfTrackCandidates = cms.EDProducer( "CkfTrackCandidateMaker",
0693         src = cms.InputTag( "hltIterL3Iter2HighPtTkMuPixelSeeds" ),
0694         maxSeedsBeforeCleaning = cms.uint32( 1000 ),
0695         SimpleMagneticField = cms.string( "ParabolicMf" ),
0696         TransientInitialStateEstimatorParameters = cms.PSet(
0697           propagatorAlongTISE = cms.string( "PropagatorWithMaterialParabolicMf" ),
0698           numberMeasurementsForFit = cms.int32( 4 ),
0699           propagatorOppositeTISE = cms.string( "PropagatorWithMaterialParabolicMfOpposite" )
0700         ),
0701         TrajectoryCleaner = cms.string( "hltESPTrajectoryCleanerBySharedHits" ),
0702         MeasurementTrackerEvent = cms.InputTag( "hltIterL3Iter2HighPtTkMuMaskedMeasurementTrackerEvent" ),
0703         cleanTrajectoryAfterInOut = cms.bool( False ),
0704         useHitsSplitting = cms.bool( False ),
0705         RedundantSeedCleaner = cms.string( "CachingSeedCleanerBySharedInput" ),
0706         doSeedingRegionRebuilding = cms.bool( False ),
0707         maxNSeeds = cms.uint32( 100000 ),
0708         TrajectoryBuilderPSet = cms.PSet(  refToPSet_ = cms.string( "HLTIter2HighPtTkMuPSetTrajectoryBuilderIT" ) ),
0709         NavigationSchool = cms.string( "SimpleNavigationSchool" ),
0710         TrajectoryBuilder = cms.string( "" ),
0711     )
0712     process.hltIterL3Iter2HighPtTkMuCtfWithMaterialTracks = cms.EDProducer( "TrackProducer",
0713         src = cms.InputTag( "hltIterL3Iter2HighPtTkMuCkfTrackCandidates" ),
0714         SimpleMagneticField = cms.string( "ParabolicMf" ),
0715         clusterRemovalInfo = cms.InputTag( "" ),
0716         beamSpot = cms.InputTag( "hltOnlineBeamSpot" ),
0717         MeasurementTrackerEvent = cms.InputTag( "hltIterL3Iter2HighPtTkMuMaskedMeasurementTrackerEvent" ),
0718         Fitter = cms.string( "hltESPFittingSmootherIT" ),
0719         useHitsSplitting = cms.bool( False ),
0720         MeasurementTracker = cms.string( "" ),
0721         AlgorithmName = cms.string( "iter2" ),
0722         alias = cms.untracked.string( "ctfWithMaterialTracks" ),
0723         NavigationSchool = cms.string( "" ),
0724         TrajectoryInEvent = cms.bool( True ),
0725         TTRHBuilder = cms.string( "hltESPTTRHBWithTrackAngle" ),
0726         GeometricInnerState = cms.bool( True ),
0727         useSimpleMF = cms.bool( True ),
0728         Propagator = cms.string( "hltESPRungeKuttaTrackerPropagator" )
0729     )
0730     process.hltIterL3Iter2HighPtTkMuTrackSelectionHighPurity = cms.EDProducer( "AnalyticalTrackSelector",
0731         max_d0 = cms.double( 100.0 ),
0732         minNumber3DLayers = cms.uint32( 0 ),
0733         max_lostHitFraction = cms.double( 1.0 ),
0734         applyAbsCutsIfNoPV = cms.bool( False ),
0735         qualityBit = cms.string( "highPurity" ),
0736         minNumberLayers = cms.uint32( 3 ),
0737         chi2n_par = cms.double( 0.7 ),
0738         useVtxError = cms.bool( False ),
0739         nSigmaZ = cms.double( 4.0 ),
0740         dz_par2 = cms.vdouble( 0.4, 4.0 ),
0741         applyAdaptedPVCuts = cms.bool( True ),
0742         min_eta = cms.double( -9999.0 ),
0743         dz_par1 = cms.vdouble( 0.35, 4.0 ),
0744         copyTrajectories = cms.untracked.bool( True ),
0745         vtxNumber = cms.int32( -1 ),
0746         max_d0NoPV = cms.double( 100.0 ),
0747         keepAllTracks = cms.bool( False ),
0748         maxNumberLostLayers = cms.uint32( 1 ),
0749         beamspot = cms.InputTag( "hltOnlineBeamSpot" ),
0750         max_relpterr = cms.double( 9999.0 ),
0751         copyExtras = cms.untracked.bool( True ),
0752         max_z0NoPV = cms.double( 100.0 ),
0753         vertexCut = cms.string( "tracksSize>=3" ),
0754         max_z0 = cms.double( 100.0 ),
0755         useVertices = cms.bool( False ),
0756         min_nhits = cms.uint32( 0 ),
0757         src = cms.InputTag( "hltIterL3Iter2HighPtTkMuCtfWithMaterialTracks" ),
0758         max_minMissHitOutOrIn = cms.int32( 99 ),
0759         chi2n_no1Dmod_par = cms.double( 9999.0 ),
0760         vertices = cms.InputTag( "notUsed" ),
0761         max_eta = cms.double( 9999.0 ),
0762         d0_par2 = cms.vdouble( 0.4, 4.0 ),
0763         d0_par1 = cms.vdouble( 0.3, 4.0 ),
0764         res_par = cms.vdouble( 0.003, 0.001 ),
0765         minHitsToBypassChecks = cms.uint32( 20 )
0766     )
0767     if not hasattr(process, "hltTrackAlgoPriorityOrder"):
0768         from RecoTracker.FinalTrackSelectors.trackAlgoPriorityOrder_cfi import trackAlgoPriorityOrder
0769         process.hltTrackAlgoPriorityOrder = trackAlgoPriorityOrder.clone(
0770             ComponentName = "hltTrackAlgoPriorityOrder",
0771             algoOrder = [] # HLT iteration order is correct in the hard-coded default
0772         )
0773     process.hltIterL3Iter2HighPtTkMuMerged = cms.EDProducer( "TrackListMerger",
0774         ShareFrac = cms.double( 0.19 ),
0775         writeOnlyTrkQuals = cms.bool( False ),
0776         MinPT = cms.double( 0.05 ),
0777         allowFirstHitShare = cms.bool( True ),
0778         copyExtras = cms.untracked.bool( True ),
0779         Epsilon = cms.double( -0.001 ),
0780         selectedTrackQuals = cms.VInputTag( 'hltIterL3Iter0HighPtTkMuTrackSelectionHighPurity','hltIterL3Iter2HighPtTkMuTrackSelectionHighPurity' ),
0781         indivShareFrac = cms.vdouble( 1.0, 1.0 ),
0782         MaxNormalizedChisq = cms.double( 1000.0 ),
0783         copyMVA = cms.bool( False ),
0784         FoundHitBonus = cms.double( 5.0 ),
0785         setsToMerge = cms.VPSet( 
0786           cms.PSet(  pQual = cms.bool( False ),
0787             tLists = cms.vint32( 0, 1 )
0788           )
0789         ),
0790         MinFound = cms.int32( 3 ),
0791         hasSelector = cms.vint32( 0, 0 ),
0792         TrackProducers = cms.VInputTag( 'hltIterL3Iter0HighPtTkMuTrackSelectionHighPurity','hltIterL3Iter2HighPtTkMuTrackSelectionHighPurity' ),
0793         LostHitPenalty = cms.double( 20.0 ),
0794         newQuality = cms.string( "confirmed" ),
0795         trackAlgoPriorityOrder = cms.string("hltTrackAlgoPriorityOrder"),
0796     )
0797 
0798     #Iterative tracking finished
0799     
0800     # L3MuonProducer from iterative tracking:
0801     process.hltL3MuonsIterL3IO = cms.EDProducer( "L3MuonProducer",
0802         ServiceParameters = cms.PSet(
0803           Propagators = cms.untracked.vstring( 'hltESPSmartPropagatorAny',
0804             'SteppingHelixPropagatorAny',
0805             'hltESPSmartPropagator',
0806             'hltESPSteppingHelixPropagatorOpposite' ),
0807           RPCLayers = cms.bool( True ),
0808           UseMuonNavigation = cms.untracked.bool( True )
0809         ),
0810         L3TrajBuilderParameters = cms.PSet(
0811           ScaleTECyFactor = cms.double( -1.0 ),
0812           GlbRefitterParameters = cms.PSet(
0813             TrackerSkipSection = cms.int32( -1 ),
0814             DoPredictionsOnly = cms.bool( False ),
0815             PropDirForCosmics = cms.bool( False ),
0816             HitThreshold = cms.int32( 1 ),
0817             RefitFlag = cms.bool( True ),           #Usually true
0818             MuonHitsOption = cms.int32( 1 ),
0819             Chi2CutRPC = cms.double( 1.0 ),
0820             Fitter = cms.string( "hltESPL3MuKFTrajectoryFitter" ),
0821             DTRecSegmentLabel = cms.InputTag( "hltDt4DSegments" ),
0822             TrackerRecHitBuilder = cms.string( "hltESPTTRHBWithTrackAngle" ),
0823             MuonRecHitBuilder = cms.string( "hltESPMuonTransientTrackingRecHitBuilder" ),
0824             RefitDirection = cms.string( "insideOut" ),
0825             CSCRecSegmentLabel = cms.InputTag( "hltCscSegments" ),
0826             Chi2CutCSC = cms.double( 150.0 ),
0827             Chi2CutDT = cms.double( 10.0 ),
0828             RefitRPCHits = cms.bool( True ),
0829             SkipStation = cms.int32( -1 ),
0830             Propagator = cms.string( "hltESPSmartPropagatorAny" ),
0831             TrackerSkipSystem = cms.int32( -1 ),
0832             DYTthrs = cms.vint32( 30, 15 )
0833           ),
0834           ScaleTECxFactor = cms.double( -1.0 ),
0835           TrackerRecHitBuilder = cms.string( "hltESPTTRHBWithTrackAngle" ),
0836           MuonRecHitBuilder = cms.string( "hltESPMuonTransientTrackingRecHitBuilder" ),
0837           MuonTrackingRegionBuilder = cms.PSet(
0838             Rescale_eta = cms.double( 3.0 ),
0839             Rescale_phi = cms.double( 3.0 ),
0840             Rescale_Dz = cms.double( 4.0 ),                 #Normally 4
0841             EtaR_UpperLimit_Par1 = cms.double( 0.25 ),      #Normally 0.25
0842             EtaR_UpperLimit_Par2 = cms.double( 0.15 ),      #Normally 0.15
0843             PhiR_UpperLimit_Par1 = cms.double( 0.6 ),       #Normally 0.6
0844             PhiR_UpperLimit_Par2 = cms.double( 0.2 ),       #Normally 0.2
0845             UseVertex = cms.bool( False ),                  #Normally False
0846             Pt_fixed = cms.bool( False ),                   #Normally True
0847             Z_fixed = cms.bool( False ),    #True for IOH
0848             Phi_fixed = cms.bool( True ),   #False for IOH
0849             Eta_fixed = cms.bool( True ),   #False for IOH
0850             Pt_min = cms.double( 3.0 ),     #Is 0.9 for Tau; normally 8 here
0851             Phi_min = cms.double( 0.1 ),
0852             Eta_min = cms.double( 0.1 ),
0853             DeltaZ = cms.double( 24.2 ),    #default for tau: 24.2, for old IOH: 15.9
0854             DeltaR = cms.double( 0.025 ),   #This changes for different iterations. for old IOH: ?
0855             DeltaEta = cms.double( 0.04 ),  #default 0.15
0856             DeltaPhi = cms.double( 0.15 ),   #default 0.2
0857             maxRegions = cms.int32( 2 ),
0858             precise = cms.bool( True ),
0859             OnDemand = cms.int32( -1 ),
0860             MeasurementTrackerName = cms.InputTag( "hltESPMeasurementTracker" ),
0861             beamSpot = cms.InputTag( "hltOnlineBeamSpot" ),
0862             vertexCollection = cms.InputTag( "pixelVertices" ), #Warning: I am not generating colleciton. Vertex is off anyway
0863             input = cms.InputTag( 'hltL2Muons','UpdatedAtVtx' )
0864           ),
0865 #         MuonTrackingRegionBuilder = MasterMuonTrackingRegionBuilder,  #Using the master Muon ROI params - Although it is not used
0866           RefitRPCHits = cms.bool( True ),
0867           PCut = cms.double( 2.5 ),
0868           TrackTransformer = cms.PSet(
0869             DoPredictionsOnly = cms.bool( False ),
0870             Fitter = cms.string( "hltESPL3MuKFTrajectoryFitter" ),
0871             TrackerRecHitBuilder = cms.string( "hltESPTTRHBWithTrackAngle" ),
0872             Smoother = cms.string( "hltESPKFTrajectorySmootherForMuonTrackLoader" ),
0873             MuonRecHitBuilder = cms.string( "hltESPMuonTransientTrackingRecHitBuilder" ),
0874             RefitDirection = cms.string( "insideOut" ),
0875             RefitRPCHits = cms.bool( True ),
0876             Propagator = cms.string( "hltESPSmartPropagatorAny" )
0877           ),
0878           GlobalMuonTrackMatcher = cms.PSet(
0879             Pt_threshold1 = cms.double( 0.0 ),
0880             DeltaDCut_3 = cms.double( 15.0 ),
0881             MinP = cms.double( 2.5 ),
0882             MinPt = cms.double( 1.0 ),
0883             Chi2Cut_1 = cms.double( 50.0 ),
0884             Pt_threshold2 = cms.double( 9.99999999E8 ),
0885             LocChi2Cut = cms.double( 0.001 ),
0886             Eta_threshold = cms.double( 1.2 ),
0887             Quality_3 = cms.double( 7.0 ),
0888             Quality_2 = cms.double( 15.0 ),
0889             Chi2Cut_2 = cms.double( 50.0 ),
0890             Chi2Cut_3 = cms.double( 200.0 ),
0891             DeltaDCut_1 = cms.double( 40.0 ),
0892             DeltaRCut_2 = cms.double( 0.2 ),
0893             DeltaRCut_3 = cms.double( 1.0 ),
0894             DeltaDCut_2 = cms.double( 10.0 ),
0895             DeltaRCut_1 = cms.double( 0.1 ),
0896             Propagator = cms.string( "hltESPSmartPropagator" ),
0897             Quality_1 = cms.double( 20.0 )
0898           ),
0899           PtCut = cms.double( 1.0 ),
0900           TrackerPropagator = cms.string( "SteppingHelixPropagatorAny" ),
0901           tkTrajLabel = cms.InputTag( "hltIterL3Iter2HighPtTkMuMerged" ),      #Feed tracks from iterations into L3MTB
0902           tkTrajBeamSpot = cms.InputTag( "hltOnlineBeamSpot" ),
0903           tkTrajMaxChi2 = cms.double( 9999.0 ),
0904           tkTrajMaxDXYBeamSpot = cms.double( 9999.0 ),      #same cuts as old algos
0905           tkTrajVertex = cms.InputTag( "pixelVertices" ),
0906           tkTrajUseVertex = cms.bool( False ),
0907           matchToSeeds = cms.bool( True )
0908         ),
0909         TrackLoaderParameters = cms.PSet(
0910           PutTkTrackIntoEvent = cms.untracked.bool( False ),
0911           beamSpot = cms.InputTag( "hltOnlineBeamSpot" ),
0912           SmoothTkTrack = cms.untracked.bool( False ),
0913           MuonSeededTracksInstance = cms.untracked.string( "L2Seeded" ),
0914           Smoother = cms.string( "hltESPKFTrajectorySmootherForMuonTrackLoader" ),
0915           MuonUpdatorAtVertexParameters = cms.PSet(
0916             MaxChi2 = cms.double( 1000000.0 ),
0917             Propagator = cms.string( "hltESPSteppingHelixPropagatorOpposite" ),
0918             BeamSpotPositionErrors = cms.vdouble( 0.1, 0.1, 5.3 )
0919           ),
0920           VertexConstraint = cms.bool( False ),
0921           DoSmoothing = cms.bool( False )   #Usually true
0922         ),
0923         MuonCollectionLabel = cms.InputTag( 'hltL2Muons','UpdatedAtVtx' )
0924     )
0925     
0926     process.hltIterL3MuonsLinksCombination = cms.EDProducer( "L3TrackLinksCombiner",
0927         labels = cms.VInputTag( 'hltL3MuonsIterL3OI','hltL3MuonsIterL3IO' )
0928     )
0929     process.hltIterL3Muons = cms.EDProducer( "L3TrackCombiner",
0930         labels = cms.VInputTag( 'hltL3MuonsIterL3OI','hltL3MuonsIterL3IO' )
0931     )
0932     process.hltIterL3MuonCandidates = cms.EDProducer( "L3MuonCandidateProducer",
0933         InputLinksObjects = cms.InputTag( "hltIterL3MuonsLinksCombination" ),
0934         InputObjects = cms.InputTag( "hltIterL3Muons" ),
0935         MuonPtOption = cms.string( "Tracker" )
0936     )
0937 
0938 ### FOR IO Only:
0939 #   process.hltIterL3MuonCandidates.InputLinksObjects = cms.InputTag( "hltL3MuonsIterL3IO" )
0940 #   process.hltIterL3MuonCandidates.InputObjects = cms.InputTag( "hltL3MuonsIterL3IO" )
0941 #        process.hltL3fL1sMu16orMu25L1f0L2f16QL3Filtered50Q.InputLinks = cms.InputTag( "hltL3MuonsIterL3IO" )
0942 
0943 ###    FOR OI Only:
0944 #   process.hltIterL3MuonCandidates.InputLinksObjects = cms.InputTag( "hltL3MuonsIterL3OI" )
0945 #   process.hltIterL3MuonCandidates.InputObjects = cms.InputTag( "hltL3MuonsIterL3OI" )
0946 #        process.hltL3fL1sMu16orMu25L1f0L2f16QL3Filtered50Q.InputLinks = cms.InputTag( "hltL3MuonsIterL3OI" )
0947     #############################################################
0948     
0949     ####################### NEW Combo:
0950     process.HLTIterL3IterativeTrackingHighPtTkMuIteration0 = cms.Sequence(
0951      process.hltPixelLayerTriplets +
0952          process.hltPixelTracksTrackingRegions +
0953          process.hltPixelTracksHitDoublets +
0954          process.hltPixelTracksHitTriplets +
0955          process.hltPixelTracksFitter +
0956      process.hltPixelTrackFilterByKinematics +
0957      process.hltIterL3Iter0HighPtTkMuPixelTracks +
0958      process.hltIterL3Iter0HighPtTkMuPixelSeedsFromPixelTracks +
0959      process.hltIterL3Iter0HighPtTkMuCkfTrackCandidates +
0960      process.hltIterL3Iter0HighPtTkMuCtfWithMaterialTracks +
0961      process.hltIterL3Iter0HighPtTkMuTrackSelectionHighPurity
0962     )
0963     process.HLTIterL3IterativeTrackingHighPtTkMuIteration2 = cms.Sequence(
0964      process.hltIterL3Iter2HighPtTkMuClustersRefRemoval +
0965      process.hltIterL3Iter2HighPtTkMuMaskedMeasurementTrackerEvent +
0966      process.hltIterL3Iter2HighPtTkMuPixelLayerPairs +
0967      process.hltIterL3Iter2HighPtTkMuPixelSeeds +
0968      process.hltIterL3Iter2HighPtTkMuCkfTrackCandidates +
0969      process.hltIterL3Iter2HighPtTkMuCtfWithMaterialTracks +
0970      process.hltIterL3Iter2HighPtTkMuTrackSelectionHighPurity
0971     )
0972     process.HLTIterL3IterativeTrackingHighPtTkMu = cms.Sequence(
0973      process.HLTIterL3IterativeTrackingHighPtTkMuIteration0 +
0974      process.HLTIterL3IterativeTrackingHighPtTkMuIteration2 +
0975      process.hltIterL3Iter2HighPtTkMuMerged
0976     )
0977     
0978     process.HLTL3muonTkCandidateSequence = cms.Sequence(
0979      process.HLTDoLocalPixelSequence + process.HLTDoLocalStripSequence +
0980      process.HLTRecopixelvertexingSequence +
0981      process.hltIterL3OISeedsFromL2Muons +  #OIStart#off for IO
0982      process.hltIterL3OITrackCandidates +       #off for IO
0983      process.hltIterL3MuonSeededTracksOutIn +       #off for IO
0984      process.hltL3MuonsIterL3OI +           #off for IO
0985      process.hltL2SelectorForL3IO  + #OIEnd     #off for IO
0986      process.HLTIterL3IterativeTrackingHighPtTkMu + #off for OI
0987      process.hltL3MuonsIterL3IO                 #off for OI
0988     )
0989     
0990     process.HLTL3muonrecoNocandSequence = cms.Sequence(
0991      process.HLTL3muonTkCandidateSequence
0992      + process.hltIterL3MuonsLinksCombination   #off for IO or OI only
0993      + process.hltIterL3Muons           #off for IO or OI only
0994     )
0995     process.HLTL3muonrecoSequence = cms.Sequence(
0996      process.HLTL3muonrecoNocandSequence
0997      + process.hltIterL3MuonCandidates
0998     )
0999 
1000     return process