Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-06-03 00:12:21

0001 # functions to alter configurations
0002 
0003 import FWCore.ParameterSet.Config as cms
0004 
0005 # configures track finding s/w to behave as track finding f/w
0006 def fwConfig(process):
0007   process.l1tTTTracksFromTrackletEmulation.Fakefit = True
0008   process.l1tTTTracksFromTrackletEmulation.RemovalType = ""
0009   process.l1tTTTracksFromTrackletEmulation.DoMultipleMatches = False
0010   process.l1tTTTracksFromTrackletEmulation.StoreTrackBuilderOutput = True
0011 
0012 # configures track finding s/w to behave as a subchain of processing steps
0013 def reducedConfig(process):
0014   fwConfig(process)
0015   process.TrackTriggerSetup.Firmware.FreqBEHigh = 240 # Frequency of DTC & KF (determines truncation)
0016   process.TrackTriggerSetup.KalmanFilter.NumWorker = 1
0017   process.ChannelAssignment.SeedTypes = cms.vstring( "L1L2" )
0018   process.ChannelAssignment.SeedTypesSeedLayers = cms.PSet( L1L2 = cms.vint32( 1,  2 ) )
0019   process.ChannelAssignment.SeedTypesProjectionLayers = cms.PSet( L1L2 = cms.vint32(  3,  4,  5,  6 ) )
0020   # this are tt::Setup::dtcId in order as in process.l1tTTTracksFromTrackletEmulation.processingModulesFile translated by 
0021   # reverssing naming logic described in L1FPGATrackProducer
0022   # TO DO: Eliminate cfg param IRChannelsIn by taking this info from Tracklet wiring map.
0023   process.ChannelAssignment.IRChannelsIn = cms.vint32( 0, 1, 25, 2, 26, 4, 5, 29, 6, 30, 7, 31, 8, 9, 33 )
0024   process.l1tTTTracksFromTrackletEmulation.Reduced = True
0025   process.l1tTTTracksFromTrackletEmulation.memoryModulesFile = 'L1Trigger/TrackFindingTracklet/data/reduced_memorymodules.dat'
0026   process.l1tTTTracksFromTrackletEmulation.processingModulesFile = 'L1Trigger/TrackFindingTracklet/data/reduced_processingmodules.dat'
0027   process.l1tTTTracksFromTrackletEmulation.wiresFile = 'L1Trigger/TrackFindingTracklet/data/reduced_wires.dat'
0028 
0029 # configures pure tracklet algorithm (as opposed to Hybrid algorithm)
0030 def trackletConfig(process):
0031   process.l1tTTTracksFromTrackletEmulation.fitPatternFile = cms.FileInPath('L1Trigger/TrackFindingTracklet/data/fitpattern.txt') 
0032 
0033 # configures KF simulation in emulation chain
0034 def oldKFConfig(process):
0035   #===== Use HYBRID TRACKING (Tracklet pattern reco + TMTT KF -- requires tracklet C++ too) =====
0036   process.ProducerKF.Hybrid                                   = True
0037   # Emulate dead/inefficient modules using the StubKiller code, with stubs killed according to the scenarios of the Stress Test group. 
0038   # (0=Don't kill any stubs; 1-5 = Scenarios described in StubKiller.cc) 
0039   process.ProducerKF.DeadModuleOpts.KillScenario              = 0
0040   # Modify TMTT tracking to try to recover tracking efficiency in presence of dead modules. (Does nothing if KillScenario = 0).
0041   process.ProducerKF.DeadModuleOpts.KillRecover               = False
0042   # Min track Pt that Hough Transform must find. Also used by StubCuts.KillLowPtStubs and by EtaPhiSectors.UseStubPhi.
0043   process.ProducerKF.HTArraySpecRphi.HoughMinPt               = 2.
0044   # Optionally skip track digitisation if done internally inside fitting code.
0045   process.ProducerKF.TrackDigi.KF_skipTrackDigi               = True
0046   # Digitize stub coords? If not, use floating point coords.
0047   process.ProducerKF.StubDigitize.EnableDigitize              = False
0048   # Use an FPGA-friendly approximation to determine track angle dphi from bend in GP?
0049   process.ProducerKF.GeometricProc.UseApproxB                 = True
0050   # Gradient term of linear equation for approximating B
0051   process.ProducerKF.GeometricProc.BApprox_gradient           = 0.886454
0052   # Intercept term of linear equation for approximating B
0053   process.ProducerKF.GeometricProc.BApprox_intercept          = 0.504148
0054   # Divisions of Tracker at GP.
0055   process.ProducerKF.PhiSectors.NumPhiSectors                 = 9
0056   # Divisions of Tracker at DTC
0057   process.ProducerKF.PhiSectors.NumPhiNonants                 = 9
0058   # Use phi of track at this radius for assignment of stubs to phi sectors & also for one of the axes of the r-phi HT. If ChosenRofPhi=0, then use track phi0. - Should be an integer multiple of the stub r digitisation granularity.
0059   process.ProducerKF.PhiSectors.ChosenRofPhi                  = 55.
0060   # Eta boundaries for 16 eta regions
0061   process.ProducerKF.EtaSectors.EtaRegions                    = [-2.4, -2.08, -1.68, -1.26, -0.90, -0.62, -0.41, -0.20, 0.0, 0.20, 0.41, 0.62, 0.90, 1.26, 1.68, 2.08, 2.4]
0062   # Use z of track at this radius for assignment of tracks to eta sectors & also for one of the axes of the r-z HT. Do not set to zero!
0063   process.ProducerKF.EtaSectors.ChosenRofZ                    = 50.0
0064   # Fit will reject fitted tracks unless it can assign at least this number of stubs to them.
0065   process.ProducerKF.TrackFitSettings.KalmanMinNumStubs       = 4
0066   # Fit will attempt to add up to this nummber of stubs to each fitted tracks, but won't bother adding more.
0067   process.ProducerKF.TrackFitSettings.KalmanMaxNumStubs       = 6
0068   # Allow the KF to skip this many layers in total per track.
0069   process.ProducerKF.TrackFitSettings.KalmanMaxSkipLayersHard = 1
0070   # For HT tracks with few stubs
0071   process.ProducerKF.TrackFitSettings.KalmanMaxSkipLayersEasy = 2
0072    # Max stubs an HT track can have to be "easy".
0073   process.ProducerKF.TrackFitSettings.KalmanMaxStubsEasy      = 10
0074   # KF will consider at most this #stubs per layer to save time.
0075   process.ProducerKF.TrackFitSettings.KalmanMaxStubsPerLayer  = 4
0076   # Multiple scattering term - inflate hit phi errors by this divided by Pt (0.00075 gives best helix resolution & 0.00450 gives best chi2 distribution).
0077   process.ProducerKF.TrackFitSettings.KalmanMultiScattTerm    = 0.00075
0078   # Scale down chi2 in r-phi plane by this factor to improve electron performance (should be power of 2)
0079   process.ProducerKF.TrackFitSettings.KalmanChi2RphiScale     = 8
0080   # Disable "maybe layer" to match with firmware
0081   process.ProducerKF.TrackFitSettings.KFUseMaybeLayers        = True
0082   # Remove requirement of at least 2 PS layers per track.
0083   process.ProducerKF.TrackFitSettings.KalmanRemove2PScut      = True
0084   #--- Cuts applied to KF states as a function of the last KF tracker layer they had a stub in.
0085   # (If "4" or "5" in name, cut only applies to 4 or 5 param helix fit).
0086   process.ProducerKF.TrackFitSettings.KFLayerVsPtToler        = [999., 999., 0.1, 0.1, 0.05, 0.05, 0.05]
0087   # d0 cut only applied to 5 param helix fit.
0088   process.ProducerKF.TrackFitSettings.KFLayerVsD0Cut5         = [999., 999., 999., 10., 10., 10., 10.]
0089   process.ProducerKF.TrackFitSettings.KFLayerVsZ0Cut5         = [999., 999., 25.5, 25.5, 25.5, 25.5, 25.5]
0090   process.ProducerKF.TrackFitSettings.KFLayerVsZ0Cut4         = [999., 999., 15., 15., 15., 15., 15.]
0091   # Chi2 cuts should be retuned if KalmanMultiScattTerm value changed.
0092   process.ProducerKF.TrackFitSettings.KFLayerVsChiSq5         = [999., 999., 10., 30., 80., 120., 160.]
0093   process.ProducerKF.TrackFitSettings.KFLayerVsChiSq4         = [999., 999., 10., 30., 80., 120., 160.]
0094   # For 5-param helix fits, calculate also beam-constrained helix params after fit is complete, & use them for duplicate removal if DupTrkAlgFit=1.
0095   process.ProducerKF.TrackFitSettings.KalmanAddBeamConstr     = False
0096   # Use approx calc to account for non-radial endcap 2S modules corresponding to current FW, with  no special treatment for tilted modules.
0097   process.ProducerKF.TrackFitSettings.KalmanHOfw              = False
0098   # Treat z uncertainty in tilted barrel modules correctly.
0099   process.ProducerKF.TrackFitSettings.KalmanHOtilted          = True
0100   # Projection from (r,phi) to (z,phi) for endcap 2S modules. (0=disable correction, 1=correct with offset, 2=correct with non-diagonal stub covariance matrix). -- Option 1 is easier in FPGA, but only works if fit adds PS stubs before 2S ones.
0101   process.ProducerKF.TrackFitSettings.KalmanHOprojZcorr       = 1
0102   # Alpha correction for non-radial 2S endcap strips. (0=disable correction, 1=correct with offset, 2=correct with non-diagonal stub covariance matrix). -- Option 1 is easier in FPGA, but only works if fit adds PS stubs before 2S ones.
0103   process.ProducerKF.TrackFitSettings.KalmanHOalpha           = 0
0104   # Higher order circle explansion terms for low Pt.
0105   process.ProducerKF.TrackFitSettings.KalmanHOhelixExp        = True
0106   # Larger number has more debug printout. "1" is useful for understanding why tracks are lost, best combined with TrackFitCheat=True.
0107   process.ProducerKF.TrackFitSettings.KalmanDebugLevel        = 0