diff --git a/Trigger/EFTracking/FPGATrackSim/FPGATrackSimConfTools/python/FPGATrackSimAnalysisConfig.py b/Trigger/EFTracking/FPGATrackSim/FPGATrackSimConfTools/python/FPGATrackSimAnalysisConfig.py index 25d3fc9cea6c9bc3faed02de94bca95e9a710f33..046caae5df135fb3a452dbc357ff54e8dde1be0d 100755 --- a/Trigger/EFTracking/FPGATrackSim/FPGATrackSimConfTools/python/FPGATrackSimAnalysisConfig.py +++ b/Trigger/EFTracking/FPGATrackSim/FPGATrackSimConfTools/python/FPGATrackSimAnalysisConfig.py @@ -525,7 +525,26 @@ def FPGATrackSimLogicalHitsProcessAlgCfg(inputFlags): return result - +def getChi2Cut(region): + #list of chi2 cuts for time being. Last four are stand ins since those new regions don't work for now! + chi2cut_l = [12, 16, 60, 16, 60, 60, 14, 20, 16, 19, 19, 15, 18, 12, 15, 15, 20, 20, 20, 20] + binSize = 0.2 + side = (region >> 5) & 0x1 + etaBin = (region >> 6) & 0x1F + etaRange = [round(binSize * etaBin, 1), round(binSize * (etaBin + 1), 1)] if side else [round(-binSize * (etaBin + 1), 1), round(-binSize * etaBin, 1)] + abs_etaRange = tuple(abs(val) for val in etaRange) + + eta_to_chi2 = { + (0.0, 0.2): chi2cut_l[0], (0.2, 0.4): chi2cut_l[1], (0.4, 0.6): chi2cut_l[2], + (0.6, 0.8): chi2cut_l[3], (0.8, 1.0): chi2cut_l[4], (1.0, 1.2): chi2cut_l[5], + (1.2, 1.4): chi2cut_l[6], (1.4, 1.6): chi2cut_l[7], (1.6, 1.8): chi2cut_l[8], + (1.8, 2.0): chi2cut_l[9], (2.0, 2.2): chi2cut_l[10], (2.2, 2.4): chi2cut_l[11], + (2.4, 2.6): chi2cut_l[12], (2.6, 2.8): chi2cut_l[13], (2.8, 3.0): chi2cut_l[14], + (3.0, 3.2): chi2cut_l[15], (3.2, 3.4): chi2cut_l[16], (3.4, 3.6): chi2cut_l[17], + (3.6, 3.8): chi2cut_l[18], (3.8, 4.0): chi2cut_l[19] + } + + return eta_to_chi2.get(abs_etaRange, 9) #Set default chi2 if the region is not found if __name__ == "__main__": @@ -556,6 +575,9 @@ if __name__ == "__main__": # flags.Exec.DebugStage="exec" # useful option to debug the execution of the job - we want it commented out for production flags.fillFromArgs() + + if flags.Trigger.FPGATrackSim.Hough.useVaryingChi2Cut: + flags.Trigger.FPGATrackSim.Hough.chi2cut = getChi2Cut(flags.Trigger.FPGATrackSim.region) assert not flags.Trigger.FPGATrackSim.pipeline.startswith('F-5'),"ERROR You are trying to run an F-5* pipeline! This is not yet supported!" diff --git a/Trigger/EFTracking/FPGATrackSim/FPGATrackSimConfTools/python/FPGATrackSimConfigFlags.py b/Trigger/EFTracking/FPGATrackSim/FPGATrackSimConfTools/python/FPGATrackSimConfigFlags.py index 79d4ab21b2754bf9a68f07409245cf2d44ffe5ed..cfdce84e079763a010e89b5d6234b54496dd169d 100755 --- a/Trigger/EFTracking/FPGATrackSim/FPGATrackSimConfTools/python/FPGATrackSimConfigFlags.py +++ b/Trigger/EFTracking/FPGATrackSim/FPGATrackSimConfTools/python/FPGATrackSimConfigFlags.py @@ -180,7 +180,7 @@ def createBasicFPGATrackSimConfigFlags(): cf.addFlag('idealCoordFitType', 2) cf.addFlag('doDeltaGPhis', False) cf.addFlag('chi2cut', 9) - + cf.addFlag('useVaryingChi2Cut', False) # second stage fitting cf.addFlag('secondStage', False) cf.addFlag('secondChi2Cut', 36)